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

io.opentelemetry.instrumentation.kafka.internal.InstrumentDescriptor Maven / Gradle / Ivy

There is a newer version: 2.9.0-alpha
Show newest version
/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.instrumentation.kafka.internal;

import com.google.auto.value.AutoValue;

/** A description of an OpenTelemetry metric instrument. */
@AutoValue
abstract class InstrumentDescriptor {

  static final String INSTRUMENT_TYPE_DOUBLE_OBSERVABLE_GAUGE = "DOUBLE_OBSERVABLE_GAUGE";
  static final String INSTRUMENT_TYPE_DOUBLE_OBSERVABLE_COUNTER = "DOUBLE_OBSERVABLE_COUNTER";

  abstract String getName();

  abstract String getDescription();

  abstract String getInstrumentType();

  static InstrumentDescriptor createDoubleGauge(String name, String description) {
    return new AutoValue_InstrumentDescriptor(
        name, description, INSTRUMENT_TYPE_DOUBLE_OBSERVABLE_GAUGE);
  }

  static InstrumentDescriptor createDoubleCounter(String name, String description) {
    return new AutoValue_InstrumentDescriptor(
        name, description, INSTRUMENT_TYPE_DOUBLE_OBSERVABLE_COUNTER);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy