Skip to content

[Metrics SDK] Metric aggregation temporality controls #1541

Merged
lalitb merged 9 commits intoopen-telemetry:mainfrom
lalitb:agg-temporality-fix
Aug 8, 2022
Merged

[Metrics SDK] Metric aggregation temporality controls #1541
lalitb merged 9 commits intoopen-telemetry:mainfrom
lalitb:agg-temporality-fix

Conversation

@lalitb
Copy link
Copy Markdown
Member

@lalitb lalitb commented Aug 4, 2022

Fixes #1339

Changes

As preferred aggregation temporality concept is removed from specs, and is made as function of instrument-kind (see section here - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#metricreader) , following changes are done -

  • Modify GetAggregationTemporality() method in MetricReader. The methods now take in instrument type/kind, that lets exporter find which temporality to use based on the instrument.
  • Add GetAggregationTemporality() method in MetricExporter. This method takes the instrument type/kind, and returns the correct temporality to use based on the exporter used -
    • OTLP exporter can be configured with a preferred temporality
    • Prometheus only uses cumulative (as it doesn't support delta).

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team August 4, 2022 02:11
@lalitb lalitb changed the title metric aggregation temporality controls Metric aggregation temporality controls Aug 4, 2022
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 4, 2022

Codecov Report

Merging #1541 (b06345c) into main (124b198) will decrease coverage by 0.04%.
The diff coverage is 57.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1541      +/-   ##
==========================================
- Coverage   83.96%   83.93%   -0.03%     
==========================================
  Files         156      156              
  Lines        4905     4908       +3     
==========================================
+ Hits         4118     4119       +1     
- Misses        787      789       +2     
Impacted Files Coverage Δ
...dk/include/opentelemetry/sdk/metrics/instruments.h 0.00% <ø> (ø)
...nclude/opentelemetry/sdk/metrics/metric_exporter.h 100.00% <ø> (ø)
.../include/opentelemetry/sdk/metrics/metric_reader.h 50.00% <ø> (ø)
sdk/src/metrics/state/metric_collector.cc 50.00% <0.00%> (ø)
...metrics/export/periodic_exporting_metric_reader.cc 73.92% <50.00%> (-3.35%) ⬇️
exporters/ostream/src/metric_exporter.cc 92.13% <66.67%> (-1.31%) ⬇️
sdk/src/metrics/metric_reader.cc 59.38% <100.00%> (-4.51%) ⬇️
sdk/src/metrics/state/temporal_metric_storage.cc 93.23% <100.00%> (ø)
ext/src/http/client/curl/http_client_curl.cc 81.44% <0.00%> (+0.38%) ⬆️
sdk/src/trace/batch_span_processor.cc 91.41% <0.00%> (+0.79%) ⬆️

@lalitb lalitb changed the title Metric aggregation temporality controls [Metrics SDK] Metric aggregation temporality controls Aug 4, 2022
Comment thread exporters/otlp/src/otlp_metric_utils.cc Outdated
@ThomsonTan
Copy link
Copy Markdown
Contributor

@lalitb can you please resolve the merging conflict?

@lalitb
Copy link
Copy Markdown
Member Author

lalitb commented Aug 5, 2022

@lalitb can you please resolve the merging conflict?

Fixed. Thanks.

@lalitb lalitb merged commit 8b61c99 into open-telemetry:main Aug 8, 2022
yxue pushed a commit to yxue/opentelemetry-cpp that referenced this pull request Dec 5, 2022
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.

[Metrics SDK] AggregationTemporality Controls

2 participants