-
Notifications
You must be signed in to change notification settings - Fork 1k
jmx-metrics: allow any resource path for classpath resources rules #15413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
...jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/JmxTelemetryTest.java
Outdated
Show resolved
Hide resolved
...-metrics/library/src/main/java/io/opentelemetry/instrumentation/jmx/JmxTelemetryBuilder.java
Outdated
Show resolved
Hide resolved
…nstrumentation into jmx-api-path
...-metrics/library/src/main/java/io/opentelemetry/instrumentation/jmx/JmxTelemetryBuilder.java
Outdated
Show resolved
Hide resolved
| * @return builder instance | ||
| * @throws IllegalArgumentException when classpath resource does not exist or can't be parsed | ||
| */ | ||
| // TODO: deprecate this method after 2.23.0 release in favor of addRules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you deprecate it immediately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we deprecate it right now, it means the next update of instrumentation dependency in contrib will require to immediately modify the code of jmx-scraper in contrib to switch to the new API. Even if the changes are minor it's an added constraint on the dependency update.
Doing that after 2.23.0 gives a bit more time with a timeline like this:
- instrumentation 2.23.0 is released with this new API
- contrib gets updated to use 2.23.0 dependency
- we update
jmx-scraperto use the new API introduced by this PR - we deprecate methods in this API, this will likely be for the 2.24.0 release
…nstrumentation into jmx-api-path
…nstrumentation into jmx-api-path
.../src/main/java/io/opentelemetry/instrumentation/javaagent/jmx/JmxMetricInsightInstaller.java
Outdated
Show resolved
Hide resolved
…nstrumentation into jmx-api-path
There was an oversight in #15220, which I unfortunately only discovered when plumbing this new API in jmx-scraper with open-telemetry/opentelemetry-java-contrib#2446.
This PR adds a more versatile
JmxTelemetryBuilder#addRulesas replacement, this allows to load JMX metrics rules from anyInputStream, not only the classpath resources injmx/rules.The following methods are not yet annotated with
@Deprecatedto prevent having to deal with changes when the dependency of contrib to instrumentation is updated, they should be replaced withJmxTelemetryBuilder#addRulesin the future:JmxTelemetryBuilder#addClassPathRulesJmxTelemetryBuilder#addCustomRulesThis limitation currently makes loading "legacy" metrics definitions in jmx-scraper more complicated than necessary (see open-telemetry/opentelemetry-java-contrib#2446 for details).