Interface Metric

All Known Subinterfaces:
Counter, Gauge, Histogram

public interface Metric
A named statistic of a StatsRegistry: a Counter, a Gauge or a Histogram.

Every metric has two names. Its flat name is Envoy's, with every value in it (http.ingress.downstream_rq_2xx), as the /stats text dump and statsd show it. Its tag-extracted name has those values taken out as tags by the registry's TagExtractor when the metric is registered (http.downstream_rq_xx with envoy_http_conn_manager_prefix="ingress" and envoy_response_code_class="2"), as Prometheus shows it.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    What kind of metric a Metric is.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a one-line description for Prometheus's # HELP line, or an empty string.
    Returns the flat name, such as cluster.direct.upstream_rq_total.
    Returns the name with its tag values taken out, such as cluster.upstream_rq_total.
    Returns the tags taken out of the flat name, in the order they were found.
    Returns what kind of metric this is.
  • Method Details

    • name

      String name()
      Returns the flat name, such as cluster.direct.upstream_rq_total.
      Returns:
      the flat name, such as cluster.direct.upstream_rq_total
    • tagExtractedName

      String tagExtractedName()
      Returns the name with its tag values taken out, such as cluster.upstream_rq_total.
      Returns:
      the name with its tag values taken out, such as cluster.upstream_rq_total
    • tags

      List<Tag> tags()
      Returns the tags taken out of the flat name, in the order they were found.
      Returns:
      the tags taken out of the flat name, in the order they were found
    • type

      Metric.Type type()
      Returns what kind of metric this is.
      Returns:
      what kind of metric this is
    • help

      String help()
      Returns a one-line description for Prometheus's # HELP line, or an empty string.
      Returns:
      a one-line description for Prometheus's # HELP line, or an empty string