Package io.confluent.telemetry.metrics
Class SinglePointMetric
java.lang.Object
io.confluent.telemetry.metrics.SinglePointMetric
- All Implemented Interfaces:
Keyed
An OpenTelemetry (unbuilt)
Metric and its associated MetricKey.
The Metric only has a single data point.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Iterable<io.opentelemetry.proto.common.v1.KeyValue> asAttributes(Map<String, String> labels) static SinglePointMetricstatic SinglePointMetriccumulativeSum(MetricKey metricKey, double value, Instant timestamp) static SinglePointMetriccumulativeSum(MetricKey metricKey, double value, Instant timestamp, Instant startTimestamp) static SinglePointMetriccumulativeSum(MetricKey metricKey, long value, Instant timestamp) static SinglePointMetriccumulativeSum(MetricKey metricKey, long value, Instant timestamp, Instant startTimestamp) static SinglePointMetricstatic SinglePointMetricstatic SinglePointMetricstatic SinglePointMetricstatic SinglePointMetriccreates a metric data point for arbitrary Number values.key()io.opentelemetry.proto.metrics.v1.Metric.Buildermetric()
-
Method Details
-
key
-
metric
public io.opentelemetry.proto.metrics.v1.Metric.Builder metric() -
create
public static SinglePointMetric create(MetricKey metricKey, io.opentelemetry.proto.metrics.v1.Metric.Builder metric) -
asAttributes
-
gauge
creates a metric data point for arbitrary Number values. Since OpenTelemetry only supports double and long primitive types, the following mapping appliesLong / Integer -> long All other Number types -> double
For fine-grained control, use
point(Instant, long)andpoint(Instant, double)- Parameters:
metricKey-value-timestamp-- Returns:
-
gauge
-
gauge
-
deltaSum
public static SinglePointMetric deltaSum(MetricKey metricKey, long value, Instant timestamp, Instant startTimestamp) -
deltaSum
public static SinglePointMetric deltaSum(MetricKey metricKey, double value, Instant timestamp, Instant startTimestamp) -
cumulativeSum
-
cumulativeSum
-
cumulativeSum
public static SinglePointMetric cumulativeSum(MetricKey metricKey, long value, Instant timestamp, Instant startTimestamp) -
cumulativeSum
public static SinglePointMetric cumulativeSum(MetricKey metricKey, double value, Instant timestamp, Instant startTimestamp)
-