Module io.prometheus.writer.text
Class PrometheusProtobufWriter
java.lang.Object
io.prometheus.metrics.expositionformats.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 TypeMethodDescriptionbooleanbooleanReturns true if the writer is available.toDebugString(io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots) voidwrite(OutputStream out, io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots) Text formats use UTF-8 encoding.
-
Field Details
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
PrometheusProtobufWriter
public PrometheusProtobufWriter()
-
-
Method Details
-
accepts
- Specified by:
acceptsin interfaceExpositionFormatWriter
-
getContentType
- Specified by:
getContentTypein interfaceExpositionFormatWriter
-
isAvailable
public boolean isAvailable()Description copied from interface:ExpositionFormatWriterReturns true if the writer is available. If false, the writer will throw an exception if used.- Specified by:
isAvailablein interfaceExpositionFormatWriter
-
toDebugString
- Specified by:
toDebugStringin 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
-