← Back to Blog

Monitoring and Alerting Setup: Observability for Production Systems

Comprehensive observability strategies for reliable, maintainable systems

Production systems require comprehensive monitoring and alerting enabling teams to detect, diagnose, and resolve issues quickly. Without proper observability, teams operate blind—learning about problems from angry customers rather than proactive alerts. Effective monitoring provides visibility into system health, performance, and user experience while alerting notifies teams of problems requiring immediate attention. The challenge lies in monitoring the right things at appropriate granularity without creating alert fatigue drowning teams in noise. Many organizations start with too few monitors missing critical issues, then overcorrect with too many alerts training teams to ignore notifications. Research shows teams ignoring 60-80% of alerts due to poor signal-to-noise ratios suffer longer outages when real problems occur. The solution requires strategic monitoring architecture balancing comprehensive coverage with actionable alerting. Monitor everything but alert only on symptoms impacting users or predicting imminent failures. This comprehensive guide explores what to monitor across different system layers, how to structure effective alerts avoiding fatigue, implementing observability through logs, metrics, and traces, building dashboards supporting rapid troubleshooting, and evolving monitoring as systems grow. Whether starting from scratch or improving existing observability, these patterns help teams catch problems early and resolve them fast.

The Three Pillars of Observability

Comprehensive observability combines metrics, logs, and traces providing different views into system behavior.

For more insights on this topic, see our guide on No-Code and Low-Code Platforms: Build Applications Without Traditional Programming.

Metrics: Numerical measurements tracked over time. CPU usage, request rates, error counts, and response times are metrics. Metrics excel at showing trends and triggering alerts when values exceed thresholds. Lightweight and aggregatable, metrics provide efficient high-level system health views.

Logs: Discrete event records capturing what happened and when. Application logs, access logs, and error logs provide detailed context for specific events. Logs help diagnose issues by showing sequence of events leading to problems. Structured logging in JSON format enables efficient querying.

Traces: Records of requests flowing through distributed systems. Each trace shows complete request path across services including timing for each step. Distributed tracing reveals bottlenecks, dependency issues, and failure patterns in microservice architectures. Traces connect metrics and logs providing end-to-end visibility.

Combining Pillars Effectively

Maximum observability comes from using all three together strategically.

Use metrics for alerting and dashboards showing overall system health. When alerts fire, use logs to understand what happened and traces to see where problems occurred in distributed requests. Metrics identify THAT there's a problem, logs explain WHAT the problem is, and traces show WHERE the problem originated. Integration between tools enables jumping from high-level metric alerts to specific logs and traces for affected requests.

What to Monitor

Effective monitoring covers multiple system layers from infrastructure to business metrics.

Infrastructure metrics: Monitor CPU, memory, disk, and network usage for all servers. Track container and pod metrics in Kubernetes environments. Infrastructure metrics provide foundation—application problems often stem from resource constraints.

Application performance: Track request rates, response times (median and percentiles), and error rates. Monitor database query performance, cache hit rates, and external API latency. Application metrics show user-experienced performance.

Business metrics: Monitor revenue, conversion rates, active users, and other KPIs. Business metrics connect technical health to business outcomes. Technical issues often manifest as business metric changes before error rates spike.

User experience: Track actual user experience through real user monitoring (RUM). Measure page load times, interaction latency, and client-side errors. Server metrics don't capture network issues or browser problems affecting users.

The Golden Signals

Google's Site Reliability Engineering practices emphasize four golden signals providing high-level service health view.

Latency: Time required to service requests. Track both successful and failed request latencies separately—failed requests often complete faster than successful ones, hiding problems in averages. Monitor latency percentiles (p50, p95, p99) not just averages.

Traffic: Demand on your system measured in requests per second, transactions per second, or similar metrics. Traffic patterns reveal usage trends and capacity requirements. Sudden traffic drops often indicate upstream problems.

Errors: Rate of failed requests whether explicit failures (HTTP 500s), implicit failures (wrong content), or policy violations (responses too slow). Distinguish between different error types—client errors (4xx) versus server errors (5xx) require different responses.

Saturation: How "full" your service is. Measure resource utilization approaching limits—90% memory usage indicates capacity issues before hitting 100%. Include queue depths, thread pool utilization, and connection pool exhaustion.

Effective Alerting Strategies

Alerts should be actionable, urgent, and user-impacting. Everything else is notification or dashboard metric.

  • Alert on symptoms, not causes — Alert when users are affected (error rate high, latency high) not on potential causes (disk 80% full). Symptom-based alerting reduces false positives and ensures alerts matter.
  • Make alerts actionable — Every alert should require human action. If automated remediation handles it, don't page humans. Include runbooks in alert descriptions guiding response.
  • Use appropriate thresholds — Set thresholds based on user impact, not arbitrary values. 1% error rate might be disaster for payments but normal for experimental features. Adjust thresholds to service criticality.
  • Alert on trends and anomalies — Sudden changes often indicate problems even when absolute values seem okay. 10% error rate is terrible, but even 0.1% is concerning if normal is 0.01%. Use anomaly detection complementing static thresholds.
  • Implement alert severity levels — Distinguish critical (page immediately), high (respond within hours), and medium (review next business day) alerts. Reserve paging for truly urgent issues.

Avoiding Alert Fatigue

Too many alerts train teams to ignore them, creating dangerous situations.

Regular alert review: Periodically audit all alerts asking "if this fired, would we take immediate action?" Eliminate or downgrade alerts not meeting this bar. Track alert frequency and response patterns identifying noise.

Alert aggregation: Group related alerts preventing alert storms. If service degradation triggers 20 individual alerts, aggregate to single alert indicating broader issue. Aggregation reduces cognitive load during incidents.

Smart escalation: Don't page everyone immediately. Start with automated checks, escalate to primary on-call, then to secondary, finally to management only if unresolved. Escalation policies prevent unnecessary wakeups while ensuring problems get addressed.

Alert tuning: Continuously adjust alert thresholds and conditions based on false positive rates and missed issues. Alert tuning is ongoing process as systems evolve. Document tuning decisions in alert configuration.

Dashboard Design Principles

Dashboards should support specific use cases from health checks to troubleshooting.

Service overview dashboards: High-level view of service health showing golden signals and critical metrics. Overview dashboards answer "is everything okay?" at a glance. Use red/yellow/green status indicators for quick health assessment.

Troubleshooting dashboards: Detailed metrics supporting incident investigation. Include resource utilization, detailed error breakdowns, and dependency health. Troubleshooting dashboards help answer "what's wrong and why?"

Business dashboards: Business metric dashboards for stakeholders. Show revenue, user activity, conversion funnels, and other KPIs. Business dashboards connect technical work to business outcomes.

Hierarchy and drill-down: Design dashboard hierarchies from high-level overviews to detailed component views. Enable drilling down from service health to specific hosts or containers. Hierarchy guides investigation from symptom to cause.

Monitoring Tools and Platforms

Choose monitoring tools matching your architecture, scale, and operational model.

Prometheus + Grafana: Open-source metrics collection and visualization. Prometheus scrapes metrics from applications and infrastructure. Grafana provides powerful dashboards and alerting. Strong choice for Kubernetes environments.

Datadog: Comprehensive SaaS monitoring platform covering infrastructure, applications, logs, and traces. Excellent user experience and correlation capabilities. Higher cost but lower operational overhead than self-hosted solutions.

New Relic: Application performance monitoring (APM) with deep code-level visibility. Strong transaction tracing and database monitoring. Good choice for application-centric monitoring needs.

ELK Stack: Elasticsearch, Logstash, Kibana for log aggregation and analysis. Self-hosted log management solution. Requires operational investment but provides flexibility and no per-GB pricing.

Structured Logging Best Practices

Logs provide greatest value when structured consistently and comprehensively.

JSON format: Log in JSON with consistent field names. Structured logs enable efficient querying and parsing. Include standard fields like timestamp, severity, service name, and trace ID in every log entry.

Appropriate log levels: Use ERROR for unexpected failures requiring attention, WARN for degraded conditions, INFO for normal significant events, and DEBUG for detailed troubleshooting information. Consistent level usage enables filtering effectively.

Context in logs: Include relevant context helping understand what happened. User ID, request ID, transaction ID, and related resource identifiers make logs useful during investigations. Avoid logging sensitive data like passwords or PII.

Correlation IDs: Generate unique ID for each request and include it in all logs and traces for that request. Correlation IDs enable following single request through distributed system. Essential for microservice troubleshooting.

Distributed Tracing Implementation

Tracing reveals how requests flow through microservice architectures identifying bottlenecks and failures.

Instrumentation: Add tracing libraries to applications generating spans for operations. Automatic instrumentation for frameworks reduces manual work. Instrument key operations like database queries, external API calls, and business logic functions.

Sampling strategies: Trace every request in development but sample in production to control costs. Use head-based sampling (sample at request start) or tail-based sampling (sample after completion based on characteristics). Sample 100% of errors and slow requests.

Trace context propagation: Pass trace context between services using standard headers (W3C Trace Context or OpenTelemetry). Context propagation connects spans across service boundaries creating complete distributed traces.

Trace analysis: Use traces to identify slow operations, understand service dependencies, and debug errors. Comparing traces for slow requests versus fast requests reveals performance bottlenecks.

On-Call and Incident Response

Monitoring and alerting support effective incident response processes.

On-call rotations: Distribute on-call responsibility across team members. Primary and secondary on-call ensure coverage. Limit on-call shifts to reasonable durations preventing burnout. Compensate on-call time appropriately.

Runbooks: Document response procedures for common alerts. Runbooks guide on-call engineers through troubleshooting steps. Include diagnostic queries, remediation steps, and escalation criteria. Keep runbooks updated as systems evolve.

Incident severity levels: Define severity levels (SEV1/2/3/4) based on user impact and business criticality. Severity determines response urgency and escalation. Clear severity definitions enable consistent handling.

Post-incident reviews: After resolving incidents, conduct blameless post-mortems analyzing what happened, how it was resolved, and how to prevent recurrence. Document lessons learned and follow up on action items.

Related Reading

Need Help Building Observability?

We design and implement comprehensive monitoring and alerting systems giving you visibility into production systems and confidence in reliability.

Improve Your Observability