Prometheus - GradedJestRisk/cicd-training GitHub Wiki
Job
Instance
https://prometheus.io/docs/concepts/jobs_instances/
https://github.com/prometheus-community/postgres_exporter
Operators https://prometheus.io/docs/prometheus/latest/querying/operators/
CheatSheet https://promlabs.com/promql-cheat-sheet/
Operator is =~
uri=~"<PATTERN>"
Use RE2 pattern matching https://github.com/google/re2/wiki/Syntax
URL
- start with
foo
http_server_requests_seconds_count{uri=~"^(/foo).*"}
On dimension, eg uri
sum by (uri) (http_server_requests_seconds_count {})
Count metric to instantaneous : increase
floor(sum(increase(nginx_vts_filter_requests_total{filter=~".*ptm.*",code!='3xx'}[2m])))/120
https://prometheus.io/docs/prometheus/latest/configuration/unit_testing_rules/