Class MetricOptions

java.lang.Object
io.opencensus.metrics.MetricOptions
Direct Known Subclasses:
AutoValue_MetricOptions

@Immutable public abstract class MetricOptions extends Object
Options for every metric added to the MetricRegistry.
Since:
0.20
  • Constructor Details

    • MetricOptions

      MetricOptions()
  • Method Details

    • getDescription

      public abstract String getDescription()
      Returns the description of the Metric.

      Default value is "".

      Returns:
      the description of the Metric.
      Since:
      0.20
    • getUnit

      public abstract String getUnit()
      Returns the unit of the Metric.

      Default value is "1".

      Returns:
      the unit of the Metric.
      Since:
      0.20
    • getLabelKeys

      public abstract List<LabelKey> getLabelKeys()
      Returns the list of label keys for the Metric.

      Default value is Collections.emptyList().

      Returns:
      the list of label keys for the Metric.
      Since:
      0.20
    • getConstantLabels

      public abstract Map<LabelKey,LabelValue> getConstantLabels()
      Returns the map of constant labels (they will be added to all the TimeSeries) for the Metric.

      Default value is Collections.emptyMap().

      Returns:
      the map of constant labels for the Metric.
      Since:
      0.21
    • builder

      public static MetricOptions.Builder builder()
      Returns a new MetricOptions.Builder with default options.
      Returns:
      a new Builder with default options.
      Since:
      0.20.0