Skip to content

Is there such a plan to custom config ability for Metrics. #6151

Answered by laurit
xuminwlt asked this question in Q&A
Discussion options

You must be logged in to vote

I have not tried it myself but I believe it should be possible to use an extension to modify which attributes are collected. I'd start with https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/examples/extension/src/main/java/com/example/javaagent/DemoAutoConfigurationCustomizerProvider.java and call AutoConfigurationCustomizer.addMeterProviderCustomizer. From there you should get access to https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/SdkMeterProviderBuilder.java which would allow you to register a view that modifies the attributes.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xuminwlt
Comment options

Answer selected by xuminwlt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants