Home Interview Prometheus and Grafana Interview Questions: Complete Guide
Intermediate 3 min · July 13, 2026

Prometheus and Grafana Interview Questions: Complete Guide

Master Prometheus and Grafana interview questions with this comprehensive guide covering architecture, queries, alerts, and production debugging scenarios for DevOps roles..

N
Naren Founder & Principal Engineer

20+ years shipping production code across the stack, with years spent interviewing engineers. Drawn from code that ran under real load.

Follow
Production
production tested
July 13, 2026
last updated
2,165
articles · all by Naren
Before you start⏱ 15-20 min read
  • Basic understanding of monitoring concepts (metrics, alerts).
  • Familiarity with Linux command line and YAML configuration.
  • Basic knowledge of HTTP and REST APIs.
  • Experience with container orchestration (Kubernetes) is helpful but not required.
 ● Production Incident 🔎 Debug Guide ⚙ Triage Commands
Quick Answer
  • Prometheus is a time-series monitoring system that scrapes metrics from targets via HTTP.
  • Grafana is a visualization tool that can use Prometheus as a data source.
  • PromQL is the query language for extracting and aggregating metrics.
  • Common interview topics include metric types, alerting rules, and service discovery.
  • Production issues often involve high cardinality, missing metrics, and alert fatigue.
✦ Definition~90s read
What is Prometheus and Grafana Interview Questions?

Prometheus is an open-source systems monitoring and alerting toolkit that collects metrics from configured targets at given intervals, evaluates rule expressions, and can trigger alerts. Grafana is an open-source analytics and interactive visualization web application that provides charts, graphs, and alerts when connected to supported data sources like Prometheus.

Imagine you're a building manager.
Plain-English First

Imagine you're a building manager. Prometheus is like a security guard who walks around every few minutes checking temperature, humidity, and occupancy in each room. He writes down all the numbers in a logbook. Grafana is like a dashboard of gauges and charts that show you the current status and trends. If a room gets too hot, Prometheus can alert you. In an interview, they'll ask how you set up the guard's route, what instruments you use, and how you handle false alarms.

In the world of DevOps, monitoring is the eyes and ears of your infrastructure. Prometheus and Grafana have become the de facto standard for open-source monitoring and visualization. Whether you're preparing for a senior DevOps role or a platform engineering position, expect deep questions on how these tools work under the hood. This guide covers real interview questions, from basic concepts to advanced production scenarios. You'll learn about Prometheus architecture, metric types, PromQL queries, alerting rules, and how to debug common issues. We'll also explore a real-world production incident where a misconfigured Prometheus caused a major outage. By the end, you'll be equipped to answer confidently and demonstrate hands-on experience. Let's dive into the world of time-series monitoring and turn you into a Prometheus and Grafana expert.

Prometheus Architecture and Core Concepts

Prometheus follows a pull-based model: it scrapes metrics from HTTP endpoints (targets) at regular intervals. The core components include the Prometheus server (which scrapes and stores data), Alertmanager (for handling alerts), and various exporters (like node_exporter for system metrics). Metrics are stored in a time-series database (TSDB) with labels (key-value pairs). Understanding the architecture is crucial for interview questions about scalability, storage, and reliability. For example, you might be asked: 'How does Prometheus handle high availability?' The answer involves running multiple instances with identical scrape configs and using a load balancer in front of Grafana. Another common question: 'What is the difference between push and pull models?' Prometheus pulls, which makes it easier to detect down targets, but requires network access to all targets. Push models (like Graphite) are better for short-lived jobs. In interviews, emphasize the trade-offs and when to use each.

prometheus.ymlYAML
1
2
3
4
5
6
7
8
9
10
11
12
13
global:
  scrape_interval: 15s
scrape_configs:
  - job_name: 'node'
    static_configs:
      - targets: ['localhost:9100']
  - job_name: 'api'
    kubernetes_sd_configs:
      - role: pod
    relabel_configs:
      - source_labels: [__meta_kubernetes_pod_label_app]
        regex: my-api
        action: keep
💡Interview Tip
📊 Production Insight
In production, always set up a separate Prometheus for each region or cluster to avoid single points of failure.
🎯 Key Takeaway
Prometheus pulls metrics from targets; understanding its architecture helps answer scalability and reliability questions.

Metric Types: Counter, Gauge, Histogram, Summary

Prometheus supports four core metric types. Counters are cumulative (only increase, reset on restart) – used for request counts. Gauges can go up and down – used for memory usage. Histograms sample observations and count them in configurable buckets – used for request durations. Summaries also sample observations but calculate quantiles on the client side. Interviewers often ask: 'When would you use a histogram vs a summary?' The answer: Histograms allow aggregation across instances (since buckets are additive), while summaries are better when you need precise quantiles but cannot aggregate. Another question: 'How do you reset a counter?' You can't; counters are monotonic. Use the rate() function to get per-second increase. Example: rate(http_requests_total[5m]) gives requests per second over the last 5 minutes. Understanding these types is fundamental to writing correct PromQL queries.

metrics.goGO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Counter example
httpRequestsTotal := prometheus.NewCounter(prometheus.CounterOpts{
    Name: "http_requests_total",
    Help: "Total number of HTTP requests.",
})

// Gauge example
memoryUsage := prometheus.NewGauge(prometheus.GaugeOpts{
    Name: "memory_usage_bytes",
    Help: "Current memory usage in bytes.",
})

// Histogram example
requestDuration := prometheus.NewHistogram(prometheus.HistogramOpts{
    Name:    "request_duration_seconds",
    Help:    "Histogram of request durations.",
    Buckets: prometheus.DefBuckets,
})
🔥Common Interview Question
📊 Production Insight
Avoid using summaries for high-cardinality dimensions because they cannot be aggregated across instances.
🎯 Key Takeaway
Know the four metric types and their use cases; be ready to explain histogram vs summary trade-offs.

PromQL: Querying and Aggregation

PromQL is the query language for Prometheus. Interview questions often involve writing queries to compute rates, averages, percentiles, and more. For example: 'Write a query to get the average CPU usage per node over the last hour.' Answer: avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[1h])). Another common question: 'How do you get the top 5 memory-consuming processes?' Use topk(5, process_resident_memory_bytes). Understanding vector matching is critical: binary operators (like /) require matching label sets. You can use on() or ignoring() to control matching. Also know about recording rules: they precompute expensive queries and store them as new time series. Example: record: job:http_requests:rate5m with expr: rate(http_requests_total[5m]). In interviews, demonstrate that you can write efficient queries and understand the difference between instant vectors and range vectors.

promql_examples.txtTEXT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Rate of HTTP requests per second
rate(http_requests_total[5m])

# 95th percentile of request duration
histogram_quantile(0.95, sum(rate(request_duration_seconds_bucket[5m])) by (le))

# Average memory usage by service
avg by (service) (process_resident_memory_bytes)

# Top 3 CPU-consuming containers
topk(3, rate(container_cpu_usage_seconds_total[5m]))

# Alert if error rate > 5%
rate(http_requests_total{status=~"5.."}[5m]) / rate(http_requests_total[5m]) > 0.05
⚠ Performance Pitfall
📊 Production Insight
Always use rate() instead of irate() for alerting because rate() smooths out spikes.
🎯 Key Takeaway
PromQL is the heart of Prometheus; practice writing queries for common scenarios like rates, percentiles, and top-k.

Alerting Rules and Alertmanager

Prometheus alerting rules define conditions that trigger alerts. They are evaluated periodically. When an alert fires, Prometheus sends it to Alertmanager, which handles deduplication, grouping, routing, and silencing. Interview questions: 'How do you set up an alert for high CPU usage?' Rule: alert: HighCPUUsage expr: rate(node_cpu_seconds_total{mode="idle"}[5m]) < 0.2 for: 5m labels: severity: critical annotations: summary: "CPU usage > 80% on {{ $labels.instance }}". Another question: 'How does Alertmanager group alerts?' Grouping uses labels; you can group by severity or service to reduce notification noise. Also know about inhibition rules (suppress lower-severity alerts when higher-severity fires) and silences (mute alerts for a specific time). In production, alert fatigue is a common problem; discuss how to tune thresholds, use for: duration, and implement proper routing.

alert_rules.ymlYAML
1
2
3
4
5
6
7
8
9
10
11
groups:
  - name: example
    rules:
      - alert: HighErrorRate
        expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.1
        for: 1m
        labels:
          severity: critical
        annotations:
          summary: "High error rate on {{ $labels.instance }}"
          description: "Error rate is {{ $value | humanizePercentage }}"
💡Interview Tip
📊 Production Insight
Always test alert rules with promtool check rules to avoid syntax errors that cause silent failures.
🎯 Key Takeaway
Alerting rules define conditions; Alertmanager handles notification delivery and deduplication.

Grafana: Dashboards and Data Sources

Grafana is the visualization layer that connects to Prometheus and other data sources. Interview questions: 'How do you create a dashboard that shows CPU usage per host?' Add a panel with PromQL query: 100 - (avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100). Use variables (e.g., $instance) to make dashboards dynamic. Another common question: 'How do you handle time zone differences?' Grafana displays in browser time zone by default; you can override in dashboard settings. Also know about annotations (mark events on graphs), alerting in Grafana (though Prometheus alerts are preferred), and provisioning (dashboards as code via JSON or YAML). In interviews, emphasize your ability to create meaningful dashboards that reduce mean time to detection (MTTD).

dashboard.jsonJSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
  "title": "Node Exporter Dashboard",
  "panels": [
    {
      "title": "CPU Usage",
      "type": "graph",
      "targets": [
        {
          "expr": "100 - (avg by (instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)",
          "legendFormat": "{{ instance }}"
        }
      ]
    }
  ]
}
🔥Common Interview Question
📊 Production Insight
Use Grafana's Explore mode for ad-hoc querying before adding panels to dashboards.
🎯 Key Takeaway
Grafana turns Prometheus data into actionable visualizations; dynamic dashboards with variables are key.

Service Discovery and Relabeling

In dynamic environments like Kubernetes, Prometheus uses service discovery to find targets. Relabeling allows you to modify labels before ingestion. Interview questions: 'How does Prometheus discover pods in Kubernetes?' It uses the Kubernetes API to list pods and endpoints. Relabeling can filter targets (e.g., only pods with a certain label) or rewrite metric labels. Example: relabel_configs to keep only pods with app=my-api. Another question: 'What is the difference between relabeling and metric relabeling?' Target relabeling happens before scrape, affecting target labels; metric relabeling happens after scrape, affecting metric labels. Understanding relabeling is essential for managing label cardinality and ensuring correct metric naming. In interviews, show that you can configure service discovery for different environments (static, file-based, cloud).

relabel_config.ymlYAML
1
2
3
4
5
6
7
8
9
10
11
scrape_configs:
  - job_name: 'kubernetes-pods'
    kubernetes_sd_configs:
      - role: pod
    relabel_configs:
      - source_labels: [__meta_kubernetes_pod_label_app]
        regex: my-app
        action: keep
      - source_labels: [__meta_kubernetes_pod_node_name]
        target_label: node
        action: replace
⚠ Common Mistake
📊 Production Insight
Always use __meta_ labels to enrich metrics with useful information like node name or region.
🎯 Key Takeaway
Service discovery and relabeling are crucial for monitoring dynamic infrastructure; master relabeling to control label cardinality.

Storage, Retention, and High Availability

Prometheus's TSDB stores data in blocks (2-hour chunks) with configurable retention. Interview questions: 'How do you handle long-term storage?' Use remote write to send data to long-term storage like Thanos or Cortex. 'How do you achieve high availability?' Run multiple Prometheus servers scraping the same targets, and use a load balancer in front of Grafana. However, this duplicates storage. For deduplication, use Thanos or Cortex. Another question: 'What is the default retention period?' 15 days. You can change it via --storage.tsdb.retention.time. Also know about compaction and downsampling (not natively supported; use Thanos for downsampling). In interviews, discuss trade-offs between cost and reliability, and mention that Prometheus is not designed for multi-datacenter setups without additional tools.

prometheus_flags.txtTEXT
1
2
3
4
--storage.tsdb.retention.time=30d
--storage.tsdb.retention.size=50GB
--storage.tsdb.path=/data/prometheus
--web.enable-admin-api
💡Interview Tip
📊 Production Insight
Set both time and size retention limits to avoid disk full issues.
🎯 Key Takeaway
Prometheus has limited retention; use remote write or Thanos for long-term storage and HA.
● Production incidentPOST-MORTEMseverity: high

The Cardinality Explosion That Took Down Prometheus

Symptom
Prometheus server became unresponsive, OOM-killed repeatedly. Dashboards showed no data for all services.
Assumption
The developer assumed that adding a unique label per request (like request_id) was harmless for debugging.
Root cause
High cardinality label (request_id) created millions of time series, exhausting memory and disk.
Fix
Removed high-cardinality labels from scraped metrics. Implemented label limits and used recording rules for aggregation.
Key lesson
  • Always limit label cardinality; avoid unique identifiers as labels.
  • Use recording rules to pre-aggregate high-cardinality data.
  • Set up alerts on series count and scrape failures.
  • Monitor Prometheus's own metrics (prometheus_tsdb_head_series).
  • Implement rate limiting on metric ingestion.
Production debug guideSymptom to Action4 entries
Symptom · 01
Grafana panels show 'No data'
Fix
Check Prometheus target status in /targets; verify data source URL and scrape config.
Symptom · 02
Prometheus OOM crashes
Fix
Check series count via prometheus_tsdb_head_series; identify high-cardinality metrics.
Symptom · 03
Alerts not firing
Fix
Verify alert rules syntax; check Alertmanager configuration and silences.
Symptom · 04
Slow PromQL queries
Fix
Use query_range with step; avoid large range vectors; use recording rules.
★ Quick Debug Cheat SheetCommon symptoms and immediate actions for Prometheus/Grafana issues.
No data in Grafana
Immediate action
Check Prometheus targets
Commands
curl http://prometheus:9090/api/v1/targets
Check prometheus.yml scrape_configs
Fix now
Ensure target endpoint is reachable and metrics path is correct.
High memory usage+
Immediate action
Identify high-cardinality metrics
Commands
top -b -n1 | grep prometheus
Check prometheus_tsdb_head_series
Fix now
Remove or aggregate high-cardinality labels.
Alerts not firing+
Immediate action
Check alert rules and Alertmanager
Commands
curl http://prometheus:9090/api/v1/rules
Check Alertmanager status
Fix now
Fix rule syntax or ensure Alertmanager is running.
FeaturePrometheusGrafana
Primary FunctionMetrics collection and storageVisualization and dashboards
Data SourceItself (scrapes targets)Multiple (Prometheus, InfluxDB, etc.)
Query LanguagePromQLSupports PromQL via data source
AlertingAlerting rules + AlertmanagerBuilt-in alerting (limited)
StorageLocal TSDB (limited retention)No storage; relies on data sources
High AvailabilityMultiple instances + Thanos/CortexStateless; can be load balanced
⚙ Quick Reference
6 commands from this guide
FileCommand / CodePurpose
prometheus.ymlglobal:Prometheus Architecture and Core Concepts
metrics.gohttpRequestsTotal := prometheus.NewCounter(prometheus.CounterOpts{Metric Types
promql_examples.txtrate(http_requests_total[5m])PromQL
alert_rules.ymlgroups:Alerting Rules and Alertmanager
dashboard.json{Grafana
relabel_config.ymlscrape_configs:Service Discovery and Relabeling

Key takeaways

1
Prometheus is a pull-based monitoring system with a powerful query language (PromQL).
2
Grafana provides visualization and alerting on top of Prometheus data.
3
High cardinality is a common production issue; always limit label values.
4
Use recording rules for expensive queries and Alertmanager for reliable alerting.
5
Service discovery and relabeling are essential for dynamic environments like Kubernetes.

Common mistakes to avoid

3 patterns
×

Using unique identifiers (e.g., request_id) as labels.

×

Using irate() instead of rate() for alerting.

×

Not setting up retention limits.

INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01JUNIOR
Explain how Prometheus scrapes metrics and what happens if a target is d...
Q02SENIOR
Write a PromQL query to get the 99th percentile of request latency over ...
Q03SENIOR
How would you design a monitoring system for a microservices architectur...
Q01 of 03JUNIOR

Explain how Prometheus scrapes metrics and what happens if a target is down.

ANSWER
Prometheus sends an HTTP GET request to the target's /metrics endpoint (configurable). If the target is down, the scrape fails and Prometheus records up=0 for that target. It continues to retry on subsequent scrape intervals. You can alert on up == 0.
FAQ · 5 QUESTIONS

Frequently Asked Questions

01
What is the difference between Prometheus and Grafana?
02
How do you handle high cardinality in Prometheus?
03
Can Prometheus push metrics?
04
What is the purpose of the Alertmanager?
05
How do you secure Prometheus endpoints?
N
Naren Founder & Principal Engineer

20+ years shipping production code across the stack, with years spent interviewing engineers. Drawn from code that ran under real load.

Follow
Verified
production tested
July 13, 2026
last updated
2,165
articles · all by Naren
🔥

That's DevOps Interview. Mark it forged?

3 min read · try the examples if you haven't

Previous
Terraform Interview Questions
7 / 9 · DevOps Interview
Next
Linux and SRE Interview Questions