Sample MPL queries
Sum rate#
`otel-demo-metrics`:`http.server.request.duration`
| where `axiom.histogram` == "count"
| where `http.response.status_code` < 400
| align to 5m using prom::rate
| group by `http.request.method`, `http.route` using sumHistogram#
Calculate the 90th and 99th percentile HTTP request durations by service.
`otel-demo-metrics`:`http.server.request.duration`
| where `http.response.status_code` < 400
| bucket by `service.name` to 5m using interpolate_delta_histogram(0.90, 0.99)Cumulative histogram#
interpolate_cumulative_histogram works on histogram metrics using cumulative temporality. interpolate_delta_histogram works on histogram metrics using delta temporality.
`otel-demo-metrics`:`http.server.request.duration`
| where `http.response.status_code` < 400
| bucket by `http.request.method`, `http.route` to 5m using interpolate_cumulative_histogram(rate, 0.90, 0.99)Bucket distribution#
Show how request durations are distributed across a histogram's buckets. Visualize the result with a heatmap dashboard element.
`otel-demo-metrics`:`http.server.request.duration`
| where `axiom.histogram` == "bucket"
| align to 5m using prom::rate
| group by `axiom.le` using sumCompute#
Compute error rate#
Calculate the fraction of HTTP requests returning 5xx errors.
(
`otel-demo-metrics`:`http.server.request.duration`
| where `http.response.status_code` >= 500
| map rate
| align to 5m using avg
| group using sum,
`otel-demo-metrics`:`http.server.request.duration`
| map rate
| align to 5m using avg
| group using sum
)
| compute error_rate using /Service Level Objectives (SLO)#
SLO compliance over time#
Calculate the fraction of time JVM CPU utilization stays below 80% over a 7-day window.
`otel-demo-metrics`:`jvm.cpu.recent_utilization`
| group using max
| map is::lt(0.8)
| align to 7d using avgSLO histogram#
Calculate the fraction of requests completing within the 400ms latency SLO target, measured weekly.
`otel-demo-metrics`:`http.server.request.duration`
| bucket to 5m using interpolate_cumulative_histogram(rate, 0.99)
| map is::lt(0.4)
| align to 7d using avg