Skip to content

PRD-23: Monitoring & Observability #16

@PancheI

Description

@PancheI

Add Pino structured JSON logging, Prometheus metrics with signing/DKG/policy histograms, a pre-built Grafana dashboard, and alert rules.

Acceptance Criteria

  • console.log replaced by Pino structured JSON logging in production
  • Development mode uses pino-pretty for human-readable output
  • GET /metrics returns valid Prometheus exposition format
  • guardian_signing_duration_seconds histogram populated after signing
  • guardian_signing_requests_total counter with path and status labels
  • guardian_active_signing_sessions gauge reflects in-flight sessions
  • guardian_dkg_duration_seconds histogram with mode label
  • guardian_policy_evaluation_duration_seconds histogram populated
  • guardian_policy_violations_total counter per policy type
  • guardian_vault_health gauge (1=healthy, 0=sealed/unreachable)
  • guardian_http_request_duration_seconds histogram for all requests
  • Node.js process metrics collected via collectDefaultMetrics()
  • Prometheus scrapes every 15s without errors
  • Grafana dashboard loads with all panels
  • Alert rules fire correctly (e.g., VaultUnhealthy within 1 minute)
  • docker compose up starts Prometheus on :9090 and Grafana on :3001
  • No share data in logs, sensitive headers redacted
  • Request IDs (reqId) in all log lines for correlation

Tasks

  • Install prom-client, nestjs-pino, pino, pino-pretty
  • Create MetricsService, MetricsController, MetricsInterceptor
  • Configure Pino logger
  • Instrument InteractiveSignService, DKGService, AuxInfoPoolService
  • Create VaultHealthProbe with periodic check
  • Create Prometheus config, alert rules, Grafana provisioning + dashboard JSON
  • Update docker-compose.yml with Prometheus + Grafana services
  • Unit + integration tests, security audit (no share data in logs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priorityphase-2Go-live minimumprdProduct requirement document

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions