io.opentelemetry.exporter.internal.otlp.metrics.MetricsMarshalerUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-exporter-otlp-common Show documentation
Show all versions of opentelemetry-exporter-otlp-common Show documentation
OpenTelemetry Protocol Exporter
The newest version!
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.exporter.internal.otlp.metrics;
import io.opentelemetry.exporter.internal.marshal.ProtoEnumInfo;
import io.opentelemetry.proto.metrics.v1.internal.AggregationTemporality;
final class MetricsMarshalerUtil {
static ProtoEnumInfo mapToTemporality(
io.opentelemetry.sdk.metrics.data.AggregationTemporality temporality) {
switch (temporality) {
case CUMULATIVE:
return AggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE;
case DELTA:
return AggregationTemporality.AGGREGATION_TEMPORALITY_DELTA;
}
// NB: Should not be possible with aligned versions.
return AggregationTemporality.AGGREGATION_TEMPORALITY_UNSPECIFIED;
}
private MetricsMarshalerUtil() {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy