Class MetricKey

java.lang.Object
io.confluent.telemetry.MetricKey
All Implemented Interfaces:
Keyed

public class MetricKey extends Object implements Keyed
Value object that contains the name and labels for a Metric.

Rather than a Metrics Protobuf, we use objects of this class for filtering Metrics and as entries in the LastValueTracker's underlying Map. We do this because 1) we want to avoid the CPU overhead by filtering metrics before we materialize them 2) the OpenCensus Metric format is not ideal for writing a predicate, since you have to stitch back together the metric labelKeys and labelValues (and this latter one lives inside of an array) and 3) the metric name + labels uniquely identify a metric.

  • Constructor Details

    • MetricKey

      public MetricKey(String name, Map<String,String> labels)
      Create a MetricKey
      Parameters:
      name - metric name. This should be the _converted_ name of the metric (the final name under which this metric is emitted).
      labels - mapping of tag keys to values.
  • Method Details