All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opentelemetry.exporter.internal.otlp.metrics.MetricsMarshalerUtil Maven / Gradle / Ivy

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