Requests for last 60 Seconds:
count_over_time( {job="nginx"} [60s])
Rate over 60s:
rate( ( {env="production", job="nginx"} ) [60s])
Show metrics with filter patterns:
rate( ( {env="production", job="nginx"} |~ "GET (/er|/ax)" ) [10s])
Dnsmasq Queries:
sum (rate( ( {env="production",query=~".*\\..*"} )[5m] )) by (query)
All logs:
{job="all-logs"}
Logs for nginx job:
{job="nginx"}
apk add bind-tools
for domain in yahoo.com google.com facebook.com; do dig A $domain @127.0.0.1; done
- https://itnext.io/grafana-loki-the-logqls-prometheus-like-counters-aggregation-functions-and-dnsmasq-s-1e622c25c7e4
- https://grafana.com/blog/2019/07/15/lokis-path-to-ga-docker-logging-driver-plugin-support-for-systemd/
- https://medium.com/@mightywomble/using-grafana-to-visualise-syslog-files-with-loki-9a8869081fb5 (includes queries)