You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jmx-metrics/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# JMX Metric Gatherer
2
2
3
+
**Deprecation notice**: the JMX Metric Gatherer is deprecated and replaced by [JMX Scraper](../jmx-scraper/), see [migration instructions](../jmx-scraper/README.md#migration-from-jmx-gatherer).
4
+
3
5
This utility provides an easy framework for gathering and reporting metrics based on queried
4
6
MBeans from a JMX server. It loads included and/or custom Groovy scripts and establishes a helpful,
5
7
bound `otel` object with methods for obtaining MBeans and constructing OpenTelemetry instruments:
The JMX Scraper aims to replace the [JMX Gatherer](../jmx-metrics) tool and thus share most features
141
+
and configuration with it.
142
+
143
+
Features not supported:
144
+
145
+
- Define and capture metrics with custom Groovy definitions with `otel.jmx.groovy.script`, this is now replaced with YAML and `otel.jmx.config` configuration option.
146
+
- Ability to export to prometheus collector, only the OTLP exporter is included.
147
+
148
+
The YAML-based implementation is provided by [java instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/jmx-metrics)
149
+
and thus should be used for syntax details and documentation.
150
+
151
+
Like with the JMX Gatherer, the selection of provided metrics to use is still done with `otel.jmx.target.system` configuration option.
152
+
153
+
However, there is now two distinct sets of metrics to select from using the `otel.jmx.target.source` configuration option:
154
+
155
+
-`legacy`: [metrics definitions](./src/main/resources) equivalent to JMX Gatherer definitions to help transition and preserve compatibility
156
+
-`instrumentation`: [metrics definitions inherited from instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/jmx-metrics/library/src/main/resources/jmx/rules/), which is now used as a reference for JMX metrics, those also aim to provide better alignment with [metrics semantic conventions](https://opentelemetry.io/docs/specs/semconv/general/metrics/).
157
+
158
+
In both cases, the metrics definitions themselves are embedded in the JMX Scraper binary, thus they
159
+
will only change if the release version of the JMX Scraper binary changes.
160
+
161
+
By default, `otel.jmx.target.source` is `auto`, which means for each value of `otel.jmx.target.system`:
162
+
163
+
- Metrics definitions from instrumentation will be used by default, if available.
164
+
- Legacy metrics definitions equivalent to JMX Gatherer will be used as fallback.
165
+
- Whenever new metrics definitions are being added or modified in instrumentation, those newer definitions will be used.
166
+
167
+
There are multiple possible strategies depending on the ability or willingness to embrace change in metrics definitions:
168
+
169
+
- To preserve maximum compatibility, using `legacy` is the recommended option, however it means to not benefit from future updates and contributions.
170
+
- To only get the most recent definitions, using `instrumentation` ensures that none of the legacy definitions is used, only the reference from instrumentation closer to semconv recommendations, those could still evolve over time.
171
+
- To embrace reference definitions whenever they become available, using `auto` is the recommended option, however it means the metrics produced could change when updating the version of JMX Scraper.
172
+
- To handle more complex migration strategies or for tight control of metrics definitions, using copies of the YAML metrics definitions and providing them explicitly with `otel.jmx.config` is the recommended option.
173
+
174
+
When using `otel.target.source` = `auto` or `legacy`, one or more legacy definitions might be used. If strict compatibility with metrics produced by JMX Gatherer is required it is recommended to review
175
+
the [legacy metrics definitions YAML files](./src/main/resources/) as they contain comments on the minor differences with JMX Gatherer Groovy definitions.
0 commit comments