opentelemetry-java-contrib icon indicating copy to clipboard operation
opentelemetry-java-contrib copied to clipboard

[jmx-scraper] Create weaver model for jmx-scraper metrics

Open atoulme opened this issue 6 months ago • 2 comments

Please help create a Weaver model for the different target systems of the metrics defined by jmx-scraper, so we can work to standardize them. This issue should be decomposed into an issue by target system. A simple litmus test on a simple target model should be enough to demonstrate first how hard this is to do, and we can go from there.

The idea is that eventually we can move some of the weaver models to semconv, as metric references.

atoulme avatar Aug 02 '25 01:08 atoulme

Hi @atoulme, I am new to weaver. Can I ask some clarification questions about this ticket?

First, I understand that this https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/jmx-scraper/src/main/resources/jvm.yaml is just a rule configuration for the jmx-scraper.
Those rule configurations will be left untouched, correct?

Are we saying to create weaver a registry.yaml, say for jvm, or for jetty, and define all the current metrics per target system (jvm, jetty, ...) being used by jmx-scraper? And does the scope include code generation and have all the references, for example, jetty.groovy, JettyIntegrationTest.java, reference to the generated code? and as for "a simple litmus test on a simple target", would running the existing unit and integration test be enough?

For the long term, the goal is to standardize these metrics and move some of these weaver models to https://github.com/open-telemetry/semantic-conventions/blob/main/model

mcmho avatar Aug 14 '25 00:08 mcmho

Here is an example of use that introduces a Weaver model to back the existing yaml files rather than directly replacing them: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/40698

We build this in a backwards-compatible, non-breaking way by making sure we can express everything we could in weaver before we do anything else.

atoulme avatar Aug 14 '25 01:08 atoulme