Skip to main content
BlindCast adds an encryption layer to your video stack. Monitor these metrics to catch issues before they affect viewers.

Player metrics

The player exposes real-time metrics via getMetrics():

Reporting metrics

Send metrics to your analytics backend on playback end or periodically:

What to alert on

Key server metrics

Health check

GET /health returns 200 OK when the server is running. Use this for:
  • Docker health checks: HEALTHCHECK CMD curl -f http://localhost:4100/health
  • Load balancer probes
  • Uptime monitoring (Pingdom, Better Uptime, etc.)

Request logging

The key server logs each request to stdout in JSON format. Pipe to your log aggregator (Datadog, CloudWatch, etc.) and monitor:

Prometheus metrics (optional)

If you run a reverse proxy (nginx, Caddy) in front of the key server, use its built-in Prometheus exporter to track request rates, latency histograms, and error codes.

Database monitoring

Postgres

If using Postgres for lease storage:

SQLite

If using SQLite (single-instance deployments):

Infrastructure

CDN cache hit ratio

Target: >95% cache hit ratio for segment requests. Low hit ratios mean the CDN is fetching from origin on most requests, adding latency and cost.

Dashboard template

Build a monitoring dashboard with these panels:
  1. Player experience — Time to first frame (p50, p95, p99), stall rate
  2. Key server — Request rate, latency (p50, p95), error rate (4xx, 5xx)
  3. Leases — Active lease count, creation rate, revocation rate
  4. Infrastructure — Container CPU/memory, DB connections, CDN cache hit ratio

Debugging playback issues

When a viewer reports playback problems:
  1. Check key server logs — Was the key request successful? Look for 401 (auth), 403 (lease revoked/expired), 500 (server error).
  2. Check player metrics — If avgKeyFetchTime is high, the issue is key server latency. If stallCount is high, the issue is CDN or bandwidth.
  3. Check CDN logs — Are segments being served? Look for 403 (CORS) or 404 (missing segments).
  4. Check lease state — If using leases, query the database: SELECT * FROM leases WHERE viewer_id = 'user-123' ORDER BY created_at DESC LIMIT 5;