Skip to content

Instantly share code, notes, and snippets.

@prologic
Created April 7, 2022 04:17
Show Gist options
  • Save prologic/a8e944472deb05ab147aca07b6f9192d to your computer and use it in GitHub Desktop.
Save prologic/a8e944472deb05ab147aca07b6f9192d to your computer and use it in GitHub Desktop.
p95 Traefik Prometheus Alertering Rule
---
- name: traefik
interval: 15s
rules:
- alert: p95_latency
expr: |
label_replace(
histogram_quantile(
0.95,
sum(
rate(traefik_service_request_duration_seconds_bucket{protocol="http"}[5m])
) by (service, le)
),
"short_label", "$1", "service", "(.*)@.*"
) > 0.9
for: 5m
annotations:
summary: "{{ $labels.short_label }}"
description: "p95 latency for {{ $labels.short_label }} is at {{ $value }}s"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment