Tools / Monitoring and Observability Interview Questions
What is OpenMetrics and how does it relate to Prometheus exposition format?
OpenMetrics is a specification for transmitting metrics at scale that evolved from the Prometheus text exposition format. It was accepted as a CNCF sandbox project and aims to be the standard for metrics exposition across the industry, not just within the Prometheus ecosystem.
The original Prometheus text format is simple: each line contains a metric name, label set, value, and optional timestamp. OpenMetrics extends this format with:
- A required final EOF marker (
# EOF) that allows parsers to detect incomplete responses. - Exemplars: Structured sample annotations that attach trace IDs to specific metric observations. For example, a histogram bucket observation can carry the trace ID of the request that fell into that bucket, enabling one-click navigation from a latency spike in a metric to the exact trace that caused it. This is the bridge between metrics and traces.
- Mandatory type and unit metadata: Stronger requirements for
# TYPEand# UNITannotations make the format more self-describing. - Native support for created timestamps: Useful for staleness handling.
Prometheus 2.x supports both the original text format and OpenMetrics (content negotiation via the Accept header). Most modern Prometheus client libraries can expose either format. The key practical feature that OpenMetrics enables is exemplars, which Grafana and Datadog can display as clickable trace links directly on metric graphs.
More Related questions...