-
Notifications
You must be signed in to change notification settings - Fork 36
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
Port prometheus to opencensus wrapper #92
base: master
Are you sure you want to change the base?
Conversation
Why not just expose all metrics, all the time? They're suitably name-spaced that choosing which ones to use can be done further down the line by tools better suited for it. |
maybe i misunderstood but doesn’t registering them cause them to impact performance? idea was to allow users to selectively not register metrics. definitely down to instrument everything if we don’t mind! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine.
Btw, what's with all the junk in go.sum? Maybe we need to go mod tidy
.
Note CI is failing again. |
p2pd/metrics.go
Outdated
} | ||
view.RegisterExporter(pe) | ||
|
||
if err = psmetrics.Register(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per comments on the other PR, this would look like this: https://github.com/anacrolix/go-libp2p-dht-tool/blob/feat/oc-metrics/main.go#L377. What do you think?
mux := http.NewServeMux() | ||
mux.Handle("/metrics", pe) | ||
if err := http.ListenAndServe(*metricsAddr, mux); err != nil { | ||
log.Printf("setting up metrics endpoint (%s): %s", *metricsAddr, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try setting up metrics endpoint %q: %v
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k!
This change also introduces a very naive metricsModules map that collects, by name, all of the modules present in the daemon.
This change also introduces a very naive metricsModules map that
collects, by name, all of the modules present in the daemon.
Sorry for the confusion here, @vyzo. @anacrolix and @lanzafame made a compelling argument to switch to OpenCensus and I decided to make the jump before it's too late. Still exposing a prometheus-friendly collection endpoint.