Class OpenMetrics2TextFormatWriter

java.lang.Object
io.prometheus.metrics.expositionformats.OpenMetrics2TextFormatWriter
All Implemented Interfaces:
ExpositionFormatWriter

public class OpenMetrics2TextFormatWriter extends Object implements ExpositionFormatWriter
Write the OpenMetrics 2.0 text format. This is currently a skeleton implementation that produces identical output to OpenMetrics 1.0, with infrastructure for future OM2 features. This is experimental and subject to change as the OpenMetrics 2.0 specification evolves.
  • Field Details

  • Constructor Details

    • OpenMetrics2TextFormatWriter

      public OpenMetrics2TextFormatWriter(io.prometheus.metrics.config.OpenMetrics2Properties openMetrics2Properties, boolean createdTimestampsEnabled, boolean exemplarsOnAllMetricTypesEnabled)
      Parameters:
      openMetrics2Properties - OpenMetrics 2.0 feature flags
      createdTimestampsEnabled - whether to include the _created timestamp in the output - This will produce an invalid OpenMetrics output, but is kept for backwards compatibility.
      exemplarsOnAllMetricTypesEnabled - whether to include exemplars on all metric types
  • Method Details