open-telemetry / open-telemetry/opentelemetry-java-instrumentation

jmx metrics provide registry + weaver validation

Open
#19,227 0 comments 0 reactions 1 assignee View on GitHub

@SylvainJuge is already working on this.

Since Jul 15, 2026.

Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 18h
Merged PRs (30d)
228

Description

As described in the discussion of https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/16016

  • instrumentation should only produce stable metrics by default, users should be able to opt-in for other metrics.
  • JMX metrics are not formally defined nor have stability definition
  • some of the target systems do have experimental- prefix to indicate their definitions are not stable
    • this creates breaking changes for users when metrics are promoted
    • this prevent promoting metrics one by one, it's all or nothing
  • users have to know the relevant values to use for otel.jmx.target.system in order to get the metrics, whereas the presence of MBeans should be enough to know if a given system needs to be monitored.

In order to solve this, we need to have the following:

  • a formal definition of JMX metrics that is consistent with upstream semantic conventions, it should be compatible with the "federated semconv" to be reusable/imported by end users
  • having the ability to select JMX metrics on their stability level, rather than having to enumerate the "target system", in other words: "capture what is available in the JMX tree for a given maturity level".
    • doing this automatic discovery is not strictly required here but allows to remove the need to define and maintain the values for otel.jmx.target.system.

Once this is complete we should have:

  • otel.jmx.target.system configuration option is optional or deprecated
  • added the ability to select JMX metrics on their stability level, the default should be stable.
  • a folder in this repository that contains reusable definitions of existing JMX metrics and can be used with a "federated semconv" strategy
  • the ability to start formally promoting some of those JMX metrics as stable.

Relates to

Implementation steps

Follow-up step(s)

Optional but related step(s)

  • optional: automate generation of JMX metrics documentation from registry
  • optional: reduce duplication between JMX metrics tests and weaver validation (instrument type, unit, metric description), some aspects are not covered by weaver like:
    • assert on numeric value
    • assert on attribute value, even if it's defined as an enum (all enums are considered "open" and there isn't a "closed enum" concept anymore)
    • assert on metric description
  • optional: reduce duplication in metrics definition yaml, either through weaver generation (with annotations), or by providing a way to link to JMX metrics registry definitions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.