Skip to main content

Observability with prometheus (Introduction)

Introduction to Prometheus: Simplifying System Monitoring

Prometheus is a powerful open-source tool for monitoring and alerting systems. Created in 2012 at SoundCloud, it has been widely adopted by companies worldwide and boasts an active community of developers and users. In 2016, Prometheus became part of the Cloud Native Computing Foundation, alongside Kubernetes.


What is Prometheus?

Prometheus collects data as time series, meaning numerical metrics are stored with timestamps. For example, a web server could track request times or the number of active connections. These metrics can include labels (key-value pairs) to add context.

Example:
If your web application is running slow, Prometheus can provide insights. For instance, it might reveal a spike in request numbers, helping you identify the issue and add resources to handle the load.


Key Features

  • Multi-dimensional data model: Metrics are identified by name and key-value pairs.
  • PromQL: A powerful query language for analyzing metrics.
  • Standalone operation: Prometheus servers don’t depend on distributed storage.
  • Pull-based collection: Metrics are fetched via HTTP, with optional support for push via a gateway.
  • Service discovery: Automatically finds targets or uses static configuration.
  • Visualization: Integrates with tools like Grafana for detailed dashboards.

Core Components of Prometheus

Prometheus is modular and includes several components:

  1. Prometheus server: Collects and stores time series data.
  2. Client libraries: Instrument your applications for custom metrics.
  3. Push Gateway: Handles data from short-lived jobs.
  4. Exporters: Connects Prometheus to services like HAProxy or StatsD.
  5. Alertmanager: Manages alerting rules and notifications.
  6. Support tools: Additional utilities to enhance functionality.

How Does Prometheus Work?

  • Prometheus scrapes metrics from instrumented applications or a push gateway.
  • It stores the collected data locally on the Prometheus server.
  • Rules can aggregate data or create alerts based on thresholds.
  • Tools like Grafana allow you to visualize the data.

When Should You Use Prometheus?

Prometheus is ideal for:

  • Monitoring numerical metrics like CPU usage, request rates, or memory consumption.
  • Dynamic architectures such as microservices.
  • Diagnosing issues during outages, thanks to its reliable and independent nature.

When Not to Use Prometheus

If you require absolute precision (e.g., per-request billing), Prometheus is not the best option. It prioritizes reliability over 100% accuracy and works best as a general monitoring solution rather than a billing tool.


Conclusion

Prometheus is an essential tool for modern system monitoring, offering simplicity, reliability, and scalability. Its ability to provide insights into metrics makes it invaluable for dynamic infrastructures like microservices. While it excels in general monitoring, for specific needs like precise billing, it’s better to complement Prometheus with other tools.


Comments

Popular posts from this blog

FastAPI Instrumentalisation with prometheus and grafana Part1 [Counter]

welcome to this hands-on lab on API instrumentation using Prometheus and FastAPI! In the world of modern software development, real-time API monitoring is essential for understanding usage patterns, debugging issues, and ensuring optimal performance. In this lab, we’ll demonstrate how to enhance a FastAPI-based application with Prometheus metrics to monitor its behavior effectively. We’ve already set up the lab environment for you, complete with Grafana, Prometheus, and a PostgreSQL database. While FastAPI’s integration with databases is outside the scope of this lab, our focus will be entirely on instrumentation and monitoring. For those interested in exploring the database integration or testing , you can review the code in our repository: FastAPI Monitoring Repository . What You’ll Learn In this lab, we’ll walk you through: Setting up Prometheus metrics in a FastAPI application. Instrumenting API endpoints to track: Number of requests HTTP methods Request paths Using Grafana to vi...

ExternalDNS on Kubernetes - mirecloud homelab part 4

MireCloud Home Lab · DevOps ExternalDNS on Kubernetes Automatic Sync with BIND via RFC2136 How to fully automate DNS management in a bare-metal Kubernetes homelab using Cilium, BIND, and HashiCorp Vault. 📅 February 22, 2026 ⏱ ~10 min read 🔧 ExternalDNS v0.20.0 ☸ Kubernetes v1.34 Kubernetes v1.34 ExternalDNS v0.20.0 Cilium Gateway API BIND (RFC2136) TSIG / HMAC-SHA256 HashiCorp Vault External Secrets Operator ArgoCD (GitOps) cert-manager When you run a Kubernetes homelab with multiple exposed services — Grafana, Keycloak, ArgoCD, PgAdmin — you quickly find yourself maintaining DNS entries in BIND manually . It's repetitive, prone to errors, and breaks the GitOps flow. The solution is ExternalDNS . This controller monitors your Services, Ingresses, and HTTPRoutes in real-time, automatically pushing DNS updates to BIND as soon as a route is created. No mo...

Introducing my homeLab Part 1

MireCloud Series — Part 1 I Was kubectl apply -ing Everything. Here's How I Stopped. Building MireCloud — the right way, from the ground up. EC Emmanuel Catin Senior Platform Engineer · CKA Vault ESO cert-manager ArgoCD Cilium I have a confession. For months, my homelab was held together with notes, memory, and hope. Keycloak was running. Grafana was up. GitLab was accessible. But if you asked me why something worked, half the time the honest answer was: "because I ran some commands six weeks ago and I haven't touched it since." Passwords lived in a notes file. Certificates were generated once with OpenSSL and forgotten until they expired. Secrets were committed to Git — sometimes as plaintext, sometimes base64-encoded, which is the same thing with extra steps. Every rebuild started ...