Beginner Level
This section covers fundamental monitoring and logging concepts commonly asked in entry-level interviews.
Monitoring Fundamentals
What is monitoring, and why is it essential in DevOps?
Monitoring is the continuous collection and analysis of data about your systems' health and behavior — so you detect problems before your users do and can diagnose them when they occur.
The two jobs it does:
- Detection/alerting — something is wrong now (error rate spiking, service down) → page a human
- Diagnosis/analysis — why is it wrong, and what changed? → dashboards, logs, trends for humans to investigate
Without monitoring, deployments are blind: you ship a change and learn whether it works from a user complaint or a tweet. With it, releases verify themselves — which is what makes CI/CD's high deployment frequency safe.
What is the difference between metrics, logs, and traces?
The three data types (the "three pillars" of observability), each answering a different question:
- Metrics — numeric measurements over time (CPU %, request rate, p95 latency). Cheap to store, ideal for dashboards and alerts; answer "what" is wrong and "how much"
- Logs — discrete text/JSON records of events with detail; answer "why" something went wrong
- Traces — one request's journey across services (spans with timing); answer "where" in a distributed chain the problem is
A practical debugging flow that ties them together: an alert on a metric (error rate up) → the trace shows which service/dependency broke → the logs of that service contain the exception. Modern stacks connect the three via trace IDs — worth mentioning by name.
What are the four golden signals of monitoring?
Google's SRE framework for the four metrics that matter most for user-facing services:
- Latency — how long requests take (watch failed requests' latency separately from successful ones)
- Traffic — how much demand the service handles (requests/sec, connections)
- Errors — the rate of failed requests (explicit failures and implicit ones like wrong content)
- Saturation — how "full" your service is (memory, connections, queue depth)
Why they matter: they're user-facing symptoms, not internal trivia — alerting on these catches real problems, while alerting on everything produces noise. They also map directly onto the RED method (Rate, Errors, Duration) used for services and the USE method (Utilization, Saturation, Errors) used for resources.
Prometheus Questions
What is Prometheus, and why is it the Kubernetes-era standard?
Prometheus is an open-source monitoring and alerting toolkit: it collects time-series metrics from targets, stores them in a built-in time-series database, and evaluates alert rules against them.
Why it won for cloud-native:
- Pull-based scraping — targets expose metrics at
/metrics; Prometheus fetches on a schedule (simple to reason about, and a target being down is itself visible:up == 0) - PromQL — a powerful query language for aggregation and math over time series
- Multi-dimensional data model — every metric carries key-value labels (
http_requests_total{service="api", status="500"}), so one metric name answers many questions - Kubernetes-native — service discovery finds pods automatically; it's the de facto standard in the K8s ecosystem
- Pull-based scraping — targets expose metrics at
How does Prometheus collect metrics?
Prometheus pulls metrics over HTTP from target endpoints on a scrape interval (default 15s), with targets defined statically or discovered dynamically:
yamlEach scraped sample is stored with its labels as a time series. A failed scrape sets that target's
upmetric to 0 — so even a dead target produces meaningful data. The pull model's consequence to know: short-lived jobs (batch, cron) may finish between scrapes — that's what the Pushgateway exists for.What is PromQL, and what do the common queries look like?
PromQL is Prometheus's query language — instant vectors (now) and range vectors (over time) with rich operators. The starter set:
textTwo rules that trip up beginners: always
rate()counters (they only ever go up — the rate is what's meaningful), and aggregatebylabels before comparing, or you'll mix series from different instances.What are Prometheus exporters?
Exporters translate a system's internal state into Prometheus-format metrics on a
/metricsendpoint. The common set to know:- Node Exporter — host hardware/OS metrics (CPU, memory, disk, network) — one per node
- kube-state-metrics — Kubernetes object state (pod/deployment/replica counts, statuses)
- cAdvisor — container-level CPU/memory
- Blackbox Exporter — probes endpoints from outside (HTTP/TCP/ICMP checks — synthetic monitoring)
- Database exporters — mysqld_exporter, postgres_exporter, redis_exporter
- Your own app — client libraries (Go/Java/Python) expose custom counters, gauges, histograms
The pattern: exporters are the bridge between "anything that has state" and Prometheus's pull model — and for anything without an exporter, the client libraries make your application first-party-instrumented, which beats any external monitor.
How do alerts work in Prometheus (Alertmanager)?
Alert rules live in Prometheus (they evaluate PromQL); Alertmanager handles what happens after — deduplication, grouping, silencing, and routing to real humans:
yamlConcepts to know:
for:filters flapping (transient blips don't page), labels route alerts (severity: critical→ PagerDuty,warning→ Slack),group_bycollapses related alerts into one notification, and silences mute known-noisy alerts during maintenance. The design principle: alerts should be actionable and symptom-based — an alert a human can't act on trains them to ignore alerts.
Grafana Questions
What is Grafana?
Grafana is the visualization and dashboarding layer of most monitoring stacks: it queries data sources (Prometheus, Loki, Elasticsearch, CloudWatch, SQL databases) and renders them as dashboards — time-series graphs, stat tiles, tables, heatmaps.
Why it became universal: it's data-source agnostic (one UI for metrics and logs from different systems), dashboards are JSON (versionable, shareable, importable from community libraries), and it includes its own alerting and annotation layer. In a Prometheus stack, the division of labor: Prometheus stores and evaluates alerts; Grafana visualizes and lets humans explore.
How do you connect Grafana to Prometheus, and manage dashboards as code?
Connecting takes one data source definition:
- Grafana → Connections → Data sources → Add data source → Prometheus
- Set the URL (
http://prometheus:9090from inside the cluster/network) - Save & Test
The DevOps practice is to skip manual clicking entirely — provision everything as code:
yamlDashboards load the same way (provisioning files or
grafana-dashboardCRDs via the Grafana Operator) or export/import as JSON checked into Git — so dashboards are reviewed, versioned, and recreated automatically on a fresh cluster instead of living only in someone's browser.What are Grafana variables (templating), and why do they matter?
Template variables make one dashboard serve many contexts — instead of hardcoding a service name, a dropdown selects it:
text$servicebecomes a dropdown fed by a query (label_values(http_requests_total, job)) or a custom list- Multi-value variables (
All, multi-select) let one row compare several services - Repeat panels/rows generate one panel per selected value
Why it matters: variables turn dashboard sprawl into maintainable dashboards — one parameterized dashboard per service type instead of 40 hand-copied ones. Also worth knowing: dashboard JSON with variables checks into Git like everything else.
ELK Stack Questions
What is the ELK stack?
ELK is the classic centralized-logging stack:
- Elasticsearch — the distributed search/analytics engine where logs are stored and queried (full-text search, aggregations)
- Logstash — the processing pipeline: collect → parse/transform → route
- Kibana — the UI: search logs, build dashboards, set alerts
The modern additions to know: Beats (lightweight shipper agents — Filebeat for log files, Metricbeat for metrics) feeding Logstash/Elasticsearch directly — the stack is often called the "Elastic Stack" now; and Loki as the Kubernetes-cost-conscious alternative (see intermediate). The flow to describe: app/file → Filebeat → Logstash (parse, enrich) → Elasticsearch (index) → Kibana (search/dashboard).
How does Logstash process logs?
Every Logstash pipeline has three stages — input → filter → output:
ruby- Inputs — beats, files, Kafka, syslog, HTTP
- Filters — grok (pattern parsing — the signature Logstash tool), json, mutate (rename/remove/coerce), geoip
- Outputs — elasticsearch, files, Kafka, dead-letter queues for failed events
The best practice to state: prefer structured logs at the source (apps emit JSON) — then Logstash's job shrinks to routing and enrichment, and fragile grok patterns mostly disappear.
What is Kibana used for?
Kibana is the exploration and visualization UI over Elasticsearch data:
- Discover — free-text and field-filtered search over raw logs (the incident-debugging workhorse: "show me all ERROR lines from service X in the last 15 minutes")
- Dashboards — visualizations over log data: error-rate time series, top-N tables, heatmaps
- Alerts — log-based alert rules (threshold or anomaly)
- Plus deeper tooling: Lens (drag-and-drop visualizations), runtime fields, and ML-based anomaly detection
The tie-in interviewers like: Kibana queries use the index's field mappings — which is why structured (JSON) logging with consistent field names (
service,level,trace_id) makes Kibana dramatically more useful than free-text logs.How do you deploy the ELK stack, and what does it cost to run?
Deployment options, simplest to production-grade:
- Docker Compose — three containers for learning/local dev
- Kubernetes — Elastic Cloud on Kubernetes (ECK) operator or Helm charts; Filebeat as a DaemonSet on every node
- Managed — Elastic Cloud (official SaaS) — removes the operational burden of Elasticsearch clusters
bashThe cost reality worth knowing: Elasticsearch indexes every token of every log — that full-text index is typically the biggest cost and resource consumer in the stack. It's why capacity planning (index size, shard count, retention) is the main ELK operational skill, and why cheaper alternatives (Loki) exist for teams that only need label-based log lookup rather than full-text search.
Contribute & Stay Updated
Want to contribute? We welcome contributions! If you have insights, new tools, or improvements, feel free to submit a pull request.
How to Contribute?
- Read the CONTRIBUTING.md guide.
- Fix errors, add missing topics, or suggest improvements.
- Submit a pull request with your updates.
Community & Support
GitHub: @NotHarshhaa Blog: ProDevOpsGuy Telegram Community: Join Here