Module io.prometheus.writer.text
Class PrometheusTextFormatWriter
java.lang.Object
io.prometheus.metrics.expositionformats.PrometheusTextFormatWriter
- All Implemented Interfaces:
ExpositionFormatWriter
Write the Prometheus text format. This is the default if you view a Prometheus endpoint with your
Web browser.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbuilder()static PrometheusTextFormatWritercreate()voidwrite(OutputStream out, io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots) Text formats use UTF-8 encoding.voidwriteCreated(Writer writer, io.prometheus.metrics.model.snapshots.MetricSnapshot snapshot) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.prometheus.metrics.expositionformats.ExpositionFormatWriter
isAvailable, toDebugString
-
Field Details
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
PrometheusTextFormatWriter
Deprecated.- Parameters:
writeCreatedTimestamps- whether to include the _created timestamp in the output - This will produce an invalid OpenMetrics output, but is kept for backwards compatibility.
-
-
Method Details
-
builder
-
create
-
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
-
writeCreated
public void writeCreated(Writer writer, io.prometheus.metrics.model.snapshots.MetricSnapshot snapshot) throws IOException - Throws:
IOException
-
builder()orcreate()instead