Class PrometheusTextFormatWriter
Object
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 TypeMethodDescriptionboolean
builder()
static PrometheusTextFormatWriter
create()
void
write
(OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme scheme) Writes the given metric snapshots to the output stream using the specified escaping scheme.void
writeCreated
(Writer writer, MetricSnapshot snapshot, EscapingScheme scheme) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ExpositionFormatWriter
isAvailable, toDebugString, toDebugString, write
-
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:
accepts
in interfaceExpositionFormatWriter
-
getContentType
- Specified by:
getContentType
in interfaceExpositionFormatWriter
-
write
public void write(OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme scheme) throws IOException Description copied from interface:ExpositionFormatWriter
Writes the given metric snapshots to the output stream using the specified escaping scheme.- Specified by:
write
in interfaceExpositionFormatWriter
- Throws:
IOException
-
writeCreated
public void writeCreated(Writer writer, MetricSnapshot snapshot, EscapingScheme scheme) throws IOException - Throws:
IOException
-
builder()
orcreate()
instead