This page explains how to migrate your PromQL queries to Axiom.
To migrate your PromQL queries to Metrics Processing Language (MPL), choose one of the following options:
Manually translate your PromQL queries to MPL. This page explains the differences between MPL and PromQL and provides examples of how to migrate your queries.
While MPL and PromQL are both designed for querying metrics data, they differ in fundamental ways that impact how queries are written and interpreted. This section outlines the key differences to help you adapt PromQL workflows when migrating to Axiom.
Prometheus treats all label values as strings, which often leads users to rely heavily on regular expressions for filtering. MPL, by contrast, supports a broader and more expressive type system, including native types like numbers, booleans, and timestamps. This means you can write cleaner, type-aware queries and avoid the pitfalls of string-only comparisons.For OpenTelemetry (OTel) data, this difference means that MPL preserves source types, enabling more accurate and efficient filtering and aggregation.
PromQL is optimized for a sparse label space and performs poorly with high-cardinality label sets. This design limits how many dimensions can be encoded as labels.MPL doesn’t impose the same restrictions. It encourages richer, high-cardinality data ingestion, allowing you to store and query more attributes per event without performance degradation.Additionally, PromQL users often use enrichment queries to simulate dimensional joins and join label values from one series into another. MPL doesn’t currently support this pattern because it diverges from OpenTelemetry semantics, which emphasize event-based modeling over metric enrichment.
Histogram support differs significantly. In PromQL, histogram queries typically yield one time series per bucket or a single quantile series depending on the function.MPL allows histogram operations that can output multiple series in a single query, providing greater flexibility for analyzing distributions or rendering percentile summaries directly.
In PromQL, regular expressions are written as string literals using the =~ operator. This requires escaping special characters using double quotes and backslashes, which can be error-prone.MPL treats regular expressions as a first-class type. Use the == and != operators with a regex literal prefixed by #/. There is no =~ operator in MPL.
Copy
Ask AI
// PromQLservice=~"checkout|payment"// MPL equivalent| where service == #/checkout|payment/
Regex is a native type in MPL. Denote regex using #/ and / instead of quotation marks (' or ").In regex, escape slash (/), but don’t escape quotation marks (' or ").