Class LabeledMetricNameUtils.MetricNameBuilder

java.lang.Object
org.apache.beam.sdk.metrics.LabeledMetricNameUtils.MetricNameBuilder
Enclosing class:
LabeledMetricNameUtils

public static class LabeledMetricNameUtils.MetricNameBuilder extends Object
Builder class for a labeled MetricName. Returned MetricName.getName() will be formatted as:

'{baseName}-{metricLabelKey1}:{metricLabelVal1};...{metricLabelKeyN}:{metricLabelValN};'

  • Method Details

    • baseNameBuilder

      public static LabeledMetricNameUtils.MetricNameBuilder baseNameBuilder(String baseName)
    • addLabel

      public void addLabel(String key, String value)
      Add a metric label KV pair to the metric name. Calling addLabel multiple times with the same key will lead to unexpected results when parsing metric names.
    • addMetricLabel

      public void addMetricLabel(String key, String value)
      Add a metric label KV pair to the metric. This is not concatenated as a part of the name, but merely for adding attributes to the metric.
    • build

      public MetricName build(String metricNamespace)