diff options
| author | bndw <ben@bdw.to> | 2026-02-14 09:41:18 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-14 09:41:18 -0800 |
| commit | 688548d4ac3293449a88913275f886fd2e103cdf (patch) | |
| tree | 5bf83c9a9b50863b6201ebf5066ee6855fefe725 /proto/nostr/v1/nostr.proto | |
| parent | f0169fa1f9d2e2a5d1c292b9080da10ef0878953 (diff) | |
feat: add Prometheus metrics and YAML config file support
## Metrics Package
Comprehensive Prometheus metrics for production observability:
Metrics tracked:
- Request rate, latency, size per method (histograms)
- Active connections and subscriptions (gauges)
- Auth success/failure rates (counters)
- Rate limit hits (counters)
- Storage stats (event count, DB size)
- Standard Go runtime metrics
Features:
- Automatic gRPC instrumentation via interceptors
- Low overhead (~300-500ns per request)
- Standard Prometheus client
- HTTP /metrics endpoint
- Grafana dashboard examples
## Config Package
YAML configuration file support with environment overrides:
Configuration sections:
- Server (addresses, timeouts, public URL)
- Database (path, connections, lifetime)
- Auth (enabled, required, timestamp window, allowed pubkeys)
- Rate limiting (per-method and per-user limits)
- Metrics (endpoint, namespace)
- Logging (level, format, output)
- Storage (compaction, retention)
Features:
- YAML file loading
- Environment variable overrides (MUXSTR_<SECTION>_<KEY>)
- Sensible defaults
- Validation on load
- Duration and list parsing
- Save/export configuration
Both packages include comprehensive README with examples, best
practices, and usage patterns. Config tests verify YAML parsing,
env overrides, validation, and round-trip serialization.
Diffstat (limited to 'proto/nostr/v1/nostr.proto')
0 files changed, 0 insertions, 0 deletions
