Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus ipfs_http_request metrics are not exposed #7983

Closed
thibmeu opened this issue Mar 15, 2021 · 5 comments · Fixed by #7986
Closed

Prometheus ipfs_http_request metrics are not exposed #7983

thibmeu opened this issue Mar 15, 2021 · 5 comments · Fixed by #7986
Assignees
Labels
kind/bug A bug in existing code (including security flaws) need/analysis Needs further analysis before proceeding

Comments

@thibmeu
Copy link
Contributor

thibmeu commented Mar 15, 2021

Version information:

Custom implementation not using the cli
go-ipfs version: v0.8.0 tag
System version: amd64/linux
Golang version: 1.15.8

Description:

Starting v0.8.0, prometheus metrics exposed by MetricsCollectionOption are not exposed to prometheus DefaultRegisterer.
When OpenCensus Metrics were added, all prometheus.Register of MetricsCollectionOption were changed to register on a new custom registry. There are no comment on this change in the PR or in the changelog for v0.8.0.

// file core/corehttp/metrics.go
promRegistry := prometheus.NewRegistry()
//...

if err := promRegistry.Register(reqCnt); err != nil {
  // note: this is always false, as the registry is new.
  if are, ok := err.(prometheus.AlreadyRegisteredError); ok {
//...

This registry is not returned and does not include any collector. So while metrics are still registered, I cannot find how to expose them.

A possible fix is to remove the addition of this new registry for this metric. An other option is to expose this new registry as a global variable which can then be collected.

@thibmeu thibmeu added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Mar 15, 2021
@welcome
Copy link

welcome bot commented Mar 15, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@Lekensteyn
Copy link
Contributor

CC @lanzafame @aschmahmann, a potential regression from #7593

@aschmahmann aschmahmann added need/analysis Needs further analysis before proceeding and removed need/triage Needs initial labeling and prioritization labels Mar 15, 2021
@aschmahmann
Copy link
Contributor

cc @marten-seemann if you have time to take a look

@lanzafame
Copy link
Contributor

Sorry, this one is on me. #7986 contains the fix.
CC @aschmahmann

@thibmeu
Copy link
Contributor Author

thibmeu commented Mar 17, 2021

The fix looks good to me. That's the exact same one I have on my configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/analysis Needs further analysis before proceeding
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants