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

Fixes monotonicity issues we have implementing the specification. #2010

Merged
merged 5 commits into from
Oct 15, 2021

Conversation

jsuereth
Copy link
Contributor

Fixes #2009

Changes

  • Prevent negative measurements in Histogram Instruments so we
    can include monotonic sum in the data and export to prometheus.
  • Remove explicit monotonicity argument to aggregators and always infer
    from instrument type.
    • Expand list of supported instruments for Sum aggregation with details
      on default aggregation.
    • Add note on handling sum in histogram for instruments that allow
      negative measurements.

Related issues:

- Prevent negative measurements in Histogram Instruments so we
  can include monotonic sum in the data and export to prometheus.
- Remove explicit monotonicity argument to aggregators and always infer
  from instrument type.
  - Expand list of supported instruments for Sum aggregation with details
    on default aggregation.
  - Add note on handling `sum` in histogram for instruments that allow
    negative measurements.
@jsuereth jsuereth requested a review from a team as a code owner October 12, 2021 17:24
@jsuereth jsuereth requested a review from a team October 12, 2021 17:24
@jsuereth jsuereth requested a review from a team as a code owner October 12, 2021 17:24
@reyang reyang added area:sdk Related to the SDK spec:metrics Related to the specification/metrics directory labels Oct 12, 2021
@reyang reyang added this to the Metrics API/SDK Feature Freeze milestone Oct 12, 2021
@reyang reyang changed the title Fixes monotonicity issues we have implementing the specificaiton. Fixes monotonicity issues we have implementing the specification. Oct 13, 2021
jsuereth and others added 2 commits October 13, 2021 09:28
Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. If there is demand for a histogram of signed measurements, my preference then would be to add a field to encode the primitive measurement type (which is either Counter, UpDownCounter, or Gauge, in which case the Sum is not necessarily well-defined for Gauge histograms, as I wrote in open-telemetry/oteps#156).

@jmacd jmacd enabled auto-merge (squash) October 15, 2021 17:31
@jmacd jmacd merged commit 166fc3f into open-telemetry:main Oct 15, 2021
Spec - Metrics API/SDK Feature Freeze automation moved this from In progress to Done Oct 15, 2021
@jsuereth jsuereth deleted the wip-montonicity-fixes branch October 18, 2021 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sdk Related to the SDK spec:metrics Related to the specification/metrics directory
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Metrics SDK defaults Histogram instruments to report monotonic sums, but allows negative measurements.
4 participants