Class OtelCollectorMetrics
java.lang.Object
codes.grow.packages.otelcollector.OtelCollectorMetrics
OTLP metrics for the collector: the official OTLP metric exporter (cumulative temporality) and
meter / counter / upDownCounter / histogram / gauge
helpers on the global MeterProvider (registered by initTelemetry unless
setGlobal(false)). A TelemetryHandle offers the same helpers on its own provider.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic io.opentelemetry.api.metrics.LongCounterMonotonic counter without options.static io.opentelemetry.api.metrics.LongCountercounter(String name, InstrumentOptions options) Monotonic counter (OTLPsum,isMonotonic, cumulative) on the global provider.static io.opentelemetry.api.metrics.DoubleGaugegauge(String name, InstrumentOptions options) Synchronous gauge (OTLPgauge, last value) on the global provider.static io.opentelemetry.api.metrics.DoubleHistogramhistogram(String name, InstrumentOptions options) Histogram with optional explicit bucket boundaries on the global provider.static io.opentelemetry.api.metrics.Metermeter()A meter namedDEFAULT_METER_NAMEfrom the global provider.static io.opentelemetry.api.metrics.MeterA meter from the global provider.static io.opentelemetry.sdk.metrics.export.MetricExportermetricExporter(OtelCollectorConfig config) The official OTLP metric exporter for a collector config:http/protobuf→OtlpHttpMetricExporter(metricsUrl),grpc→OtlpGrpcMetricExporter.static io.opentelemetry.api.metrics.LongUpDownCounterupDownCounter(String name, InstrumentOptions options) Up/down counter (OTLP non-monotonicsum) on the global provider.
-
Field Details
-
DEFAULT_METER_NAME
Meter name used by the helpers when none is given.- See Also:
-
RUNTIME_METER_NAME
Meter name of the JVM runtime metrics.- See Also:
-
-
Method Details
-
metricExporter
public static io.opentelemetry.sdk.metrics.export.MetricExporter metricExporter(OtelCollectorConfig config) The official OTLP metric exporter for a collector config:http/protobuf→OtlpHttpMetricExporter(metricsUrl),grpc→OtlpGrpcMetricExporter.- Parameters:
config- collector config- Returns:
- the exporter
-
meter
public static io.opentelemetry.api.metrics.Meter meter()A meter namedDEFAULT_METER_NAMEfrom the global provider.- Returns:
- the meter
-
meter
A meter from the global provider.- Parameters:
name- instrumentation scope name- Returns:
- the meter
-
counter
public static io.opentelemetry.api.metrics.LongCounter counter(String name, InstrumentOptions options) Monotonic counter (OTLPsum,isMonotonic, cumulative) on the global provider.- Parameters:
name- instrument nameoptions- description, unit, meter- Returns:
- the counter
-
counter
Monotonic counter without options.- Parameters:
name- instrument name- Returns:
- the counter
-
upDownCounter
public static io.opentelemetry.api.metrics.LongUpDownCounter upDownCounter(String name, InstrumentOptions options) Up/down counter (OTLP non-monotonicsum) on the global provider.- Parameters:
name- instrument nameoptions- description, unit, meter- Returns:
- the counter
-
histogram
public static io.opentelemetry.api.metrics.DoubleHistogram histogram(String name, InstrumentOptions options) Histogram with optional explicit bucket boundaries on the global provider.- Parameters:
name- instrument nameoptions- description, unit, meter, boundaries- Returns:
- the histogram
-
gauge
public static io.opentelemetry.api.metrics.DoubleGauge gauge(String name, InstrumentOptions options) Synchronous gauge (OTLPgauge, last value) on the global provider.- Parameters:
name- instrument nameoptions- description, unit, meter- Returns:
- the gauge
-