⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All Observability & Monitoring Interview Questions Scenario 99 of 116 in Observability & Monitoring
Mid-Level DevOps / SRE (2–4 Years) Observability Grafana & Observability Integration Drill
🎯 Target Role / Context: Observability Domain · Grafana Interview Questions (2–4 Years DevOps Engineer)

Q: How do you integrate multiple data sources in Grafana? How do you query metrics, logs, and traces inside the same dashboard panel or correlate them during triage?

Integrate multiple data sources in Grafana using Mixed datasources, transformations, and correlated metric-to-log drill-downs.

#Grafana #Observability #Data Sources #Prometheus #Elasticsearch #2-4 Years
🎙️ Candidate Opening & Architectural Context
"Modern observability stacks combine disparate telemetry tools: Prometheus for numerical metrics, Loki or Elasticsearch for logs, and Tempo for distributed traces. Integrating multiple data sources in Grafana allows engineers to register distinct backends, combine them in a single visualization using the special Mixed data source, and correlate them dynamically using Data Links."
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? The Linux Foundation's Prometheus Certified Associate (PCA) & Monitoring Labs covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: Modern observability stacks combine disparate telemetry tools: Prometheus for numerical metrics, Loki or Elasticsearch for logs, and Tempo for distributed traces. Integrating multiple data sources in Grafana allows engineers to register distinct backends, combine them in a single visualization using the special Mixed data source, and correlate them dynamically using Data Links.

1️⃣

Provision Data Sources via Code

Configure connections declaratively using YAML manifests placed in the provisioning directory rather than manual UI clicks.

# /etc/grafana/provisioning/datasources/datasources.yaml
apiVersion: 1
datasources:
  - name: Prometheus-Production
    type: prometheus
    access: proxy
    url: http://prometheus-k8s.monitoring.svc:9090
    isDefault: true
    jsonData:
      timeInterval: "15s"
  - name: Loki-Production
    type: loki
    access: proxy
    url: http://loki-gateway.logging.svc:3100
  • Provisioning Files: Place YAML definitions inside /etc/grafana/provisioning/datasources/.
  • Default Flags: Mark one data source as default, set the access mode to proxy, and inject credentials via environment variables.
  • Correlation Config: Link trace providers directly to log providers by configuring derived fields inside the data source definition.
2️⃣

Query Multiple Data Sources in Grafana via Mixed Datasource

Combine series from different backends in a single graph panel using the built-in Mixed data source option.

  • Select Mixed: In the panel query editor, set the data source dropdown to -- Mixed -- to query multiple data sources in Grafana simultaneously.
  • Query A: Fetch CPU utilization from Prometheus using PromQL.
  • Query B: Fetch system error count from Elasticsearch or CloudWatch using their native query syntax.
  • Unified Time Axis: Grafana synchronizes both series onto a shared chronological X-axis, enabling instant visual correlation between metric spikes and log errors.
Advertisement
3️⃣

Correlate with Data Links & Transformations

Connect metrics to logs and traces without manual copy-pasting of timestamps or hostnames.

  • Data Links: Configure panel data links that construct URLs pointing directly to Loki or Tempo, automatically passing ${__data.fields.service} and current time bounds from=${__from}&to=${__to}.
  • Transformations: Apply Join by field or Merge transformations to merge tabular data from a SQL database with Kubernetes pod health metrics.
Pro Tip: In interview discussions, explain how Data Links transform isolated dashboards into an interconnected observability graph.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Integrate multiple data sources in Grafana using GitOps YAML provisioning, the Mixed datasource for single-panel comparison, and Data Links for metric-to-log correlation."
⚡ 60-Second Elevator Pitch Talking Points
  • Provision data sources as code using YAML files inside Grafana provisioning directories.
  • Use the built-in Mixed data source to query Prometheus metrics and Loki logs within the same graph panel.
  • Configure Data Links on metric panels to open exact log lines or trace IDs in Loki or Tempo preserving timestamp filters.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Configuring all production data sources manually through the Grafana web UI Manual UI configs lead to configuration drift, cannot be peer-reviewed in Git, and break disaster recovery restores.
  2. Using Direct access mode instead of Server (Proxy) mode for internal data sources Direct mode forces end-user client browsers to establish network connections directly to internal TSDB endpoints, leaking infrastructure topologies.
  3. Attempting to perform massive SQL joins across two different TSDBs client-side in Grafana Heavy browser-side transformations freeze the client DOM; aggregate data in the source TSDB whenever possible.
Advertisement
Want more Observability & Monitoring scenarios?
Explore our complete collection of scenario-based Observability & Monitoring interview runbooks.
Browse All Observability & Monitoring Questions →