Skip to main content
You’ve just deployed your application.
  • Test cases were passing.
  • The deployment pipeline succeeded.
  • Pods are running, and everything you can see looks good.
The next morning, though, product managers are pinging you: customers say the app is slow and some orders aren’t going through. How long has this been happening? You have no idea. You check the pods:
You dig through logs and see a mix of success and error messages:
You restart things and cross your fingers. This is what operating without observability looks like: you’re effectively blind until someone tells you something’s wrong, and then you’re stuck guessing. You don’t know whether the problem started one hour ago or three days ago. You don’t know whether it affects 1% or 90% of users.
A diagram showing two rounded boxes labeled "Operating" and "Observability" connected by an arrow with a small error marker between them. Below is a muted eye icon surrounded by question marks and text like "One hour ago...", "Three days ago..." and "1% users," indicating missing or unclear observability.
You’re reactive instead of proactive. Metrics solve this problem — but what exactly is a metric? A metric is a numeric measurement describing some aspect of your system at a specific point in time. Practically, a metric is a number paired with a timestamp. Collected repeatedly, metrics become time series that reveal trends, spikes, and regressions. Examples:
  • Your backend handled 247 requests per second over the past minute — that’s a metric.
  • A pod is using 512 MB of memory right now — that’s a metric.
  • The average response time of an endpoint is 85 ms — that’s a metric.
A metric is essentially a timestamped number. Collected repeatedly, it becomes a time series that shows how the value changes over time.
Why metrics matter
  • Continuous collection (every 15s / 30s / 1m) turns single readings into time series.
  • Time series make it easy to spot trends and anomalies: the x-axis is time and the y-axis is the metric value.
  • Metrics are fast to query and are ideal for threshold-based alerting (e.g., error rate > 5%).
  • Logs provide rich context and the “why”; metrics provide the quantitative “what” and “when”.
Metrics vs. Logs vs. Traces (short)
  • Metrics: numeric, compact, performant for historical trend queries and alerts.
  • Logs: verbose, unstructured or semi-structured, good for root-cause and detailed investigation.
  • Traces: distributed request-level context to follow a single transaction across services.
Table — Common metric types and use cases Prometheus and Grafana: the basics
  • Prometheus collects and stores metrics as time series. It typically scrapes metrics from application endpoints (for example, http://app:9090/metrics) on a configurable interval, timestamps each value, and stores the history for queries and alerts.
  • Grafana is the visualization and alerting layer that queries Prometheus and renders dashboards and alerts humans can read.
A diagram titled "Metrics Storage and Visualization" showing Prometheus (collecting from Jobs/Exporters) feeding metrics and Grafana for visualization, alongside a sample timestamped table of two time series. The image includes Prometheus and Grafana logos and example metric rows.
How they work together
  • Instrumentation: your app exposes metric endpoints (counters, gauges, histograms).
  • Collection: Prometheus scrapes those endpoints and stores time series.
  • Querying: Grafana issues queries to Prometheus to build charts and dashboards.
  • Alerting: define alert rules in Prometheus (or Grafana) to notify when metrics cross thresholds.
A simple diagram titled "Grafana Overview" showing the Grafana logo on the left and the Prometheus logo on the right. An arrow labeled "Query Prometheus" points from Grafana to Prometheus, indicating Grafana queries Prometheus for metrics.
Practical advice and next steps
  • Instrument: add counters, gauges, and histograms to important services (latency, error rate, throughput, resource usage).
  • Scrape: expose a /metrics endpoint and configure Prometheus to scrape it at sensible intervals.
  • Visualize: build Grafana dashboards for critical flows (checkout, auth, dependencies).
  • Alert: create alerts for actionable conditions (e.g., 5xx rate spike, latency degradation, resource exhaustion).
  • Correlate: use logs and traces to investigate alerts raised by metrics — metrics tell you where and when; logs and traces tell you why.
Quick commands
Metrics give you visibility into system behavior but are often aggregated. Use metrics to detect and alert on problems, and correlate with logs/traces to investigate root causes. Don’t rely on one signal alone.
Try it yourself To experience metrics, set up a small test stack:
  1. Instrument a sample service (Prometheus client libraries are available for most languages).
  2. Run Prometheus and configure a scrape target for your service.
  3. Add Grafana and create a dashboard that queries Prometheus.
  4. Introduce a controlled fault (increase latency or error rate) and observe how metrics capture the change.
Links and references

Watch Video

Practice Lab