opentelemetry-java-instrumentation
opentelemetry-java-instrumentation copied to clipboard
Enable using JMX Metrics instrumation as a library, not only through javaagent
Is your feature request related to a problem? Please describe.
I'd like to use the Otel <-> JMX integration as a library, without the need to install a Java Agent, as described currently on: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/jmx-metrics/javaagent/README.md
I don't think the javaagent
code is published, I've been only able to find the library
on Maven Central:
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-jmx-metrics</artifactId>
<version>2.8.0-alpha</version>
<scope>runtime</scope>
</dependency>
Describe the solution you'd like
My goal is to include all observability-related setup as code, in the main
method of the application. I've got OTEL working without problems using AutoConfiguredOpenTelemetrySdk.initialize().getOpenTelemetrySdk()
, but to get the JMX integration I think I'll have to copy the initialisation code from JmxMetricInsightInstaller.java
for now.
Ideally. I'd be able to do sth like JmxMetrics.initialise(openTelemetry)
, given an instance of OpenTelemetry
.
Describe alternatives you've considered
No response
Additional context
No response