Class PrometheusNamingConvention

  • All Implemented Interfaces:
    io.micrometer.core.instrument.config.NamingConvention
    Direct Known Subclasses:
    PrometheusDurationNamingConvention

    public class PrometheusNamingConvention
    extends java.lang.Object
    implements io.micrometer.core.instrument.config.NamingConvention
    See https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels for a specification of the constraints on metric names and labels
    • Field Summary

      • Fields inherited from interface io.micrometer.core.instrument.config.NamingConvention

        camelCase, dot, identity, slashes, snakeCase, upperCamelCase
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String name​(java.lang.String name, io.micrometer.core.instrument.Meter.Type type, java.lang.String baseUnit)
      Names are snake-cased.
      java.lang.String tagKey​(java.lang.String key)
      Label names may contain ASCII letters, numbers, as well as underscores.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micrometer.core.instrument.config.NamingConvention

        name, tagValue
    • Constructor Detail

      • PrometheusNamingConvention

        public PrometheusNamingConvention()
      • PrometheusNamingConvention

        public PrometheusNamingConvention​(java.lang.String timerSuffix)
    • Method Detail

      • name

        public java.lang.String name​(java.lang.String name,
                                     io.micrometer.core.instrument.Meter.Type type,
                                     @Nullable
                                     java.lang.String baseUnit)
        Names are snake-cased. They contain a base unit suffix when applicable.

        Names may contain ASCII letters and digits, as well as underscores and colons. They must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*

        Specified by:
        name in interface io.micrometer.core.instrument.config.NamingConvention
      • tagKey

        public java.lang.String tagKey​(java.lang.String key)
        Label names may contain ASCII letters, numbers, as well as underscores. They must match the regex [a-zA-Z_][a-zA-Z0-9_]*. Label names beginning with __ are reserved for internal use.
        Specified by:
        tagKey in interface io.micrometer.core.instrument.config.NamingConvention