Package io.confluent.telemetry
Class MetricKey
java.lang.Object
io.confluent.telemetry.MetricKey
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()inthashCode()key()This is a bit weird but prevents from always having to wrap this object if we're already interacting with a MetricKey directly.static MetricKey.BuildertoString()
-
Constructor Details
-
MetricKey
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
-
getName
-
getLabels
-
equals
-
hashCode
public int hashCode() -
toString
-
key
This is a bit weird but prevents from always having to wrap this object if we're already interacting with a MetricKey directly. -
toBuilder
-
newBuilder
-