summaryrefslogtreecommitdiffstats
path: root/go.mod
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-02-14 09:41:18 -0800
committerbndw <ben@bdw.to>2026-02-14 09:41:18 -0800
commit688548d4ac3293449a88913275f886fd2e103cdf (patch)
tree5bf83c9a9b50863b6201ebf5066ee6855fefe725 /go.mod
parentf0169fa1f9d2e2a5d1c292b9080da10ef0878953 (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 'go.mod')
-rw-r--r--go.mod12
1 files changed, 11 insertions, 1 deletions
diff --git a/go.mod b/go.mod
index ed24c3e..9ee553b 100644
--- a/go.mod
+++ b/go.mod
@@ -6,25 +6,35 @@ require (
6 connectrpc.com/connect v1.19.1 6 connectrpc.com/connect v1.19.1
7 github.com/btcsuite/btcd/btcec/v2 v2.3.2 7 github.com/btcsuite/btcd/btcec/v2 v2.3.2
8 github.com/klauspost/compress v1.18.4 8 github.com/klauspost/compress v1.18.4
9 github.com/prometheus/client_golang v1.23.2
9 golang.org/x/net v0.50.0 10 golang.org/x/net v0.50.0
11 golang.org/x/time v0.14.0
10 google.golang.org/grpc v1.79.1 12 google.golang.org/grpc v1.79.1
11 google.golang.org/protobuf v1.36.11 13 google.golang.org/protobuf v1.36.11
14 gopkg.in/yaml.v3 v3.0.1
12 modernc.org/sqlite v1.45.0 15 modernc.org/sqlite v1.45.0
13) 16)
14 17
15require ( 18require (
19 github.com/beorn7/perks v1.0.1 // indirect
16 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect 20 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
21 github.com/cespare/xxhash/v2 v2.3.0 // indirect
17 github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect 22 github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
18 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect 23 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
19 github.com/dustin/go-humanize v1.0.1 // indirect 24 github.com/dustin/go-humanize v1.0.1 // indirect
20 github.com/google/uuid v1.6.0 // indirect 25 github.com/google/uuid v1.6.0 // indirect
26 github.com/kr/text v0.2.0 // indirect
21 github.com/mattn/go-isatty v0.0.20 // indirect 27 github.com/mattn/go-isatty v0.0.20 // indirect
28 github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
22 github.com/ncruces/go-strftime v1.0.0 // indirect 29 github.com/ncruces/go-strftime v1.0.0 // indirect
30 github.com/prometheus/client_model v0.6.2 // indirect
31 github.com/prometheus/common v0.66.1 // indirect
32 github.com/prometheus/procfs v0.16.1 // indirect
23 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect 33 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
34 go.yaml.in/yaml/v2 v2.4.2 // indirect
24 golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect 35 golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
25 golang.org/x/sys v0.41.0 // indirect 36 golang.org/x/sys v0.41.0 // indirect
26 golang.org/x/text v0.34.0 // indirect 37 golang.org/x/text v0.34.0 // indirect
27 golang.org/x/time v0.14.0 // indirect
28 google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect 38 google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
29 modernc.org/libc v1.67.6 // indirect 39 modernc.org/libc v1.67.6 // indirect
30 modernc.org/mathutil v1.7.1 // indirect 40 modernc.org/mathutil v1.7.1 // indirect