diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-04 15:17:04 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-04 15:24:19 +0000 |
| commit | fd0c87c787d0626b3546fa571541c9c809711821 (patch) | |
| tree | 934f20d973127f380b807d2bd44b25c197cf349c /README.md | |
| parent | 762cd8e815e797f173f541795de774fbbf978fc3 (diff) | |
add prometheus metrics
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 22 |
1 files changed, 20 insertions, 2 deletions
| @@ -94,9 +94,27 @@ Why this is useful: | |||
| 94 | 94 | ||
| 95 | dedupe git data = shared object database or (GIT_ALTERNATE_OBJECT_DIRECTORIES or .git/objects/info/alternates) | 95 | dedupe git data = shared object database or (GIT_ALTERNATE_OBJECT_DIRECTORIES or .git/objects/info/alternates) |
| 96 | 96 | ||
| 97 | ### Logging | 97 | ### Monitoring |
| 98 | 98 | ||
| 99 | See [docs/explanation/monitoring-strategy.md](docs/monitoring-strategy.md). Note: this needs refinement. | 99 | ngit-grasp exposes Prometheus metrics at `/metrics` for connection tracking, Git operations, and Nostr events. |
| 100 | |||
| 101 | **Configuration Options:** | ||
| 102 | |||
| 103 | | Option | CLI Flag | Environment Variable | Default | | ||
| 104 | |--------|----------|---------------------|---------| | ||
| 105 | | Metrics enabled | `--metrics-enabled` | `NGIT_METRICS_ENABLED` | `true` | | ||
| 106 | | Connection abuse threshold | `--metrics-connection-per-ip-abuse-threshold` | `NGIT_METRICS_CONNECTION_PER_IP_ABUSE_THRESHOLD` | `10` | | ||
| 107 | | Top N repos | `--metrics-top-n-repos` | `NGIT_METRICS_TOP_N_REPOS` | `10` | | ||
| 108 | |||
| 109 | **Key Metrics:** | ||
| 110 | - WebSocket connections (active, unique IPs, flagged abusers) | ||
| 111 | - Git operations (clone/fetch/push rates, bandwidth, authorization results) | ||
| 112 | - Nostr events (received, stored, rejected by kind) | ||
| 113 | - Top N repositories by bandwidth | ||
| 114 | |||
| 115 | **Privacy:** IP addresses are never exposed in metrics - only aggregate counts. | ||
| 116 | |||
| 117 | See [Monitoring Overview](docs/explanation/monitoring.md) and [Prometheus Setup Guide](docs/how-to/prometheus-setup.md) for deployment. | ||
| 100 | 118 | ||
| 101 | ### Delete Events | 119 | ### Delete Events |
| 102 | 120 | ||