-
Notifications
You must be signed in to change notification settings - Fork 127
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
[jmx-metrics] Metrics Gatherer reports old data if target becomes unavailable #910
Comments
@jack-berg as discussed in the SIG, here's an issue. In regards to your specific questions about how the instruments are created, they appear to be made synchronously (if builder.build() is synchronous && builder.buildWithCallback is asynchronous). Primary interaction with instruments is in GroovyMetricEnvironment starting at line 142, and in InstrumentHelper starting on line 71. |
Ok so not an expert on this code by any means, but I took a look and here's what I got:
|
@jack-berg if you have any capacity to give some review of the proposed fix for this issue I'd appreciate the expertise on the SDK instrumentation changes. |
Component(s)
jmx-metrics
What happened?
Description
When monitoring a JMX target with the JMX metrics gatherer, if that target becomes unresponsive or unavailable the most recently collected metrics continue to report via the configured exporter as if they are new metrics.
Steps to Reproduce
Start a simple java executable like the following
Configure the JMX Metric gatherer to monitor said target.
After seeing metrics collected at the prometheus endpoint, then stop the Sleepy java process. Observe that the metrics are still reported (with fresh timestamps) at the prometheus endpoint.
While the prometheus endpoint would make some sense to continue to show old data points (with correct timestamps), the real use case where this issue was encountered was utilizing the jmx receiver in opentelemetry-collector-contrib, where we would not expect old, duplicate metrics to be exported via OTLP and sent to the receiver. To observe that behavior, the jmx receiver would be configured like the following (note - the receiver can only be used with a released version of the JMX Metrics gatherer, or the collector must be built with special build flags to allow use of a non-released version):
Expected Result
Metrics would at minimum not be reported with new timestamps, but preferably metrics would not be reported at all for times where the monitoring target was unavailable
Actual Result
The most recently collected value continues to be reported for any instruments, with a fresh timestamp attached.
Component version
First observed w/ 1.14.0, but has been seen w/ latest
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: