You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: expose Prometheus /metrics endpoint for usage dashboards (#102)
* feat: expose Prometheus /metrics endpoint for usage dashboards
Adds a Prometheus text-format `GET /metrics` endpoint covering the metrics
requested in #101:
* cryptify_uploads_total{channel}
* cryptify_upload_bytes_total{channel}
* cryptify_storage_bytes (gauge, sampled periodically from data_dir)
* cryptify_active_files (gauge, same source)
* cryptify_expired_files_total (counter, purged-before-finalized)
The channel label is derived from request headers:
1. X-Cryptify-Source explicit header
2. Authorization: Bearer / X-Api-Key -> "api"
3. Origin -> "staging-website" / "website"
4. User-Agent substring -> "outlook" / "thunderbird"
5. fallback "unknown"
Values are sanitized (lower-case [a-z0-9_-], max 32 chars) to prevent
label-injection and cardinality blowup.
Storage gauges are sampled by a background task that walks data_dir every
`metrics_scan_interval_secs` (default 60, configurable). Dashboard JSON
ready for import into the Scaleway Grafana instance is shipped under
`docs/grafana/`, alongside a Prometheus scrape-config example.
No authentication on /metrics; restrict via firewall / proxy allow-list
(documented in README and docs/grafana/README.md).
Refs #101
* chore: cargo fmt + drop non-standard Monitoring README section
Rule compliance pass:
- cargo fmt --all (rust-run-cargo-fmt-before-push)
- README "Monitoring" section removed; docs already live in
docs/grafana/README.md (standardized-readmes)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: correct indentation of production target in Grafana scrape config
The production target's labels block was indented under targets instead
of being a sibling, which would fail YAML parsing.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* chore: drop docs/grafana from metrics PR
Remove the Grafana dashboard JSON and scrape-config README per
maintainer feedback — keep only the /metrics endpoint exposure.
---------
Co-authored-by: dobby-yivi-agent[bot] <275734547+dobby-yivi-agent[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments