1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/loki/files/rules.yaml
Kristian Klausen a0ef2cb7cc
loki/nginx: Add recording rule for tracking upstream cache status[1]
This enables us to calculate the cache hit ratio, which may help
determine whether more caching would be beneficial.

Please note that this only counts requests for which caching is enabled
(e.g. {fastcgi,proxy}_cache is configured), e.g. for static served files
cache_status will be "".

[1] http://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_cache_status
2024-12-22 15:30:40 +01:00

9 lines
496 B
YAML

groups:
- name: NginxRules
interval: 1m
rules:
- record: instance_http_version_tls_version_tls_cipher:requests:rate1m
expr: 'sum by (instance, http_version, tls_version, tls_cipher) (rate({job="nginx"}[1m] | json http_version="server_protocol", tls_version="ssl_protocol", tls_cipher="ssl_cipher"))'
- record: instance_cache_status:requests:rate1m
expr: 'sum by (instance, cache_status) (rate({job="nginx"}[1m] | json cache_status="upstream_cache_status"))'