Monitoring & Logging
Purpose
Ensure production failures are seen quickly and diagnosed fast: logs centralized and searchable, the right metrics on dashboards, health/uptime checks, and alerts that page on user-facing symptoms with clear ownership. The application-code instrumentation lives in ../../backend/backend-observability; this skill is the ops/platform view.
When to Use
- When establishing production monitoring for the deployed system.
- Not for in-code log/metric emission design (
../../backend/backend-observability) or incident response (incident-readiness).
Inputs
- Instrumentation emitted by the apps (
../../backend/backend-observability) and health endpoints.
- Deployment targets (
deployment-selection), critical flows, on-call structure.
Discovery Questions
- Where do logs and metrics aggregate (platform-provided vs a chosen stack — a vendor decision), and are they searchable across services?
- Which user-facing symptoms warrant paging (error rate, latency, downtime, queue backlog)?
- Who owns each alert, and what's the retention/cost budget?
Responsibilities
- Centralize logs: structured logs from all services/instances shipped to one searchable place, correlatable by request ID (
../../backend/backend-observability); retention + sampling set to cost (incident-readiness needs history).
- Metrics + dashboards: the golden signals (error rate, latency, throughput, saturation) per service, plus queue depth/job failures/scheduled-job heartbeats (
../../backend/queues, ../../backend/scheduled-jobs) and infra (CPU/mem/DB pool — ../../database/database-performance).
- Health + uptime checks: liveness/readiness wired to the platform; external synthetic/uptime checks on critical endpoints (catches total-down that internal metrics can't report).
- Symptom-based alerting: page on user-visible symptoms, not raw causes; every alert actionable, owned, and routed to on-call (
incident-readiness) with a runbook link — tune to avoid pager fatigue.
- Verify redaction holds at the aggregation layer: no PII/secrets in shipped logs (
../../security/privacy-review, secrets-management).
Required Workflow
- Confirm apps emit structured, correlated logs + metrics.
- Centralize logs; set retention/sampling to budget.
- Build dashboards for golden signals + queues/jobs/infra.
- Wire health + external uptime checks.
- Define owned, actionable, symptom-based alerts with runbook links.
- Verify no PII/secrets reach the log store.
Decision Rules
- Alert on symptoms (users hurting), dashboard the causes — paging on CPU spikes breeds fatigue.
- External uptime checks are non-negotiable: internal metrics can't report "the whole thing is down."
- Every alert has an owner and an action, or it's deleted — unactionable alerts get muted, then everything gets ignored.
- Retention long enough to investigate incidents; sampling to control cost — a recorded trade-off.
Rules
- Logs centralized, searchable, correlated, PII/secret-free.
- Alerts owned, actionable, symptom-based.
- Uptime/synthetic checks on critical paths.
Anti-Patterns
- Logs scattered per-instance, unsearchable.
- Paging on every 5xx blip or CPU tick → pager fatigue → ignored pages.
- No external uptime check (blind to full outages).
- Alerts with no owner or no runbook.
- PII/secrets leaking into the aggregated logs.
Validation Checklist
Definition of Done
Centralized searchable logs, dashboards for the golden signals and async/infra surfaces, health + external uptime checks, and owned symptom-based alerts with runbooks — tuned against fatigue and verified PII/secret-free — so production failures are seen fast.
Related Skills
../../backend/backend-observability, incident-readiness, rollback-planning, production-readiness, deployment-selection, ../../backend/queues, ../../backend/scheduled-jobs, ../../database/database-performance, ../../security/privacy-review.
Related Knowledge
../../../knowledge/ (critical flows, on-call, cost budget).
Related References
../../../references/devops/ (dashboard/alert catalogs, when populated).
Context Loading Guidance
- Requires: app instrumentation, health endpoints, critical flows, on-call structure.
- Does not require: in-code emission design, app feature code.
- May load:
incident-readiness, ../../backend/backend-observability.
- Stop when: centralization, dashboards, checks, and alerts are defined.
Token Efficiency Guidance
Three artifacts: dashboard signal list, alert table (symptom→threshold→owner→runbook), and the retention/cost note.
1---2name: monitoring-logging3description: Use to plan production monitoring and logging at the ops level — centralized structured logs, key metrics/dashboards, health checks, symptom-based alerting with ownership, uptime/synthetic checks, and cost/retention — so failures are seen fast. Application instrumentation is backend-observability.4---56# Monitoring & Logging78## Purpose910Ensure production failures are **seen quickly and diagnosed fast**: logs centralized and searchable, the right metrics on dashboards, health/uptime checks, and alerts that page on user-facing symptoms with clear ownership. The application-code instrumentation lives in `../../backend/backend-observability`; this skill is the ops/platform view.1112## When to Use1314- When establishing production monitoring for the deployed system.15- **Not** for in-code log/metric emission design (`../../backend/backend-observability`) or incident *response* (`incident-readiness`).1617## Inputs1819- Instrumentation emitted by the apps (`../../backend/backend-observability`) and health endpoints.20- Deployment targets (`deployment-selection`), critical flows, on-call structure.2122## Discovery Questions2324- Where do logs and metrics aggregate (platform-provided vs a chosen stack — a vendor decision), and are they searchable across services?25- Which user-facing symptoms warrant paging (error rate, latency, downtime, queue backlog)?26- Who owns each alert, and what's the retention/cost budget?2728## Responsibilities2930- **Centralize logs**: structured logs from all services/instances shipped to one searchable place, correlatable by request ID (`../../backend/backend-observability`); retention + sampling set to cost (`incident-readiness` needs history).31- **Metrics + dashboards**: the golden signals (error rate, latency, throughput, saturation) per service, plus queue depth/job failures/scheduled-job heartbeats (`../../backend/queues`, `../../backend/scheduled-jobs`) and infra (CPU/mem/DB pool — `../../database/database-performance`).32- **Health + uptime checks**: liveness/readiness wired to the platform; external synthetic/uptime checks on critical endpoints (catches total-down that internal metrics can't report).33- **Symptom-based alerting**: page on user-visible symptoms, not raw causes; every alert **actionable, owned, and routed** to on-call (`incident-readiness`) with a runbook link — tune to avoid pager fatigue.34- **Verify redaction** holds at the aggregation layer: no PII/secrets in shipped logs (`../../security/privacy-review`, `secrets-management`).3536## Required Workflow37381. Confirm apps emit structured, correlated logs + metrics.392. Centralize logs; set retention/sampling to budget.403. Build dashboards for golden signals + queues/jobs/infra.414. Wire health + external uptime checks.425. Define owned, actionable, symptom-based alerts with runbook links.436. Verify no PII/secrets reach the log store.4445## Decision Rules4647- Alert on symptoms (users hurting), dashboard the causes — paging on CPU spikes breeds fatigue.48- External uptime checks are non-negotiable: internal metrics can't report "the whole thing is down."49- Every alert has an owner and an action, or it's deleted — unactionable alerts get muted, then everything gets ignored.50- Retention long enough to investigate incidents; sampling to control cost — a recorded trade-off.5152## Rules5354- Logs centralized, searchable, correlated, PII/secret-free.55- Alerts owned, actionable, symptom-based.56- Uptime/synthetic checks on critical paths.5758## Anti-Patterns5960- Logs scattered per-instance, unsearchable.61- Paging on every 5xx blip or CPU tick → pager fatigue → ignored pages.62- No external uptime check (blind to full outages).63- Alerts with no owner or no runbook.64- PII/secrets leaking into the aggregated logs.6566## Validation Checklist6768- [ ] Centralized, searchable, correlated logs; retention/sampling set.69- [ ] Dashboards: golden signals + queues/jobs/infra.70- [ ] Health + external uptime checks wired.71- [ ] Symptom-based, owned, actionable alerts with runbooks.72- [ ] No PII/secrets in the log store.7374## Definition of Done7576Centralized searchable logs, dashboards for the golden signals and async/infra surfaces, health + external uptime checks, and owned symptom-based alerts with runbooks — tuned against fatigue and verified PII/secret-free — so production failures are seen fast.7778## Related Skills7980`../../backend/backend-observability`, `incident-readiness`, `rollback-planning`, `production-readiness`, `deployment-selection`, `../../backend/queues`, `../../backend/scheduled-jobs`, `../../database/database-performance`, `../../security/privacy-review`.8182## Related Knowledge8384`../../../knowledge/` (critical flows, on-call, cost budget).8586## Related References8788`../../../references/devops/` (dashboard/alert catalogs, when populated).8990## Context Loading Guidance9192- **Requires:** app instrumentation, health endpoints, critical flows, on-call structure.93- **Does not require:** in-code emission design, app feature code.94- **May load:** `incident-readiness`, `../../backend/backend-observability`.95- **Stop when:** centralization, dashboards, checks, and alerts are defined.9697## Token Efficiency Guidance9899Three artifacts: dashboard signal list, alert table (symptom→threshold→owner→runbook), and the retention/cost note.