Package io.grpc.opentelemetry
Class OpenTelemetryMetricSink
java.lang.Object
io.grpc.opentelemetry.OpenTelemetryMetricSink
- All Implemented Interfaces:
io.grpc.MetricSink
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
Nested classes/interfaces inherited from interface io.grpc.MetricSink
io.grpc.MetricSink.Registration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final Object
private static final Logger
private List
<OpenTelemetryMetricSink.MeasuresData> private final io.opentelemetry.api.metrics.Meter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDoubleCounter
(io.grpc.DoubleCounterMetricInstrument metricInstrument, double value, List<String> requiredLabelValues, List<String> optionalLabelValues) void
addLongCounter
(io.grpc.LongCounterMetricInstrument metricInstrument, long value, List<String> requiredLabelValues, List<String> optionalLabelValues) private io.opentelemetry.api.common.Attributes
createAttributes
(List<String> requiredLabelKeys, List<String> optionalLabelKeys, List<String> requiredLabelValues, List<String> optionalLabelValues, BitSet bitSet) (package private) List
<OpenTelemetryMetricSink.MeasuresData> int
void
recordDoubleHistogram
(io.grpc.DoubleHistogramMetricInstrument metricInstrument, double value, List<String> requiredLabelValues, List<String> optionalLabelValues) void
recordLongGauge
(io.grpc.LongGaugeMetricInstrument metricInstrument, long value, List<String> requiredLabelValues, List<String> optionalLabelValues) void
recordLongHistogram
(io.grpc.LongHistogramMetricInstrument metricInstrument, long value, List<String> requiredLabelValues, List<String> optionalLabelValues) io.grpc.MetricSink.Registration
registerBatchCallback
(Runnable callback, io.grpc.CallbackMetricInstrument... metricInstruments) private boolean
shouldEnableMetric
(io.grpc.MetricInstrument instrument) void
updateMeasures
(List<io.grpc.MetricInstrument> instruments)
-
Field Details
-
logger
-
lock
-
openTelemetryMeter
private final io.opentelemetry.api.metrics.Meter openTelemetryMeter -
enableMetrics
-
disableDefaultMetrics
private final boolean disableDefaultMetrics -
optionalLabels
-
measures
-
-
Constructor Details
-
OpenTelemetryMetricSink
-
-
Method Details
-
getEnabledMetrics
- Specified by:
getEnabledMetrics
in interfaceio.grpc.MetricSink
-
getOptionalLabels
- Specified by:
getOptionalLabels
in interfaceio.grpc.MetricSink
-
getMeasuresSize
public int getMeasuresSize()- Specified by:
getMeasuresSize
in interfaceio.grpc.MetricSink
-
getMeasures
List<OpenTelemetryMetricSink.MeasuresData> getMeasures() -
addDoubleCounter
public void addDoubleCounter(io.grpc.DoubleCounterMetricInstrument metricInstrument, double value, List<String> requiredLabelValues, List<String> optionalLabelValues) - Specified by:
addDoubleCounter
in interfaceio.grpc.MetricSink
-
addLongCounter
public void addLongCounter(io.grpc.LongCounterMetricInstrument metricInstrument, long value, List<String> requiredLabelValues, List<String> optionalLabelValues) - Specified by:
addLongCounter
in interfaceio.grpc.MetricSink
-
recordDoubleHistogram
public void recordDoubleHistogram(io.grpc.DoubleHistogramMetricInstrument metricInstrument, double value, List<String> requiredLabelValues, List<String> optionalLabelValues) - Specified by:
recordDoubleHistogram
in interfaceio.grpc.MetricSink
-
recordLongHistogram
public void recordLongHistogram(io.grpc.LongHistogramMetricInstrument metricInstrument, long value, List<String> requiredLabelValues, List<String> optionalLabelValues) - Specified by:
recordLongHistogram
in interfaceio.grpc.MetricSink
-
recordLongGauge
public void recordLongGauge(io.grpc.LongGaugeMetricInstrument metricInstrument, long value, List<String> requiredLabelValues, List<String> optionalLabelValues) - Specified by:
recordLongGauge
in interfaceio.grpc.MetricSink
-
registerBatchCallback
public io.grpc.MetricSink.Registration registerBatchCallback(Runnable callback, io.grpc.CallbackMetricInstrument... metricInstruments) - Specified by:
registerBatchCallback
in interfaceio.grpc.MetricSink
-
updateMeasures
- Specified by:
updateMeasures
in interfaceio.grpc.MetricSink
-
shouldEnableMetric
private boolean shouldEnableMetric(io.grpc.MetricInstrument instrument) -
createAttributes
-