Turn off metric programmatically with environment variable
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.
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
➕ 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.
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.