<feed xmlns='http://www.w3.org/2005/Atom'>
<title>muxstr.git/internal/metrics/dashboard.html, branch main</title>
<subtitle>Nostr relay with gRPC, HTTP/JSON, and WebSocket interfaces</subtitle>
<id>https://code.northwest.io/muxstr.git/atom?h=main</id>
<link rel='self' href='https://code.northwest.io/muxstr.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/'/>
<updated>2026-02-16T01:13:46+00:00</updated>
<entry>
<title>fix: clarify Storage 'Blocked' label as 'Blocked Kinds'</title>
<updated>2026-02-16T01:13:46+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-16T01:13:46+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=e7c37e80f0ebd0894df45cf2e9f4f29e16a781d7'/>
<id>urn:sha1:e7c37e80f0ebd0894df45cf2e9f4f29e16a781d7</id>
<content type='text'>
Makes it clear this metric tracks events rejected by kind filtering,
not general blocking
</content>
</entry>
<entry>
<title>feat: separate Auth Writes and Auth Reads on dashboard</title>
<updated>2026-02-15T18:39:05+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-15T18:39:05+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=84dc5995f28e6d63d3cbb1af44daba7f10cbca66'/>
<id>urn:sha1:84dc5995f28e6d63d3cbb1af44daba7f10cbca66</id>
<content type='text'>
- Added getMetricByLabels() helper for multi-label metric queries
- Split 'Authorized' metric into:
  - Auth Writes: requests_total{method=EVENT, status=authorized}
  - Auth Reads: requests_total{method=REQ, status=authorized}
- Provides clearer visibility into authenticated read vs write operations
</content>
</entry>
<entry>
<title>feat: track authorized (authenticated + successful) requests</title>
<updated>2026-02-15T18:31:06+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-15T18:31:06+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=f658ef072394ff9fd28244ad475859c210e8ec16'/>
<id>urn:sha1:f658ef072394ff9fd28244ad475859c210e8ec16</id>
<content type='text'>
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)
</content>
</entry>
<entry>
<title>feat: add auth rejection metrics to dashboard</title>
<updated>2026-02-15T18:23:33+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-15T18:23:33+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=a6ee0e3f268f9a847bf8a19159cf291021a0f38e'/>
<id>urn:sha1:a6ee0e3f268f9a847bf8a19159cf291021a0f38e</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>feat: add metrics for blocked events</title>
<updated>2026-02-15T16:22:03+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-15T16:22:03+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=71f7a444398275923246e1bc8283938a63a8267a'/>
<id>urn:sha1:71f7a444398275923246e1bc8283938a63a8267a</id>
<content type='text'>
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).
</content>
</entry>
<entry>
<title>style: dashboard</title>
<updated>2026-02-14T22:18:55+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-14T22:18:55+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=dbfc55ed1aec5faefacfcfbd51c4de06b316fa90'/>
<id>urn:sha1:dbfc55ed1aec5faefacfcfbd51c4de06b316fa90</id>
<content type='text'>
</content>
</entry>
<entry>
<title>style: restyle dashboard to match index page aesthetic</title>
<updated>2026-02-14T22:14:56+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-14T22:14:56+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=4a99f5dae75636cffdf88f850c46b9e5aad43e69'/>
<id>urn:sha1:4a99f5dae75636cffdf88f850c46b9e5aad43e69</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>feat: add storage stats and average latency metrics</title>
<updated>2026-02-14T20:53:50+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-14T20:53:50+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=75fb3a583cf4e8a7ca34bedb3322d309bb170ed4'/>
<id>urn:sha1:75fb3a583cf4e8a7ca34bedb3322d309bb170ed4</id>
<content type='text'>
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!
</content>
</entry>
<entry>
<title>fix: dashboard prefix detection with Go runtime metrics</title>
<updated>2026-02-14T20:45:20+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-14T20:45:20+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=9711b2b177959c0ea8e5119bead16dfd40b12c47'/>
<id>urn:sha1:9711b2b177959c0ea8e5119bead16dfd40b12c47</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>fix: properly chain gRPC interceptors and fix dashboard uptime</title>
<updated>2026-02-14T20:29:01+00:00</updated>
<author>
<name>bndw</name>
<email>ben@bdw.to</email>
</author>
<published>2026-02-14T20:29:01+00:00</published>
<link rel='alternate' type='text/html' href='https://code.northwest.io/muxstr.git/commit/?id=c33395cee66770c4d88a47537c0ed821f6585f62'/>
<id>urn:sha1:c33395cee66770c4d88a47537c0ed821f6585f62</id>
<content type='text'>
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
</content>
</entry>
</feed>
