Interview Prep/Monitoring & Observability/Kubernetes Monitoring, Scale & Cloud

What is OpenMetrics, and how does it differ from the classic Prometheus text format?

AdvancedConceptKubernetes Monitoring, Scale & Cloud
Answer

OpenMetrics is the CNCF standardisation of the Prometheus exposition format. Differences that matter:

  • Content type application/openmetrics-text; version=1.0.0.
  • The payload must end with # EOF.
  • Counter samples must end in _total; a _created series may expose the counter's creation time.
  • Exemplars are only supported in OpenMetrics:
    http_requests_total{code="200"} 1027 # {trace_id="4bf92f3577b34da6"} 1 1731100000.123
    
  • Adds unit, info and stateset metric types.
  • Timestamps are in seconds (classic format uses milliseconds).

Prometheus negotiates the format through the Accept header; in Prometheus 3.x you control the order with scrape_protocols (e.g. [OpenMetricsText1.0.0, PrometheusProto, PrometheusText0.0.4]). Exemplar storage also needs --enable-feature=exemplar-storage.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Kubernetes Monitoring, Scale & Cloud