By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Monitoring is the continuous observation and measurement of systems, applications, or infrastructure to detect issues, track performance, and ensure reliability. You use it to catch failures before they impact users, optimize resource usage, and maintain uptime in production environments.
Without monitoring, systems fail silently. Downtime costs businesses thousands per minute (e.g., AWS outages cost ~$100K/hour). Monitoring: - Prevents outages by alerting teams before small issues become critical.- Improves performance by identifying bottlenecks (e.g., slow database queries).- Reduces debugging time by providing logs, metrics, and traces.- Ensures compliance (e.g., GDPR, HIPAA) by tracking access and data flows.
Numerical data points collected over time (e.g., CPU usage, request latency, error rates). Metrics answer "What’s happening?" - Types: - Counters: Cumulative values (e.g., total HTTP requests). - Gauges: Current values (e.g., memory usage). - Histograms: Distribution of values (e.g., request duration percentiles).
Structured or unstructured text records of events (e.g., "User X logged in at 10:00 AM"). Logs answer "Why did this happen?" - Key attributes: Timestamp, severity (INFO/WARN/ERROR), source, message.
End-to-end records of a single request’s journey through a distributed system (e.g., a user’s API call hitting 5 microservices). Traces answer "Where is the bottleneck?" - Components: - Span: A single operation (e.g., a database query). - Trace ID: Links all spans for one request.
Automated notifications triggered when metrics/logs meet predefined conditions (e.g., "CPU > 90% for 5 minutes"). Alerts answer "When should I act?" - Best practices: - Avoid "alert fatigue" (too many false positives). - Use severity levels (P0/P1/P2).
The ability to infer a system’s internal state from external outputs (metrics, logs, traces). Observability is the goal; monitoring is the tool.
A typical monitoring pipeline has 4 stages:
Example: Wrap a function to log its execution time.
Collection
Push vs. pull:
/metrics
Storage
Trace storage (e.g., Jaeger, Zipkin).
Visualization & Alerting
Simple Diagram:
[App] → (Metrics/Logs/Traces) → [Collector] → [Storage] → [Dashboard/Alerts]
bash docker run -d --name=prometheus -p 9090:9090 prom/prometheus
Prometheus scrapes its own metrics by default (visit http://localhost:9090).
http://localhost:9090
Add Node Exporter (collects system metrics): bash docker run -d --name=node-exporter -p 9100:9100 prom/node-exporter
bash docker run -d --name=node-exporter -p 9100:9100 prom/node-exporter
prometheus.yml
Restart Prometheus: bash docker restart prometheus
bash docker restart prometheus
Run Grafana (visualize metrics): bash docker run -d --name=grafana -p 3000:3000 grafana/grafana
bash docker run -d --name=grafana -p 3000:3000 grafana/grafana
http://localhost:3000
admin/admin
http://prometheus:9090
1860
Expected Outcome: - A Grafana dashboard showing CPU, memory, disk, and network metrics.- Alerts can be added later (e.g., "CPU > 80% for 5m").
Fix: Focus on the "Four Golden Signals":
Alert Fatigue
Fix:
Ignoring Logs and Traces
Fix: Correlate metrics with logs/traces (e.g., "High latency? Check the trace for slow DB queries").
Not Testing Alerts
Fix: Trigger test alerts (e.g., curl -X POST http://alertmanager/api/v1/alerts).
curl -X POST http://alertmanager/api/v1/alerts
Storing Data Forever
user_id
http_requests_total
json {"level": "ERROR", "service": "auth", "message": "Login failed", "user_id": 123}
DEBUG
INFO
WARN
ERROR
$__interval
$__rate_interval
You’re monitoring a web app and notice a sudden spike in 5xx errors. Which tool would best help you identify the root cause? - A: Prometheus (metrics) - B: Grafana (dashboards) - C: Jaeger (traces) - D: Loki (logs)
Correct Answer: D (Loki) Explanation: While Prometheus (A) and Grafana (B) can show that errors are happening, Loki lets you query logs to see why (e.g., "NullPointerException in line 42"). Jaeger (C) is for tracing, which is overkill for this scenario.Why the Distractors Are Tempting: - A: Prometheus shows error rates, but not the cause.- B: Grafana visualizes metrics, but doesn’t explain errors.- C: Traces are useful for latency, not error debugging.
You’re setting up alerts for a database. Which threshold is least likely to cause alert fatigue? - A: "CPU > 80% for 1m" - B: "CPU > 95% for 5m" - C: "Disk usage > 90%" - D: "Memory usage > 85% for 10m"
Correct Answer: B ("CPU > 95% for 5m") Explanation: A high threshold (95%) with a long duration (5m) reduces false positives. Short windows (A) or static thresholds (C) trigger too often.Why the Distractors Are Tempting: - A: Short windows catch spikes but cause flapping.- C: Disk usage rarely drops, so this alert will fire constantly.- D: Memory usage can fluctuate, leading to false alarms.
You’re instrumenting a microservice with OpenTelemetry. What’s the minimum you need to add to a request to enable tracing? - A: A unique trace ID - B: A trace ID and a span ID - C: A trace ID, span ID, and parent span ID - D: A trace ID, span ID, and baggage
Correct Answer: B (A trace ID and a span ID) Explanation: A trace ID links spans across services, and a span ID identifies the current operation. Parent span ID (C) is optional (for nested spans). Baggage (D) is for propagating context (e.g., user ID), not tracing.Why the Distractors Are Tempting: - A: Without a span ID, you can’t distinguish operations in the same trace.- C: Parent span ID is only needed for child spans.- D: Baggage is useful but not required for basic tracing.
Write a simple alert rule (e.g., "CPU > 80%").
Intermediate
Define SLOs and error budgets for a service.
Advanced
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.