Class PrometheusTextFormat


  • public class PrometheusTextFormat
    extends java.lang.Object
    Logic to write metrics in Prometheus text format.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.Set<java.lang.String> metricNameSet  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static java.lang.String getTypeNameSuffix​(io.prometheus.client.Collector.Type type)  
      (package private) static java.lang.String getTypeStr​(io.prometheus.client.Collector.Type type)  
      (package private) void writeCounter​(java.io.Writer w, java.lang.String name, LongAdderCounter counter)  
      (package private) void writeGauge​(java.io.Writer w, java.lang.String name, SimpleGauge<? extends java.lang.Number> gauge)  
      (package private) static void writeMetricsCollectedByPrometheusClient​(java.io.Writer w, io.prometheus.client.CollectorRegistry registry)  
      (package private) void writeOpStat​(java.io.Writer w, java.lang.String name, DataSketchesOpStatsLogger opStat)  
      (package private) void writeType​(java.io.Writer w, java.lang.String name, java.lang.String type)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • metricNameSet

        java.util.Set<java.lang.String> metricNameSet
    • Constructor Detail

      • PrometheusTextFormat

        public PrometheusTextFormat()
    • Method Detail

      • writeGauge

        void writeGauge​(java.io.Writer w,
                        java.lang.String name,
                        SimpleGauge<? extends java.lang.Number> gauge)
      • writeCounter

        void writeCounter​(java.io.Writer w,
                          java.lang.String name,
                          LongAdderCounter counter)
      • writeMetricsCollectedByPrometheusClient

        static void writeMetricsCollectedByPrometheusClient​(java.io.Writer w,
                                                            io.prometheus.client.CollectorRegistry registry)
                                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getTypeNameSuffix

        static java.lang.String getTypeNameSuffix​(io.prometheus.client.Collector.Type type)
      • getTypeStr

        static java.lang.String getTypeStr​(io.prometheus.client.Collector.Type type)
      • writeType

        void writeType​(java.io.Writer w,
                       java.lang.String name,
                       java.lang.String type)
                throws java.io.IOException
        Throws:
        java.io.IOException