-
When I enable metrics, all metrics will be started and output. The information of http metrics is calculated and aggregated from the span, and the amount of data is very large. We want to be able to control the enablement of http metrics separately, or the filter of TemporaryMetricsView attributeKey automatically Define the ability to better manage the volume of data. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 |
Beta Was this translation helpful? Give feedback.
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.