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

Turn off metric programmatically with environment variable #7046

Open
pallavibhingarkar opened this issue Jan 27, 2025 · 3 comments
Open

Turn off metric programmatically with environment variable #7046

pallavibhingarkar opened this issue Jan 27, 2025 · 3 comments
Labels
blocked:spec blocked on open or unresolved spec

Comments

@pallavibhingarkar
Copy link

We have requirement to turn off certain metric based on some environment variable which may include metric name to be turned off.

We are looking for best way to do that.

Currently we are using http for metric instrumentation.

@trask
Copy link
Member

trask commented Jan 27, 2025

hi @pallavibhingarkar! have you looked at using metric views with declarative configuration? e.g. https://github.com/open-telemetry/opentelemetry-java-examples/tree/main/declarative-configuration

@jack-berg
Copy link
Member

jack-berg commented Jan 27, 2025

➕ to @trask's advice. Views are the idiomatic way to turn off specific metrics. And we don't plan on adding additional environment variables, especially for concepts like views which cannot be easily / intuitively flattened to an environment variable based scheme.

Declarative config is the answer, and a stable specification is in sight. A stable java implementation would follow sometime after.

@jack-berg jack-berg added the blocked:spec blocked on open or unresolved spec label Jan 27, 2025
@jack-berg
Copy link
Member

Labeled as "blocked:spec", but should probably close because this gives the impression that its just a matter of spec work to get this done. The changes that standard environment variables are added for this are exceedingly low so should probably close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:spec blocked on open or unresolved spec
Projects
None yet
Development

No branches or pull requests

3 participants