open-telemetry / opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java
https://opentelemetry.io
Apache License 2.0
1.96k stars 859 forks source link

[JavaAgent] Autoconfigure customizer for metric exporter in pull-based model, E.g., Prometheus, for all (custom and autogenerated) metrics. #7705

Open lokeshmavale opened 1 year ago

lokeshmavale commented 1 year ago

Discussed in https://github.com/open-telemetry/opentelemetry-java/discussions/5163

Originally posted by **lokeshmavale** February 1, 2023 Hi Team, I have requirement to send metrics in OTLP & Prometheus format. While sending metric I want to enrich the attributes for all the metrics (custom and autogenerated). With Auto Configure SPI, I was able to override metrics using `autoConfiguration.addMetricExporterCustomizer(this::configureSdkMetricExporterProvider);` I have observed that, this exporter only has access to OTLP (push based) exporter. How can I override Prometheus exporter without creating all new Prometheus server and registering it with auto agent using `autoConfiguration.addMeterProviderCustomizer().` ? Do we support pull based model exporter override via auto configuration? Thanks, Lokesh
jkwatson commented 1 year ago

If this is specifically about how to customize a prometheus exporter with the agent, I think we should move this question/issue over to the instrumentation repository. Does that make sense to you?

trask commented 1 year ago

Discussed in https://github.com/open-telemetry/opentelemetry-java/discussions/5163

@jkwatson ^^

jkwatson commented 1 year ago

Discussed in #5163

@jkwatson ^^

does that mean we should close this issue then?

lokeshmavale commented 1 year ago

Thanks @trask & @jkwatson, Sure. I can close this issue here. Please let me know if I can raise this issue under open-telemetry/opentelemetry-java-instrumentation ?

trask commented 1 year ago

Discussed in #5163

@jkwatson ^^

does that mean we should close this issue then?

oh my bad, I thought that issue was already in java-instrumentation repo.

I will transfer this one, thx