-
Notifications
You must be signed in to change notification settings - Fork 568
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
Improvements to the instrumentation/runtime package #2624
Comments
In Go-1.19 I used this code to print the 1.19 runtime metrics. What I like about this approach is that the Go team is able to introduce new metrics without modifying this code. Note that all non-cumulative non-histogram values are printed as UpDownCounter, not Gauge. None of the 1.19 runtime metrics are true gauges, they are all counts, however this could change in the future.
|
For what it's worth, we are happy with https://github.com/lightstep/otel-launcher-go/tree/main/lightstep/instrumentation/runtime and are happy to help return that code, which was forked, to this repository. One thing is we are still missing asynchronous histogram support, which could be accomplished now using |
There is no guarantee if the instruments provided by this package will be stable. Each version (and implementation of Go) can produce different metrics. Right now the https://pkg.go.dev/runtime/metrics doc even says that "The set of metrics defined by this package may evolve as the runtime itself evolves". The runtime package in Go Contrib should follow semconv and we should do our best to offer telemetry stability. As for now, I think it is better to have it in a separate repository and it can be added to OTel Registry.
|
Background
Go-1.16 introduced a new
runtime/metrics
package that provides official metric names for all of the Go runtime properties worthy of monitoring. Ideally, I think we should migrate from the currentinstrumentation/runtime
metrics to use exactly the names given by the Go team. This will require deprecation of the old names, which is not directly supported by OTel's schema migration support.The runtime/metrics API is well suited to OTel's asynchronous instrument model, except for the appearance of 4 histograms (1 of them a Gauge histogram). These issues are being tracked at open-telemetry/opentelemetry-specification#2713 and open-telemetry/opentelemetry-specification#2714.
For the non-histogram metric values, these could easily be turned into OTel asynchronous instruments and callbacks. However, this looks like an area where users may want some configurability. Which would users prefer to see:
I think I would prefer the second option. Ideally, I would like to see OTel specify "API Hints" for instrumentation to supply their own default Views. This would allow an instrumentation package to instrument more than is enabled by default. See open-telemetry/opentelemetry-specification#2229
The text was updated successfully, but these errors were encountered: