| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add 'authorized' status for requests that complete successfully after
authentication. This complements the existing 'unauthenticated' (pre-auth)
status tracking.
Now the dashboard shows:
- Authorized: Authenticated requests that succeeded
- Unauthorized: Authenticated requests rejected (not in allowlist)
- Pre-Auth: Requests sent before authentication
This gives full visibility into the auth flow:
1. Challenges: How many clients authenticated
2. Authorized: How many authenticated requests succeeded
3. Unauthorized: How many were rejected despite valid auth
4. Pre-Auth: How many tried before authenticating
Updated metrics:
- requests_total{status="authorized"} - authenticated successes
- requests_total{status="ok"} - unauthenticated successes (when no auth)
|
| |
|
|
|
|
|
|
|
|
| |
Updated metrics dashboard to show:
- Unauthorized: Requests rejected due to pubkey not in allowlist
- Pre-Auth: Requests sent before authentication completed
- Challenges: Successful AUTH challenge completions
This surfaces the new 'unauthorized' and 'unauthenticated' request
status metrics on the dashboard for easier monitoring of auth issues.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Track and display blocked event counts with per-kind breakdown.
- Add events_blocked_total counter with kind label
- Add RecordBlockedEvent method to metrics
- Display blocked count in dashboard Storage section
- Call metric when rejecting non-core protocol kinds
Allows monitoring spam patterns and verifying kind filter effectiveness.
Raw metrics show breakdown by kind (e.g., kind=20001, kind=30311).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Transform metrics dashboard from dark modern theme to classic beige
theme matching the index page.
Changes:
- Background: dark (#0a0a0a) → beige (#f5f0e8)
- Font: sans-serif → Courier New (monospace)
- Colors: vibrant gradients → simple black/brown
- Cards: dark (#1a1a1a) → white with black borders
- Layout: max-width 1200px → 960px (matches index)
- Typography: modern sizing → classic smaller fonts
- Logo: Add muxstr SVG logo matching index page
- Dividers: Add horizontal rules for section breaks
- Status badge: Green gradient → orange/brown (#c97556)
- Removed: Color coding (success/error/warning classes)
Result: Clean, classic, brutalist aesthetic consistent with index page.
The dashboard now feels like part of the same relay, not a separate app.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Track and display storage and performance metrics that were previously
showing zeros.
Storage metrics:
- Add GetStats() method to storage returning event count and DB size
- Store database file path for size calculation
- Update metrics every 30 seconds via goroutine in main.go
- Display event count and DB size (MB) in dashboard
Performance metrics:
- Calculate average latency from histogram sum/count metrics
- Display as milliseconds in dashboard
- Formula: (duration_sum / duration_count) * 1000
Missing metrics (deferred):
- Connections: requires connection lifecycle tracking (gRPC + WebSocket)
- Deletions: count would need API change to ProcessDeletion
Dashboard now shows accurate storage stats and request latency!
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug: Dashboard showed zeros because it detected "go" as the prefix instead
of "muxstr" when Go runtime metrics appeared first in the metrics list.
Fix: Search for the first metric containing "_relay_" to properly detect
the namespace (muxstr, nostr-grpc, etc.) instead of using the first metric
in the alphabetical list.
Before: Object.keys(metrics)[0] → "go_gc_..." → prefix = "go"
After: Find metric with "_relay_" → "muxstr_relay_..." → prefix = "muxstr"
This fixes the dashboard displaying zeros when metrics data is present.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two critical fixes for metrics:
1. Fix interceptor chaining
- Changed from mixed grpc.UnaryInterceptor/ChainUnaryInterceptor to
proper chaining with grpc.ChainUnaryInterceptor
- Metrics interceptor now runs first (as intended)
- All interceptors properly chained in order: metrics → auth → ratelimit
- This fixes metrics not being recorded for any requests
2. Fix dashboard uptime calculation
- Changed from page load time to process_start_time_seconds metric
- Uptime now persists correctly across page refreshes
- Uses Prometheus standard process_start_time_seconds gauge
Before: Metrics showed 0 for all requests, uptime reset on refresh
After: Metrics properly record all gRPC requests, uptime shows actual relay uptime
|
|
|
Add a real-time metrics dashboard accessible at the metrics server root.
The dashboard displays relay statistics in a human-readable format with
auto-refresh every 5 seconds.
Features:
- Active connections and subscriptions
- Request counts (total, success, errors)
- Authentication stats (success/failure)
- Rate limiting hits
- Storage metrics (events, DB size, deletions)
- Clean, dark-themed UI with gradient accents
- Auto-refresh and live uptime counter
The dashboard is embedded using go:embed and served at / while
Prometheus metrics continue to be available at /metrics.
Example: http://localhost:9090/ for dashboard
http://localhost:9090/metrics for raw metrics
|