Class PrometheusProtobufWriter
Object
PrometheusProtobufWriter
- All Implemented Interfaces:
ExpositionFormatWriter
Write the Prometheus protobuf format as defined in github.com/prometheus/client_model.
As of today, this is the only exposition format that supports native histograms.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Returns true if the writer is available.toDebugString
(MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) Converts the metric snapshots to a debug string using the specified escaping scheme.void
write
(OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) Writes the given metric snapshots to the output stream using the specified escaping scheme.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ExpositionFormatWriter
toDebugString, write
-
Field Details
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
PrometheusProtobufWriter
public PrometheusProtobufWriter()
-
-
Method Details
-
accepts
- Specified by:
accepts
in interfaceExpositionFormatWriter
-
getContentType
- Specified by:
getContentType
in interfaceExpositionFormatWriter
-
isAvailable
Description copied from interface:ExpositionFormatWriter
Returns true if the writer is available. If false, the writer will throw an exception if used.- Specified by:
isAvailable
in interfaceExpositionFormatWriter
-
toDebugString
Description copied from interface:ExpositionFormatWriter
Converts the metric snapshots to a debug string using the specified escaping scheme.- Specified by:
toDebugString
in interfaceExpositionFormatWriter
-
write
public void write(OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) 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
-