Class OpenMetricsTextFormatWriter
java.lang.Object
io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter
- All Implemented Interfaces:
ExpositionFormatWriter
Write the OpenMetrics text format as defined on https://openmetrics.io.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpenMetricsTextFormatWriter(boolean createdTimestampsEnabled, boolean exemplarsOnAllMetricTypesEnabled) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidwrite(OutputStream out, io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots) Text formats use UTF-8 encoding.
-
Field Details
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
OpenMetricsTextFormatWriter
public OpenMetricsTextFormatWriter(boolean createdTimestampsEnabled, boolean exemplarsOnAllMetricTypesEnabled) - Parameters:
createdTimestampsEnabled- defines if_createdtimestamps should be included in the output or not.
-
-
Method Details
-
accepts
- Specified by:
acceptsin interfaceExpositionFormatWriter
-
getContentType
- Specified by:
getContentTypein interfaceExpositionFormatWriter
-
write
public void write(OutputStream out, io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots) throws IOException Description copied from interface:ExpositionFormatWriterText formats use UTF-8 encoding.- Specified by:
writein interfaceExpositionFormatWriter- Throws:
IOException
-