Interview's MateData Engineer
Interview's Mate

Data Engineer

SQL · Spark · Lakehouse · Streaming

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Data Engineer topics
Lesson 154/ 160
08. Data Quality, Governance, Security & AI Infrastructure

Monitoring & Alerting for Data Infrastructure (Prometheus, Grafana, OpenTelemetry)

Instrument data infra with Prometheus/Grafana and OpenTelemetry for metrics, logs, and traces.

IntermediatePrometheus · Grafana · OTel3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Low-cardinality metrics and stable resources. Next, oTel trace/span and run identifiers. Finally, sustained/burn-rate condition, owner, runbook, suppression.

Think of it like…

Metrics are dashboard gauges, logs are the maintenance journal, traces are the numbered journey through stations, and alerting is the mechanic who is paged only when a gauge predicts service failure.

Where you’ve seen it

A Spark/Flink job exports records_processed_total, queue/event age, checkpoint duration, and error counters with low-cardinality pipeline/region; OTel trace run_id links source fetch, warehouse MERGE, and publish API logs.

Words you’ll hear

Prometheus
A pull-oriented metrics model and query language for time-series samples, recording rules, and alert conditions.
Grafana
A visualization and alert frontend over metrics/logs/traces with dashboards and notification policies.
OTel
A vendor-neutral telemetry model and SDK/export protocol for traces, metrics, logs, and contextual attributes.
Operational boundary
High-cardinality labels can bankrupt Prometheus storage, every batch warning can page an on-call engineer, and a trace ending at an uninstrumented worker hides where a late or failed data handoff occurred. Instrument RED/USE or data SLO metrics, keep label sets bounded, use trace IDs across logs/jobs, configure multi-window burn-rate or sustained alerts, and route actionable ownership with runbooks and maintenance suppression.

Visual diagram

Loading interactive diagram

Theory & deep dive

Prometheus: the working mechanism

Prometheus scrapes time-series metrics, Grafana visualizes and routes alerts, and OpenTelemetry standardizes traces, metrics, logs, and semantic resource/trace attributes for correlated infrastructure and pipeline views.

Low-cardinality metrics and stable resources. OTel trace/span and run identifiers, then per-SLO dashboard and pipeline dependency; this exposes the state governed by OTel.

Monitoring & Alerting for Data Infrastructure in one concrete design

A Spark/Flink job exports records_processed_total, queue/event age, checkpoint duration, and error counters with low-cardinality pipeline/region; OTel trace run_id links source fetch, warehouse MERGE, and publish API logs.

Key takeaway: Prometheus scrapes time-series metrics, Grafana visualizes and routes alerts, and OpenTelemetry standardizes traces, metrics, logs, and semantic resource/trace attributes for correlated infrastructure and pipeline views

Monitoring & Alerting for Data Infrastructure: failure mode and production response

High-cardinality labels can bankrupt Prometheus storage, every batch warning can page an on-call engineer, and a trace ending at an uninstrumented worker hides where a late or failed data handoff occurred.

Instrument RED/USE or data SLO metrics, keep label sets bounded, use trace IDs across logs/jobs, configure multi-window burn-rate or sustained alerts, and route actionable ownership with runbooks and maintenance suppression. Track Cardinality as "bounded labels, never query/user IDs in Prometheus labels", and make Alert burn rate visible to the dataset owner.

Key takeaway: Instrument RED/USE or data SLO metrics, keep label sets bounded, use trace IDs across logs/jobs, configure multi-window burn-rate or sustained alerts, and route actionable ownership with runbooks and maintenance suppression.

How it works, step by step

Step 1 of 4
Prometheus

1. Instrument

Low-cardinality metrics and stable resources. Prometheus scrapes time-series metrics, Grafana visualizes and routes alerts, and OpenTelemetry standardizes traces, metrics, logs, and semantic resource/trace attributes for correlated infrastructure and pipeline views.

low-cardinality metrics and stable resources
Key numbers at this step
Cardinality
bounded labels, never query/user IDs in Prometheus labels
Grafana
A visualization and alert frontend over metrics/logs/traces with dashboards and notification policies.

When to use it & trade-offs

What it is

Prometheus scrapes time-series metrics, Grafana visualizes and routes alerts, and OpenTelemetry standardizes traces, metrics, logs, and semantic resource/trace attributes for correlated infrastructure and pipeline views. A Spark/Flink job exports records_processed_total, queue/event age, checkpoint duration, and error counters with low-cardinality pipeline/region; OTel trace run_id links source fetch, warehouse MERGE, and publish API logs.

Why it matters: High-cardinality labels can bankrupt Prometheus storage, every batch warning can page an on-call engineer, and a trace ending at an uninstrumented worker hides where a late or failed data handoff occurred. Instrument RED/USE or data SLO metrics, keep label sets bounded, use trace IDs across logs/jobs, configure multi-window burn-rate or sustained alerts, and route actionable ownership with runbooks and maintenance suppression.

When to reach for it

  • Instrument data infra with Prometheus/Grafana and OpenTelemetry for metrics, logs, and traces.
  • Choose Prometheus because it provides this capability: A pull-oriented metrics model and query language for time-series samples, recording rules, and alert conditions.
  • Keep evidence for Cardinality at "bounded labels, never query/user IDs in Prometheus labels" so the last production stage-Alert - sustained/burn-rate condition, owner, runbook, suppression-remains testable.

When to avoid or be careful

  • High-cardinality labels can bankrupt Prometheus storage, every batch warning can page an on-call engineer, and a trace ending at an uninstrumented worker hides where a late or failed data handoff occurred.
  • Do not conflate Grafana with Prometheus. The second concept contributes different behavior: A visualization and alert frontend over metrics/logs/traces with dashboards and notification policies.
  • Release only after this guardrail is in place: Instrument RED/USE or data SLO metrics, keep label sets bounded, use trace IDs across logs/jobs, configure multi-window burn-rate or sustained alerts, and route actionable ownership with runbooks and maintenance suppression.

Prometheus / Grafana / OTel - roles, limits, and operating cost

Prometheus
Best for: A pull-oriented metrics model and query language for time-series samples, recording rules, and alert conditions.

Strengths: A pull-oriented metrics model and query language for time-series samples, recording rules, and alert conditions. Prometheus scrapes time-series metrics, Grafana visualizes and routes alerts, and OpenTelemetry standardizes traces, metrics, logs, and semantic resource/trace attributes for correlated infrastructure and pipeline views.

Watch out: High-cardinality labels can bankrupt Prometheus storage, every batch warning can page an on-call engineer, and a trace ending at an uninstrumented worker hides where a late or failed data handoff occurred.

Grafana
Best for: A visualization and alert frontend over metrics/logs/traces with dashboards and notification policies.

Strengths: A visualization and alert frontend over metrics/logs/traces with dashboards and notification policies. In this workflow it supports: Visualize - per-SLO dashboard and pipeline dependency.

Watch out: The operating cost is real: SLO error budget consumption over fast/slow windows.

OTel
Best for: A vendor-neutral telemetry model and SDK/export protocol for traces, metrics, logs, and contextual attributes.

Strengths: A vendor-neutral telemetry model and SDK/export protocol for traces, metrics, logs, and contextual attributes. Its output can be checked with Trace coverage.

Watch out: Operating guardrail: Instrument RED/USE or data SLO metrics, keep label sets bounded, use trace IDs across logs/jobs, configure multi-window burn-rate or sustained alerts, and route actionable ownership with runbooks and maintenance suppression.

Interview signals & numbers to know

When this topic comes up

  • “Where is the failure boundary for Prometheus, and how would Cardinality reveal it?”
  • “Why is Grafana distinct from this behavior: a vendor-neutral telemetry model and SDK/export protocol for traces, metrics, logs, and contextual attributes?”
  • Production clue: High-cardinality labels can bankrupt Prometheus storage, every batch warning can page an on-call engineer, and a trace ending at an uninstrumented worker hides where a late or failed data handoff occurred.
  • Design probe: Instrument RED/USE or data SLO metrics, keep label sets bounded, use trace IDs across logs/jobs, configure multi-window burn-rate or sustained alerts, and route actionable ownership with runbooks and maintenance suppression.

Benchmarks & rules of thumb

Cardinality -
bounded labels, never query/user IDs in Prometheus labels
Alert burn rate -
SLO error budget consumption over fast/slow windows
Trace coverage -
critical pipeline hops emit linked spans or run IDs

Common mistakes & follow-ups

Common interview mistakes

  • High-cardinality labels can bankrupt Prometheus storage, every batch warning can page an on-call engineer, and a trace ending at an uninstrumented worker hides where a late or failed data handoff occurred.
  • Reporting success from a job exit code without checking Cardinality and Alert burn rate.
  • Treating this example as complete without replay, rollback, or access boundaries: A Spark/Flink job exports records_processed_total, queue/event age, checkpoint duration, and error counters with low-cardinality pipeline/region; OTel trace run_id links source fetch, warehouse MERGE, and publish API logs.

Likely interviewer follow-ups

  • How would you prove this contract instead of only checking that the command ran: A pull-oriented metrics model and query language for time-series samples, recording rules, and alert conditions.
  • What does the recovery plan do when this occurs? High-cardinality labels can bankrupt Prometheus storage, every batch warning can page an on-call engineer, and a trace ending at an uninstrumented worker hides where a late or failed data handoff occurred.
  • When is Prometheus insufficient for Alert burn rate, and what does adding Grafana cost in Cardinality?
Interview tip: Lead with the data path and failure boundary: Prometheus scrapes time-series metrics, Grafana visualizes and routes alerts, and OpenTelemetry standardizes traces, metrics, logs, and semantic resource/trace attributes for correlated infrastructure and pipeline views. Then make the answer operational: Instrument RED/USE or data SLO metrics, keep label sets bounded, use trace IDs across logs/jobs, configure multi-window burn-rate or sustained alerts, and route actionable ownership with runbooks and maintenance suppression.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Monitoring & Alerting for Data Infrastructure (Prometheus, Grafana, OpenTelemetry) with data engineer interview Q&A and hands-on practice.

Open Data Engineer Q&A →Machine Learning Q&A
Previous topic
Infrastructure as Code (IaC) for Data Platforms with Terraform
Next topic
Cost Optimization & Cloud FinOps for Data Pipelines