-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[mdatagen] add Meter/Tracer func to simplify instrumenting code #29927
[mdatagen] add Meter/Tracer func to simplify instrumenting code #29927
Conversation
This allows us to support all component types via a map. This will be used when adding the Meter func in mdatagen to produce consistent scope names for other components than receivers/scrapers. Signed-off-by: Alex Boten <aboten@lightstep.com>
This returns a Meter w/ the scopeName set for each component. Signed-off-by: Alex Boten <aboten@lightstep.com>
return settings.MeterProvider.Meter("{{ .ScopeName }}") | ||
} |
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.
I would start a new telemetry.go.tmpl
file since we want to add more things there as well.
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.
We can do the new file maybe later, but let's add at least for Tracer equivalent.
Signed-off-by: Alex Boten <aboten@lightstep.com>
Signed-off-by: Alex Boten <aboten@lightstep.com>
Follows #29927, uses the new method Signed-off-by: Alex Boten <aboten@lightstep.com>
…-telemetry#29927) This PR adds methods to `generated_status` that returns a Meter/Tracer w/ the scopeName set for each component. I'm not set on where to put this method, added it to generated_status but could easily be in a generated_telemetry.go file as well. Follows open-telemetry#29926 Fixes open-telemetry#29921 --------- Signed-off-by: Alex Boten <aboten@lightstep.com>
Follows open-telemetry#29927, uses the new method Signed-off-by: Alex Boten <aboten@lightstep.com>
This PR adds methods to
generated_status
that returns a Meter/Tracer w/ the scopeName set for each component. I'm not set on where to put this method, added it to generated_status but could easily be in a generated_telemetry.go file as well.Follows #29926
Fixes #29921