Skip to content
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

Cannot distinguish Histogram's Sum field between 0 vs not assigned. #314

Closed
victlu opened this issue Jun 17, 2021 · 4 comments · Fixed by #366
Closed

Cannot distinguish Histogram's Sum field between 0 vs not assigned. #314

victlu opened this issue Jun 17, 2021 · 4 comments · Fixed by #366

Comments

@victlu
Copy link
Contributor

victlu commented Jun 17, 2021

proto3 does not support a has_*() method. Thus, code cannot detect the difference between a field that is not assigned vs a field that has a default value (i.e. 0).

Current spec for Histogram's Sum field has a note to not assign the field in some condition. This condition not detectable by code (i.e. Sum is assigned to zero).

  // Note: Sum should only be filled out when measuring non-negative discrete
  // events, and is assumed to be monotonic over the values of these events.
  // Negative events *can* be recorded, but sum should not be filled out when
  // doing so.  This is specifically to enforce compatibility w/ OpenMetrics,
  // see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram
@victlu
Copy link
Contributor Author

victlu commented Jun 17, 2021

FYI: @jsuereth @bogdandrutu @jmacd

@victlu
Copy link
Contributor Author

victlu commented Jun 17, 2021

It seems we need to deprecate the use of this field, and move to a newer Sum field where we can redefine the context. This may include...

@Blacksmoke16
Copy link

@bogdandrutu
Copy link
Member

jsuereth added a commit to jsuereth/opentelemetry-proto that referenced this issue Oct 4, 2021
codeboten pushed a commit to codeboten/opentelemetry-proto that referenced this issue Mar 4, 2022
bogdandrutu pushed a commit that referenced this issue Mar 13, 2022
* Add field presence flag to proto build.

* Fix #314 - Cannot distinguish between sum being 0 and undefined.

* remove gogo from Makefile

Co-authored-by: Josh Suereth <joshuasuereth@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants