Class MetricsUtils
java.lang.Object
io.confluent.telemetry.MetricsUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattributesMap(io.opentelemetry.proto.resource.v1.Resource resource) Convert resource attributes to a map of strings, ignoring non-string attributesattributesMap(List<io.opentelemetry.proto.common.v1.KeyValue> attributes) static List<io.opentelemetry.proto.metrics.v1.NumberDataPoint> extractDataPoints(io.opentelemetry.proto.metrics.v1.Metric metric) Extracts the list of data points from the given metric based on its type.static InstantfromTimeUnixNanos(long t) static OffsetDateTimenowInUTC()static ZonedDateTimestatic long
-
Constructor Details
-
MetricsUtils
public MetricsUtils()
-
-
Method Details
-
toTimeUnixNanos
-
fromTimeUnixNanos
-
nowInUTC
-
nowInUTC
-
attributesMap
-
attributesMap
-
extractDataPoints
public static List<io.opentelemetry.proto.metrics.v1.NumberDataPoint> extractDataPoints(io.opentelemetry.proto.metrics.v1.Metric metric) Extracts the list of data points from the given metric based on its type. Supports SUM and GAUGE metric types. Returns an empty list if the metric type is unsupported or does not contain data points.- Parameters:
metric- The metric from which to extract data points.- Returns:
- A list of
NumberDataPointobjects, or an empty list if no data points are available.
-