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 support for low memory metric temporality setting #5558

Merged
merged 3 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Comparing source compatibility of against
No changes.
*** MODIFIED INTERFACE: PUBLIC ABSTRACT io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector (not serializable)
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector lowMemory()
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,20 @@ public static void configureOtlpAggregationTemporality(
if (temporalityStr == null) {
return;
}
AggregationTemporality temporality;
try {
temporality = AggregationTemporality.valueOf(temporalityStr.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new ConfigurationException(
"Unrecognized aggregation temporality: " + temporalityStr, e);
AggregationTemporalitySelector temporalitySelector;
switch (temporalityStr.toLowerCase(Locale.ROOT)) {
case "cumulative":
temporalitySelector = AggregationTemporalitySelector.alwaysCumulative();
break;
case "delta":
temporalitySelector = AggregationTemporalitySelector.deltaPreferred();
break;
case "lowmemory":
temporalitySelector = AggregationTemporalitySelector.lowMemory();
break;
default:
throw new ConfigurationException("Unrecognized aggregation temporality: " + temporalityStr);
}
AggregationTemporalitySelector temporalitySelector =
temporality == AggregationTemporality.CUMULATIVE
? AggregationTemporalitySelector.alwaysCumulative()
: AggregationTemporalitySelector.deltaPreferred();
aggregationTemporalitySelectorConsumer.accept(temporalitySelector);
}

Expand Down
Loading