Get p95 latency from a histogram

p95 latency per job. Always aggregate `_bucket` by `le` before histogram_quantile

histogram_quantile(0.95, sum by(le,job)(rate(http_request_duration_seconds_bucket[5m])))

tool
prometheus30 commands
tags
prometheusperformanceobservabilitymonitoring

More prometheus commands

  • predict_linear(node_filesystem_avail_bytes{mountpoint="/"}[6h], 4*3600) < 0

    Alert when the trend of the last 6h says the disk will be full within 4h

  • absent(up{job="node"} == 1)

    Fires when no series match, catches a job that disappeared from service discovery

  • label_replace(node_uname_info, "host", "$1", "nodename", "(.+)")

    Create a new label from a regex capture, useful for joins and cleaner dashboards

  • max_over_time(rate(node_network_receive_bytes_total[5m])[1h:1m])

    Subquery: the highest 5m rate, checked every minute over the last hour, shows traffic bursts

  • sum without(instance) (rate(http_requests_total{code=~"5.."}[5m]))

    without() keeps every label except instance, cleaner than a long by() list

all 30 prometheus commands