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

Add temporality to MetricDescriptor #140

Merged
merged 13 commits into from
Apr 28, 2020

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Apr 24, 2020

Updates the MetricDescriptor to specify the temporal quality of the data being transported. Consequentially, type is now decoupled from this introduced concept.

This is a partial replacement of #137
Relates to #125

opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
opentelemetry/proto/metrics/v1/metrics.proto Outdated Show resolved Hide resolved
MrAlias and others added 6 commits April 24, 2020 13:40
Update comments.
Run make.
Remove errant space.
Add info about INSTANTANEOUS not having start timestamp.
Use an enum name suffix instead of prefix for the default values.
@MrAlias MrAlias changed the title Add temporality and refinements to MetricDescriptor Add temporality to MetricDescriptor Apr 24, 2020
@bogdandrutu
Copy link
Member

Would be good later to add a table with combination of temporality and types and explain what it is possible what it is not and maybe map to some examples.

// 8. The 1 second collection cycle ends. A metric is exported for the
// number of requests received over the interval of time t_0+1 to
// t_0+2 with a value of 2.
DELTA = 2;
Copy link
Member

Choose a reason for hiding this comment

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

how is the interval represented when reporting delta? Is it by using start_time_unix_nano and time_unix_nano fields in Int64DataPoint etc, ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the plan. Planning to address this issue in a following PR (MrAlias@5cfae02).

The ask has been to split up #137 into smaller changes. The assumption that there would be breaking changes or inconsistencies between PRs was something planned and accepted.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Thanks for explaining delta vs cumulative with actual examples!

Can you correct the following as well:

  1. The part of this proto file which describes Int64DataPoint, DoubleDataPoint, SummaryDataPoint etc. is not updated to reflect the changes in this PR. They still refer to gauge/counter types which are replaced in this PR.

  2. A sample message example for each of the Temporatily - showing the values for start_time_unix_nano and time_unix_nano, so that there would be confusion.

@bogdandrutu
Copy link
Member

@cijothomas

The part of this proto file which describes Int64DataPoint, DoubleDataPoint, SummaryDataPoint etc. is not updated to reflect the changes in this PR. They still refer to gauge/counter types which are replaced in this PR.

We agree to do that in a separate PR.

@bogdandrutu
Copy link
Member

@cijothomas are you happy with the responses? Please remove the request changes if so :)

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Thanks!

@cijothomas
Copy link
Member

@cijothomas are you happy with the responses? Please remove the request changes if so :)

Yes! Just did it.

@jmacd
Copy link
Contributor

jmacd commented Apr 27, 2020

(I will agree that splitting this work into smaller PRs has helped. Nice work!)

@bogdandrutu
Copy link
Member

@MrAlias my fault, I thought that will not cause conflicts :(. Can you please rebase?

@bogdandrutu bogdandrutu merged commit 89eff5e into open-telemetry:master Apr 28, 2020
@MrAlias MrAlias deleted the add-refinements branch April 28, 2020 22:32
Comment on lines +230 to +232
// The set of labels associated with the metric descriptor. Labels in this list apply to
// all data points.
repeated opentelemetry.proto.common.v1.StringKeyValue labels = 6;
Copy link
Member

Choose a reason for hiding this comment

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

This was removed in #144. Please revert this change.

@davidwitten
Copy link
Member

@MrAlias I'm using this proto to create an OTLP metric exporter in JS. However, I'm confused about how metric kinds map to temporality. I was looking at the specs, and it didn't mention temporality. Is this correct?

Counter, SumObserver: Cumulative
UpDownCounter,UpDownSumCounter: Delta
ValueRecorder, ValueObserver: Instantaneous

@jmacd
Copy link
Contributor

jmacd commented Jul 1, 2020

It's not so straightforward, unfortunately. The temporality depends on the aggregation.

For ValueRecorder, ValueObserver: A LastValue or Exact aggregation will have Instaneaneous temporality, whereas a MinMaxLastSumCount, Summary, or Histogram aggregation will have Delta.

For the other instruments, you have it right:
Counter, SumObserver: Cumulative
UpDownCounter,UpDownSumCounter: Delta

Please keep an eye on #162

Also see how in open-telemetry/opentelemetry-go#840 an SDK is configured to support converting between cumulative and delta exporters, but when working with OTLP the client should not have to do this. That's why SumObserver is cumulative and Counter is delta in OTLP, it requires no memory in the client--OTLP therefore is considered a PassThrough kind of exporter.

@davidwitten
Copy link
Member

@jmacd Thanks so much! This was such a big help! I just subscribed to that PR.

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.

6 participants