-
Notifications
You must be signed in to change notification settings - Fork 858
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
Do not export counters with no points for OTLP. #1978
Do not export counters with no points for OTLP. #1978
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1978 +/- ##
=========================================
Coverage ? 84.16%
Complexity ? 1803
=========================================
Files ? 215
Lines ? 7325
Branches ? 791
=========================================
Hits ? 6165
Misses ? 858
Partials ? 302
Continue to review full report at Codecov.
|
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.
LGTM - this seems like a reasonable interpretation of the proto to me
My only worry is there might be a reason to send an empty payload, just as a heartbeat. Other than that, this looks fine to me. |
@bogdandrutu Any take on this? 😉 |
Marking this as Ready to Review, in order to get more eyes ;) |
I agree with this as a short-term fix that will make the Java OTLP Metrics export not send what to me is a meaningless point. It's uncovered that we should probably specify in the protocol that a Metric with empty point list may be regarded as equivalent to an absent Metric. If the specification says we can silently drop these Metrics with no data points, then we can assert that this is a correct change. I would like to bring the Java Metric SDK into more conceptual alignment with the OTel-Go SDK. There we have a
Both of these behaviors combine are needed for a Prometheus export pipeline. Only the first of these behaviors is needed for an OTLP/CUMULATIVE export pipeline. None of these behaviors is needed for an OTLP/DELTA export pipeline. Since I'm not familiar with the internals, I don't know how much restructuring is needed to accomplish this goal, but when it is accomplished, there will be a basic Processor component with two optional behaviors. I approve this PR with a TODO mentioning the final state and the need for more SDK specification. Whether using a CUMULATIVE or DELTA strategy with OTLP, there is no reason to use empty data points. We should either not report a Metric ("no observation(s)") or we should report a Metric with more than zero points ("some observations"). There are independent questions raised here that should not block the resolution of the immediate issue. For example: if a Processor is configured for CUMULATIVE export and not MEMORY behavior, shall we omit those points because of a lack of observations? If the instrument is a SumObserver and the point that was previously observed is later not observed and then subsequently observed again, without changing the start timestamp: what should we make of this? I don't think it's too important what we say about this situation, but in any case we should not be sending Metric values with empty points, right? @open-telemetry/specs-metrics-approvers ^^^ some questions for the Metrics specification. @jkwatson Re: "to send an empty payload, just as a heartbeat". I would advocate for using the memory behavior described here if you need this kind of information. See also open-telemetry/opentelemetry-specification#1102. |
@bogdandrutu I'd like your opinion specifically. See also #1976 (comment) |
@bogdandrutu @jkwatson @jmacd I think we should merge this change, to keep things 'conservative'. Then we can iterate and make this selectable (in order to support Prometheus, for example). Let me know what you think. |
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.
As @jmacd pointed this is a good short term fix.
Potential fix for #1976
It shows that nothing seems to break with this simple change.