diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-14 13:54:54 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-14 13:54:54 +0200 |
| commit | 3a6e01c1abd4a68810f1d85c9aa75293af47f579 (patch) | |
| tree | 2e3c066392cf2a292e89c90f259d039ce0afcb9b /docs/reference/example-queries.md | |
| parent | f3ea9a7a1f466b6109271c76eb58189d2a799998 (diff) | |
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 <cursoragent@cursor.com>
Diffstat (limited to 'docs/reference/example-queries.md')
| -rw-r--r-- | docs/reference/example-queries.md | 66 |
1 files changed, 66 insertions, 0 deletions
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 . +``` |
