Monitoring and Observability
| Attribute | Value |
|---|---|
| Project | [Project Name] |
| Version | 0.1 |
| Status | Draft |
Table of Contents
- 1. Monitoring Strategy
- 2. Log Aggregation Approach
- 3. Distributed Tracing
- 4. Key Metrics and Dashboards
- 5. Alerting Rules and Escalation
- 6. Performance Monitoring
- 7. Observability Integration in Delivery Workflow
- 8. Data Privacy and Security in Observability
- 9. Cost Management
- Source References
1. Monitoring Strategy
Primary Observability Tools
| Concern | Tool | Rationale |
|---|---|---|
| Error tracking | [e.g. Sentry, Datadog, Bugsnag] | [Why] |
| Infrastructure metrics | [e.g. CloudWatch, Grafana, Datadog] | [Why] |
| Log aggregation | [e.g. CloudWatch Logs, Loki, ELK] | [Why] |
Cost Boundary Management
- [Set a monthly spend cap or alert threshold.]
- [Free-tier limits used during MVP.]
2. Log Aggregation Approach
- Structured logging: all application logs use JSON with consistent fields (
timestamp,level,message,requestId,service,environment). - Log levels:
ERRORfor actionable failures,WARNfor degraded states,INFOfor business events,DEBUGfor development. - Retention: [e.g. 14 days for application logs, 30 days for infrastructure logs.]
3. Distributed Tracing
- Tracing tool: [same as error tracking or a dedicated APM — link the ADR.]
- Trace propagation: [how trace IDs flow across services / across frontend and backend.]
- Sampling strategy: [full in dev/staging, adaptive or head-based in production.]
4. Key Metrics and Dashboards
Service-Level Indicators (SLIs)
| SLI | What it measures | Target | Source |
|---|---|---|---|
| Error rate | % of 5xx responses out of total requests | < 1% | [Tool] |
| p95 latency | 95th percentile response time | < [N]ms | [Tool] |
| Availability | Successful requests / total requests | > 99.5% | [Tool] |
Dashboard Views
| Dashboard | Audience | Panels |
|---|---|---|
| Application Health | Dev team | Error rate, p50/p95 latency, request volume by route |
| Infrastructure | DevOps / Infra | CPU, memory, connections, disk, network |
| Business KPIs | Product | [Key conversion or usage metrics] |
Dashboard Mockups
ASCII mockups or exported screenshots can be committed here to anchor conversations before dashboards are built.
┌─────────────────────────────────────────────────────────┐
│ Application Health │
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ Error Rate │ │ p95 Latency │ │ Request Vol │ │
│ │ 0.3% ✓ │ │ 89ms ✓ │ │ 1.2k/min ✓ │ │
│ └───────────────┘ └───────────────┘ └───────────────┘ │
└─────────────────────────────────────────────────────────┘
5. Alerting Rules and Escalation
| Condition | Severity | Action | Notification |
|---|---|---|---|
| Error rate > 2% for 5 min | Critical | Page on-call | [Channel] |
| p95 latency > 500ms for 10 min | Warning | Slack notification | [Channel] |
| Disk usage > 80% | Warning | Review + plan | [Channel] |
Escalation Flow
- Alert fires → notification to [channel]
- Acknowledged within [N] minutes → investigation begins
- Not acknowledged → escalate to [secondary contact]
- Resolved → post-incident review if severity is Critical
6. Performance Monitoring
- Frontend: [Core Web Vitals (LCP, INP, CLS), error boundary reports, bundle size tracking.]
- Backend: [Endpoint latency distributions, slow query logging, connection pool stats.]
- Database: [Query performance, index usage, connection count.]
7. Observability Integration in Delivery Workflow
- Release tagging in the error tracker is triggered by the production deploy pipeline.
- Every PR includes a link to related Sentry/error-tracker issues when available.
- Monitoring dashboards are reviewed during sprint planning or release sign-off.
8. Data Privacy and Security in Observability
- PII is scrubbed before ingestion (field redaction rules in the error tracker).
- Log aggregation does not store raw request/response bodies by default.
- Access to observability dashboards follows the same RBAC model as the application.
- Audit trails for infrastructure changes are captured separately (IaC plan/apply logs).
9. Cost Management
- [Monthly review of observability spend.]
- [Free-tier limits documented per tool.]
- [Actions taken when approaching limits: sampling adjustments, retention reduction.]
Source References
Last Updated: YYYY-MM-DD