Interface ExpositionFormatWriter

All Known Implementing Classes:
OpenMetricsTextFormatWriter, PrometheusProtobufWriter, PrometheusTextFormatWriter

public interface ExpositionFormatWriter
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts(String acceptHeader)
     
     
    default boolean
    Returns true if the writer is available.
    default String
    toDebugString(io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots)
    Converts the metric snapshots to a debug string using the default escaping scheme.
    default String
    toDebugString(io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots, io.prometheus.metrics.config.EscapingScheme escapingScheme)
    Converts the metric snapshots to a debug string using the specified escaping scheme.
    default void
    write(OutputStream out, io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots)
    Writes the given metric snapshots to the output stream using the default escaping scheme.
    void
    write(OutputStream out, io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots, io.prometheus.metrics.config.EscapingScheme escapingScheme)
    Writes the given metric snapshots to the output stream using the specified escaping scheme.
  • Method Details

    • accepts

      boolean accepts(@Nullable String acceptHeader)
    • write

      void write(OutputStream out, io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots, io.prometheus.metrics.config.EscapingScheme escapingScheme) throws IOException
      Writes the given metric snapshots to the output stream using the specified escaping scheme.
      Throws:
      IOException
    • write

      default void write(OutputStream out, io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots) throws IOException
      Writes the given metric snapshots to the output stream using the default escaping scheme.
      Throws:
      IOException
    • toDebugString

      default String toDebugString(io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots, io.prometheus.metrics.config.EscapingScheme escapingScheme)
      Converts the metric snapshots to a debug string using the specified escaping scheme.
    • toDebugString

      default String toDebugString(io.prometheus.metrics.model.snapshots.MetricSnapshots metricSnapshots)
      Converts the metric snapshots to a debug string using the default escaping scheme.
    • getContentType

      String getContentType()
    • isAvailable

      default boolean isAvailable()
      Returns true if the writer is available. If false, the writer will throw an exception if used.