io.opentelemetry.instrumentation.kafka.internal.InstrumentDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-kafka-clients-common Show documentation
Show all versions of opentelemetry-kafka-clients-common Show documentation
Instrumentation of Java libraries using OpenTelemetry.
/*
* 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);
}
}