Replies: 1 comment 1 reply
-
I figured out to use agent extension to customize the metrics exporter with following code in the agent extension: public class CustomizeProvider implements AutoConfigurationCustomizerProvider {
@Override
public void customize(AutoConfigurationCustomizer autoConfigurationCustomizer) {
autoConfigurationCustomizer.addMeterProviderCustomizer(this::buildMeterProvider);
}
SdkMeterProviderBuilder buildMeterProvider(SdkMeterProviderBuilder meterProviderBuilder, ConfigProperties config) {
log("Register OpenCensusMetricProducer shim:");
meterProviderBuilder.registerMetricProducer(OpenCensusMetricProducer.create());
return meterProviderBuilder;
}
} However, I noticed seems in agent, the class is loaded by a different classloader. The How can I bypass this issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Based on this doc: https://github.com/open-telemetry/opentelemetry-java/tree/main/opencensus-shim. We can export OC metrics by register the MetricsReader as shown in the example:
However as we are using
PrometheusHttpServer
exporter. APrometheusHttpsService
instance is automatically created with service provider: https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/prometheus/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvideronce I introduced the dependency to this module. In that case, I can't get a reference of this
PrometheusHttpsService
. And I also can't create a new one, as it will have port conflict. How can I get the existingPrometheusHttpsService
instance registered?Beta Was this translation helpful? Give feedback.
All reactions