Class TextFormat
- java.lang.Object
-
- io.prometheus.client.exporter.common.TextFormat
-
public class TextFormat extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTENT_TYPE_004Content-type for Prometheus text version 0.0.4.static StringCONTENT_TYPE_OPENMETRICS_100Content-type for Openmetrics text version 1.0.0.
-
Constructor Summary
Constructors Constructor Description TextFormat()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringchooseContentType(String acceptHeader)Return the content type that should be used for a given Accept HTTP header.static voidwrite004(Writer writer, Enumeration<io.prometheus.client.Collector.MetricFamilySamples> mfs)Write out the text version 0.0.4 of the given MetricFamilySamples.static voidwriteFormat(String contentType, Writer writer, Enumeration<io.prometheus.client.Collector.MetricFamilySamples> mfs)Write out the given MetricFamilySamples in a format per the contentType.static voidwriteOpenMetrics100(Writer writer, Enumeration<io.prometheus.client.Collector.MetricFamilySamples> mfs)Write out the OpenMetrics text version 1.0.0 of the given MetricFamilySamples.
-
-
-
Field Detail
-
CONTENT_TYPE_004
public static final String CONTENT_TYPE_004
Content-type for Prometheus text version 0.0.4.- See Also:
- Constant Field Values
-
CONTENT_TYPE_OPENMETRICS_100
public static final String CONTENT_TYPE_OPENMETRICS_100
Content-type for Openmetrics text version 1.0.0.- Since:
- 0.10.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TextFormat
public TextFormat()
-
-
Method Detail
-
chooseContentType
public static String chooseContentType(String acceptHeader)
Return the content type that should be used for a given Accept HTTP header.- Since:
- 0.10.0
-
writeFormat
public static void writeFormat(String contentType, Writer writer, Enumeration<io.prometheus.client.Collector.MetricFamilySamples> mfs) throws IOException
Write out the given MetricFamilySamples in a format per the contentType.- Throws:
IOException- Since:
- 0.10.0
-
write004
public static void write004(Writer writer, Enumeration<io.prometheus.client.Collector.MetricFamilySamples> mfs) throws IOException
Write out the text version 0.0.4 of the given MetricFamilySamples.- Throws:
IOException
-
writeOpenMetrics100
public static void writeOpenMetrics100(Writer writer, Enumeration<io.prometheus.client.Collector.MetricFamilySamples> mfs) throws IOException
Write out the OpenMetrics text version 1.0.0 of the given MetricFamilySamples.- Throws:
IOException- Since:
- 0.10.0
-
-