We’ve made it our mission to provide you with the best (and only the best) tools to work with the cloud. That’s why our Top 10 CNCF projects to look out for in 2023 list is being untangled in our blog, explaining each technology and why we are die-hard fans of it. Take a look at the rest of the series!
Hundreds of microservices, with thousands of instances running at the same time, and your usual tools to monitor and control your applications are struggling to keep up. Does it sound familiar? The move towards a microservice architecture is not without its challenges, but the bright side is that you don’t have to face them alone.
Prometheus is a system monitoring and alerting system. It was open-sourced by SoundCloud in 2012 and is the second project both to join and to graduate within Cloud Native Computing Foundation after Kubernetes.
Prometheus? What is it?
Back in 2012, SoundCloud was in the same scenario we’ve described before: too many services running and no efficient way of monitoring them. What they needed was a system with the following features:
- A multi-dimensional data model, so that data can be sliced and diced at will, along dimensions like instance, service, endpoint, and method.
- Operational simplicity, so that you can spin up a monitoring server where and when you want, even on your local workstation, without setting up a distributed storage backend or reconfiguring the world.
- Scalable data collection and decentralized architecture, so that you can reliably monitor the many instances of your services, and independent teams can set up independent monitoring servers.
- Finally, a powerful query language that leverages the data model for meaningful alerting (including easy silencing) and graphing (for dashboards and for ad-hoc exploration).
With this in mind, what started (like all great ideas) as an ambitious pet project of a developer that aimed to combine all these features became Prometheus.
Prometheus stores all metrics data as time series: metrics information is stored along with the timestamp at which it was recorded, and optional key-value pairs called as labels can also be stored along with metrics.
Napptive enables developer self-service. We encourage you to try our playground and experience accelerated cloud-native development. It’s completely free, all you need to do is simply sign up and get started!
Prometheus’s main features are:
- a multi-dimensional data model with time series data identified by metric name and key/value pairs
- PromQL, a flexible query language to leverage this dimensionality
- no reliance on distributed storage; single server nodes are autonomous
- time series collection happens via a pull model over HTTP
- pushing time series is supported via an intermediary gateway
- targets are discovered via service discovery or static configuration
- multiple modes of graphing and dashboarding support
Components and architecture
The Prometheus ecosystem consists of multiple components, many of which are optional:
- the main Prometheus server which scrapes and stores time series data
- client libraries for instrumenting application code
- a push gateway for supporting short-lived jobs
- special-purpose exporters for services like HAProxy, StatsD, Graphite, etc.
- an alertmanager to handle alerts
- various support tools
Will all these components, a Prometheus deployment looks like this:
Implementation: Is it hard to get it to work?
Not at all! Prometheus can be implemented in several ways, including the download of a .tar.gz file from their site (where you can find an executable file), or even in Kubernetes through Helm.
There is a lot of documentation accessible on their site, including a “Getting started” tutorial and several guides on how to combine Prometheus with other tools and how to develop specific scenarios that will let you get the most of it. For example, there is a tutorial on how to visualize metrics using Grafana, which provides a step-by-step guide on how to install Grafana, how to integrate it with Prometheus, and how to make them work together to bring the best of both to the dev team.
Resources to use
Apart from the official documentation, there is a very active community surrounding the project. The project development is very horizontal and open, and their meetings are available for anyone who wants to participate, and so are the forums to troubleshoot problems with the system.
There is also a repository that works as a hub for resources, projects and tools related to Prometheus. It has everything, from tutorials to books to video lectures to other projects that work well together.
Prometheus and Napptive
If the problem is that you would in fact need to deploy a whole new architecture to be able to use Prometheus, you can also consider signing up at Napptive (which is free) and try an intuitive, effective platform for developing cloud-native apps with no previous knowledge of cloud architecture. Napptive collects its metrics with Prometheus and shows them in an easy-to-use, easy-to-understand interface that’s specifically tailored for developers in their early stages of cloud-native programming.
Success cases: Where can I see it in action?
Since its inception in 2012, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community. It is now a standalone open source project and maintained independently of any company. To emphasize this, and to clarify the project’s governance structure, Prometheus joined the Cloud Native Computing Foundation in 2016 as the second hosted project, after Kubernetes.
The CNCF gathers dozens of organizations that leverage Prometheus in their work, such as Uber, Adform or even the city of Montreal. This last case, the city of Montreal, is the perfect example of an architecture with several legacy systems isolated on different platforms. The project to move all these systems to the cloud and finally end their isolation involved Kubernetes, Helm and Prometheus, and has drastically improved the time to market, the deployment time, and the amount of resources that the city needs to run the municipal applications.
No matter how powerful your architecture is, power is useless without control. Prometheus offers the control you need with the best open-source systems monitoring and alerting toolkit, so you know what’s going on in your services and can react on time to unexpected situations.
In case you have not yet tried Napptive, we encourage you to sign up for free and discover how we are helping propel the development of cloud-native apps.