Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MetricReader and MetricExporter can determine default aggregation by …
…instrument (#4472) * MetricReader and MetricExporter can determine default aggregation by instrument * Add since annotations
- Loading branch information
Showing
25 changed files
with
379 additions
and
252 deletions.
There are no files selected for viewing
20 changes: 19 additions & 1 deletion
20
docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
Comparing source compatibility of against | ||
No changes. | ||
+++ NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector (not serializable) | ||
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a. | ||
+++ NEW SUPERCLASS: java.lang.Object | ||
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector getDefault() | ||
+++ NEW METHOD: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.metrics.Aggregation getDefaultAggregation(io.opentelemetry.sdk.metrics.InstrumentType) | ||
+++ NEW ANNOTATION: java.lang.FunctionalInterface | ||
**** MODIFIED INTERFACE: PUBLIC ABSTRACT io.opentelemetry.sdk.metrics.export.MetricExporter (not serializable) | ||
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0 | ||
+++ NEW INTERFACE: io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector | ||
+++* NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.metrics.Aggregation getDefaultAggregation(io.opentelemetry.sdk.metrics.InstrumentType) | ||
**** MODIFIED INTERFACE: PUBLIC ABSTRACT io.opentelemetry.sdk.metrics.export.MetricReader (not serializable) | ||
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0 | ||
+++ NEW INTERFACE: io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector | ||
+++* NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.metrics.Aggregation getDefaultAggregation(io.opentelemetry.sdk.metrics.InstrumentType) | ||
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.metrics.export.PeriodicMetricReader (not serializable) | ||
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0 | ||
===* UNCHANGED INTERFACE: io.opentelemetry.sdk.metrics.export.MetricReader | ||
+++ NEW INTERFACE: io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector | ||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.metrics.Aggregation getDefaultAggregation(io.opentelemetry.sdk.metrics.InstrumentType) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...metrics/src/main/java/io/opentelemetry/sdk/metrics/export/DefaultAggregationSelector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.metrics.export; | ||
|
||
import io.opentelemetry.sdk.metrics.Aggregation; | ||
import io.opentelemetry.sdk.metrics.InstrumentType; | ||
|
||
/** | ||
* A functional interface that selects default {@link Aggregation} based on {@link InstrumentType}. | ||
* | ||
* @since 1.16.0 | ||
*/ | ||
@FunctionalInterface | ||
public interface DefaultAggregationSelector { | ||
|
||
/** | ||
* The default implementation of {@link DefaultAggregationSelector} which returns the default | ||
* aggregation for each instrument. | ||
*/ | ||
static DefaultAggregationSelector getDefault() { | ||
return instrumentType -> Aggregation.defaultAggregation(); | ||
} | ||
|
||
/** | ||
* Return the default aggregation for the {@link InstrumentType}. | ||
* | ||
* <p>The default aggregation is used when an instrument does not match any views. | ||
*/ | ||
Aggregation getDefaultAggregation(InstrumentType instrumentType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.