Class TextFormat
java.lang.Object
io.prometheus.client.exporter.common.TextFormat
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringchooseContentType(String acceptHeader) Return the content type that should be used for a given Accept HTTP header.private static String(package private) static voidomWriteTimestamp(Writer writer, long timestampMs) private static Stringstatic voidwrite004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) Write out the text version 0.0.4 of the given MetricFamilySamples.private static voidwriteEscapedHelp(Writer writer, String s) private static voidwriteEscapedLabelValue(Writer writer, String s) static voidwriteFormat(String contentType, Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) Write out the given MetricFamilySamples in a format per the contentType.static voidwriteOpenMetrics100(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) Write out the OpenMetrics text version 1.0.0 of the given MetricFamilySamples.
-
Field Details
-
CONTENT_TYPE_004
Content-type for Prometheus text version 0.0.4.- See Also:
-
CONTENT_TYPE_OPENMETRICS_100
Content-type for Openmetrics text version 1.0.0.- Since:
- 0.10.0
- See Also:
-
-
Constructor Details
-
TextFormat
public TextFormat()
-
-
Method Details
-
chooseContentType
-
writeFormat
public static void writeFormat(String contentType, Writer writer, Enumeration<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<Collector.MetricFamilySamples> mfs) throws IOException Write out the text version 0.0.4 of the given MetricFamilySamples.- Throws:
IOException
-
writeEscapedHelp
- Throws:
IOException
-
writeEscapedLabelValue
- Throws:
IOException
-
typeString
-
writeOpenMetrics100
public static void writeOpenMetrics100(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException Write out the OpenMetrics text version 1.0.0 of the given MetricFamilySamples.- Throws:
IOException- Since:
- 0.10.0
-
omWriteTimestamp
- Throws:
IOException
-
omTypeString
-