From 3a6e01c1abd4a68810f1d85c9aa75293af47f579 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 14 Feb 2026 13:54:54 +0200 Subject: docs: restructure documentation and move scripts to scripts/ - Add docs/ hierarchy: guides, backends, operations, reference, design - Slim root README; add documentation index and links to docs/ - Add missing docs: csv-format-flexibility, dns-resolution, dtail-metrics-example, magefile - Document Prometheus/VictoriaMetrics and ClickHouse backends - Move all helper shell scripts to scripts/; update Magefile and doc references - Add ASCII diagrams for watch mode (CSV watcher), auto mode, and ingestion paths - Add .gitignore Co-authored-by: Cursor --- docs/reference/example-queries.md | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 docs/reference/example-queries.md (limited to 'docs/reference/example-queries.md') diff --git a/docs/reference/example-queries.md b/docs/reference/example-queries.md new file mode 100644 index 0000000..e78aaec --- /dev/null +++ b/docs/reference/example-queries.md @@ -0,0 +1,66 @@ +# Example Queries + +PromQL and curl examples for Epimetheus test metrics. Use your Prometheus (or Prometheus-compatible) query URL; after port-forward, that is often http://localhost:9090. + +## Basic PromQL + +```promql +# Total requests +epimetheus_test_requests_total + +# Request rate (last 5 minutes) +rate(epimetheus_test_requests_total[5m]) + +# Active connections +epimetheus_test_active_connections + +# Temperature +epimetheus_test_temperature_celsius +``` + +## Histogram + +```promql +# 95th percentile request duration +histogram_quantile(0.95, rate(epimetheus_test_request_duration_seconds_bucket[5m])) + +# Median (50th percentile) +histogram_quantile(0.50, rate(epimetheus_test_request_duration_seconds_bucket[5m])) + +# Average request duration +rate(epimetheus_test_request_duration_seconds_sum[5m]) / +rate(epimetheus_test_request_duration_seconds_count[5m]) +``` + +## Labeled counter + +```promql +# Failed jobs by type +epimetheus_test_jobs_processed_total{status="failed"} + +# Job success rate +rate(epimetheus_test_jobs_processed_total{status="success"}[5m]) / +rate(epimetheus_test_jobs_processed_total[5m]) + +# Total jobs by type +sum by (job_type) (epimetheus_test_jobs_processed_total) +``` + +## Curl (HTTP API) + +```bash +# Port-forward if needed +kubectl port-forward -n monitoring svc/prometheus-kube-prometheus-prometheus 9090:9090 & + +# Total requests +curl -s "http://localhost:9090/api/v1/query?query=epimetheus_test_requests_total" | jq . + +# Temperature +curl -s "http://localhost:9090/api/v1/query?query=epimetheus_test_temperature_celsius" | jq . + +# Request rate +curl -s "http://localhost:9090/api/v1/query?query=rate(epimetheus_test_requests_total[5m])" | jq . + +# Histogram p95 +curl -s "http://localhost:9090/api/v1/query?query=histogram_quantile(0.95,rate(epimetheus_test_request_duration_seconds_bucket[5m]))" | jq . +``` -- cgit v1.2.3