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

OTLP metric exporter accepts aggregation temporality function #4340

Merged
merged 2 commits into from
Apr 8, 2022

Conversation

jack-berg
Copy link
Member

I've been uncomfortable with the fact that setPreferredTemporality(AggregationTemporality) only allows two options (DELTA and CUMULATIVE) when others are possible. What would we do if OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE were to add a third option? Also, that selecting DELTA specifies a preference for delta that applies in most but not all cases.

This adjusts OtlpHttpMetricExporter and OtlpGrpcMetricExporter to accept a Function<InstrumentType, AggregationTemporality> instead of AggregationTemporality.

This offers more flexibility and would be needed in the future when we want to support alternative aggregation temporality configs besides the "cumulative" and "delta preferred". To assist with setting Function<InstrumentType, AggregationTemporality>, I've added two helper functions to MetricExporter which represent common aggregation temporality configurations.

@jack-berg jack-berg requested a review from a user April 5, 2022 21:32
@jack-berg jack-berg requested a review from Oberon00 as a code owner April 5, 2022 21:32
@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #4340 (698c37c) into main (d3a8b32) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #4340      +/-   ##
============================================
+ Coverage     89.88%   89.91%   +0.02%     
- Complexity     4866     4867       +1     
============================================
  Files           568      568              
  Lines         15093    15092       -1     
  Branches       1441     1440       -1     
============================================
+ Hits          13567    13570       +3     
+ Misses         1056     1054       -2     
+ Partials        470      468       -2     
Impacted Files Coverage Δ
...lemetry/exporter/internal/ExporterBuilderUtil.java 100.00% <ø> (ø)
...lp/http/metrics/OtlpHttpMetricExporterBuilder.java 100.00% <100.00%> (+6.25%) ⬆️
...er/otlp/metrics/OtlpGrpcMetricExporterBuilder.java 94.28% <100.00%> (+4.81%) ⬆️
...sdk/autoconfigure/MetricExporterConfiguration.java 85.93% <100.00%> (+0.45%) ⬆️
...pentelemetry/sdk/autoconfigure/OtlpConfigUtil.java 90.26% <100.00%> (+0.26%) ⬆️
...entelemetry/sdk/metrics/export/MetricExporter.java 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3a8b32...698c37c. Read the comment docs.

@jack-berg jack-berg merged commit e7d5a97 into open-telemetry:main Apr 8, 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.

3 participants