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

WIP: Discuss approval for three metrics RFCs 0003, 0008, and 0009. #51

Closed
wants to merge 5 commits into from

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Sep 16, 2019

Numbers 0003, 0008, and 0009 are all related. This PR serves to discuss these RFCs and/or approve them.

@paivagustavo
Copy link
Member

paivagustavo commented Sep 17, 2019

Hello @jmacd, this is my first attempt to help the OpenTelemetry Community, so take all this with a little grain of salt.

I'm bringing here the discussions from the open-telemetry/opentelemetry-go/pull/100 pull request.

Initially, I was confused about the need of both Bidirectional and Unidirectional options and their naming. I had suggested to change it for something like Monotonic as this may suit better our context and is already used in the metrics universe (e.g., prometheus uses it). Since it can be a boolean there is no need to have both options. A metric is or is not Monotonic.

Now that I have read this RFC, I started to think that these could be a little simpler.

Why do we need to specify that a Cumulative Metric can or cannot be Monotonic? Shouldn't we assume that all Cumulative Metricsare already Monotonic? If a metric can both go up and down shouldn't it be a Gauge? Moreover, Isn't a Unidirectional Gauge a Monotonically Increasing Cumulative Metric?

If we agree on those, we may revisit on which method each metric kind should have. Maybe Gauges could have a Add() and Sub() method as well.

I haven't read all the accepted RFCs neither have been present on the meetings (which I'll start to attend), so if this has been already discussed or if I am missing some point, just tell me and I'll try to catch up with the project.

Thanks.

@Oberon00
Copy link
Member

Definitely in favor of "Monotonic" over Uni/Bidirectional. The former is a high school-level well-defined math term that describes exactly what is meant, while the latter seems to be our own invention in this context.

@jmacd
Copy link
Contributor Author

jmacd commented Sep 17, 2019

@Oberon00 Yes, it was definitely a slip not to use Monotonic from the start. I've updated Unidirectional->Monotonic.

However, monotonic behavior is default for Counters while it is an option for Gauges, so Monotonic names the optional Gauge behavior and we need an opposite to name the Counter behavior. Non-Monotonic is potentially an answer, but I took an informal poll of some folks around the office here and "BiDirectional" was still preferred. I'm open to suggestions.

@jmacd
Copy link
Contributor Author

jmacd commented Sep 17, 2019

I'm starting to prefer NonMonotonic as an option for counters.

@jmacd
Copy link
Contributor Author

jmacd commented Sep 18, 2019

I've updated the optional behavior names.
Counter default is Monotonic, option is NonMonotonic.
Gauge default is NonMonotonic, option is Monotonic.
Measure default is NonNegative, option is Signed.
Let's discuss.

@jmacd
Copy link
Contributor Author

jmacd commented Oct 1, 2019

There are two changes in open-telemetry/opentelemetry-specification#250 relative to this PR:
(1) Disabled option has been removed
(2) "Required" label keys have been reworded as "Recommended" label keys. No mention of aggregation appears in the API spec at this point.

@@ -124,9 +124,17 @@ The optional properties of a metric instrument are:
|----------|-------------|-------------|
| Required Keys | Determines labels that are always set on metric handles | All kinds |
| Disabled | Indicates a verbose metric that does not report by default | All kinds |
Copy link
Member

Choose a reason for hiding this comment

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

I think this is removed?

| NonNegative | Indicates a measure that is never negative, for rate calculation | Measure |
| NonMonotonic | Indicates a cumulative metric instrument that goes up and down | Cumulative |
| Monotonic | Indicate a gauge that expresses a monotonic cumulative value | Gauge |
| Signed | Indicates a measure that is positive or negative | Measure |
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove the signed as we discussed in one of the meeting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a meaningful distinction to keep IMO.
Examples were provided in the referenced thread, e.g., for recording spanAsssasin scores. For recording the change in a bank account, there are just so many examples.

Why should the implementation care? What value is there to the implementation in not having to support negative values? I can think of one. For computing summary metrics, i.e., quantile estimates, we need an approximation algorithm. It is significantly easier to approximate a "one-sided" distribution that has one boundary. It's significantly easier to approximate a "two-sided" distribution that has no boundaries. If you're told the measure is non-negative you might choose to use a DDSketch. If you're told the measure is signed, you might choose to use a T-digest .

I don't see this as being expensive to keep in, but I see it as a lack of symmetry if we exclude it. We shouldn't be so confident that negative measures are not useful.

@jmacd jmacd closed this Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants