Prometheus (software) explained

Prometheus
Latest Release Version:v3.2.1[1]
Programming Language:Go
Operating System:Cross-platform
Genre:Time series database
License:Apache License 2.0

Prometheus is a free software application used for event monitoring and alerting.[2] It records metrics in a time series database (allowing for high dimensionality) built using an HTTP pull model, with flexible queries and real-time alerting.[3] [4] The project is written in Go and licensed under the Apache 2 License, with source code available on GitHub.[5]

History

Prometheus was developed at SoundCloud starting in 2012,[6] when the company discovered that its existing metrics and monitoring tools (using StatsD and Graphite) were insufficient for their needs. Specifically, they identified needs that Prometheus was built to meet, including a multi-dimensional data model, operational simplicity, scalable data collection, and a powerful query language, all in a single tool.[7] The project was open-source from the beginning and began to be used by Boxever and Docker users as well, despite not being explicitly announced.[7] [8] Prometheus was inspired by the monitoring tool Borgmon used at Google.[9] [10]

By 2013, Prometheus was introduced for production monitoring at SoundCloud.[7] The official public announcement was made in January 2015.[7]

In May 2016, the Cloud Native Computing Foundation (CNCF) accepted Prometheus as its second incubated project, after Kubernetes.[11] In August 2018, the CNCF announced that the Prometheus project had graduated.[12]

Versions

Prometheus 1.0 was released in July 2016.[13] Subsequent versions were released through 2016 and 2017, leading to Prometheus 2.0 in November 2017.[14]

Architecture

A typical monitoring platform with Prometheus is composed of multiple tools:

Data storage format

Prometheus data is stored in the form of metrics, with each metric having a name that is used for referencing and querying it. Each metric can be drilled down by an arbitrary number of key=value pairs (labels). Labels can include information on the data source (which server the data is coming from) and other application-specific breakdown information such as the HTTP status code (for metrics related to HTTP responses), query method (GET versus POST), endpoint, etc. The ability to specify an arbitrary list of labels and to query based on these in real time is why Prometheus' data model is called multi-dimensional.[16] [7] [8]

Prometheus stores data locally on disk, which helps for fast data storage and fast querying.[7] There is the ability to store metrics in remote storage.[17]

Data collection

Prometheus collects data in the form of time series. The time series are built through a pull model: the Prometheus server queries a list of data sources (sometimes called exporters) at a specific polling frequency. Each of the data sources serves the current values of the metrics for that data source at the endpoint queried by Prometheus. The Prometheus server then aggregates data across the data sources.[7] Prometheus has a number of mechanisms to automatically discover resources that should be used as data sources.[18]

PromQL

Prometheus provides its own query language PromQL (Prometheus Query Language) that lets users select and aggregate data. PromQL is specifically adjusted to work in convention with a Time-Series Database and therefore provides time-related query functionalities. Examples include the function, the instant vector and the range vector which can provide many samples for each queried time series.[19] Prometheus has four clearly defined metric types around which the PromQL components revolve. The four types are:[20]

Example code

Alerts and monitoring

Configuration for alerts can be specified in Prometheus which specifies a condition that needs to be maintained for a specific duration in order for an alert to trigger. When alerts trigger, they are forwarded to the Alertmanager service. Alertmanager can include logic to silence alerts and also to forward them to email, Slack, or notification services such as PagerDuty.[21] Some other messaging systems like Microsoft Teams[22] could be configured using the Alertmanager Webhook Receiver as a mechanism for external integrations.[23] also Prometheus Alerts can be used to receive alerts directly on android devices even without the requirement of any targets configuration in Alert Manager.[24]

Time Series Database

Prometheus has its own implementation of time series database where it stores the recent data (1–3 hours of data by default) in a combination of memory[25] and mmap-ed files from disk,[26] and persists the older data in the form of blocks[27] with an inverted index. Inverted index is well suited for Prometheus data format and querying patterns.[28] As part of background maintenance, smaller blocks are merged to form bigger blocks in a process called compaction[29] to improve query efficiency by having fewer blocks to read. Prometheus also uses a Write-Ahead-Log (WAL)[30] to provide durability against crashes.

Dashboards

Prometheus is not intended as a full-fledged dashboard. Although it can be used to graph specific queries, it is not a full-fledged dashboard and needs to be hooked up with Grafana to generate dashboards; this has been cited as a disadvantage due to the additional setup complexity.[31]

Interoperability

Prometheus favors white-box monitoring. Applications are encouraged to publish (export) internal metrics to be collected periodically by Prometheus.[32] Some exporters and agents for various applications are available to provide metrics.[33] Prometheus supports some monitoring and administration protocols to allow interoperability for transitioning: Graphite, StatsD, SNMP, JMX, and CollectD.

Prometheus focuses on the availability of the platform and basic operations.[34] The metrics are typically stored for a few weeks. For long-term storage, the metrics can be streamed to remote storage.[17]

Standardization into OpenMetrics

There is an effort to promote Prometheus exposition format into a standard known as OpenMetrics.[35] Some products adopted the format: InfluxData's TICK suite,[36] InfluxDB, Google Cloud Platform,[37] DataDog[38] and New Relic.[39] [40]

Library interfacing

Prometheus is interfaced with by various libraries. For example, POCO C++ Libraries supports interfacing with Prometheus through its Poco::Prometheus library.[41]

See also

Further reading

Notes and References

  1. https://github.com/prometheus/prometheus/releases/latest Latest release at Github
  2. Web site: Overview. prometheus.io.
  3. Book: James Turnbull. Monitoring with Prometheus. 12 June 2018. Turnbull Press. 978-0-9888202-8-9.
  4. Web site: Prometheus: From metrics to insight. Power your metrics and alerting with a leading open-source monitoring solution. December 26, 2018.
  5. Web site: Prometheus . . December 26, 2018.
  6. Book: Brian Brazil. Prometheus: Up & Running: Infrastructure and Application Performance Monitoring. 9 July 2018. O'Reilly Media. 978-1-4920-3409-4. 3.
  7. Web site: Prometheus: Monitoring at SoundCloud. Volz. Julius. Rabenstein. Björn. January 26, 2015. SoundCloud.
  8. Web site: Monitor Docker Containers with Prometheus. January 26, 2015. 5Ï€ Consulting. December 26, 2018. January 3, 2019. https://web.archive.org/web/20190103181809/http://5pi.de/2015/01/26/monitor-docker-containers-with-prometheus/. dead.
  9. Book: Site Reliability Engineering:How Google Runs Production Systems . Niall . Murphy . Betsy . Beyer . Chris . Jones . Jennifer . Petoff . O'Reilly Media . 2016 . 978-1491929124 . Even though Borgmon remains internal to Google, the idea of treating time-series data as a data source for generating alerts is now accessible to everyone through those open source tools like Prometheus ... .
  10. Web site: Julius . Volz . PromCon 2017: Conference Recap . 4 September 2017 . YouTube . I joined SoundCloud back in 2012 coming from Google...we didn't yet have any monitoring tools that that works with this kind of dynamic environment. We were kind of missing the way Google did its monitoring for its own internal cluster scheduler and we were very inspired by that and finally decided to build our own open-source solution..
  11. Web site: Cloud Native Computing Foundation Accepts Prometheus as Second Hosted Project. May 9, 2016. Cloud Native Computing Foundation. December 26, 2018.
  12. Web site: Evans . Kristen . August 9, 2018 . Cloud Native Computing Foundation Announces Prometheus Graduation . December 26, 2018.
  13. Web site: July 18, 2016 . Prometheus 1.0 Is Here . December 26, 2018 . Cloud Native Computing Foundation.
  14. Web site: November 8, 2017 . New Features in Prometheus 2.0.0 . December 26, 2018 . Robust Perception.
  15. Web site: Alertmanager . . 17 May 2022 .
  16. Web site: Data model. Prometheus. December 26, 2018.
  17. Web site: Integrations - Prometheus. prometheus.io.
  18. Web site: Prometheus: Collects metrics, provides alerting and graphs web UI. March 18, 2017. December 26, 2018.
  19. Web site: Querying Prometheus. November 4, 2019.
  20. Web site: Metric types . 2024-06-29 . prometheus.io . en.
  21. Web site: AlertManager Integration with Prometheus . Dubey. Abhishek . March 25, 2018 . December 26, 2018.
  22. Web site: Alerting for Cloud-native Applications with Prometheus . Danuka . Praneeth . March 8, 2020 . October 18, 2020.
  23. Web site: Integrations | Prometheus .
  24. Web site: Prometheus alerts - Apps on Google Play .
  25. Web site: 2020-09-19 . Prometheus TSDB (Part 1): The Head Block Ganesh Vernekar . 2025-01-17 . ganeshvernekar.com . en.
  26. Web site: 2020-10-02 . Prometheus TSDB (Part 3): Memory Mapping of Head Chunks from Disk Ganesh Vernekar . 2025-01-17 . ganeshvernekar.com . en.
  27. Web site: 2020-10-18 . Prometheus TSDB (Part 4): Persistent Block and its Index Ganesh Vernekar . 2025-01-17 . ganeshvernekar.com . en.
  28. Web site: 2021-01-04 . Prometheus TSDB (Part 5): Queries Ganesh Vernekar . 2025-01-17 . ganeshvernekar.com . en.
  29. Web site: 2021-07-27 . Prometheus TSDB (Part 6): Compaction and Retention Ganesh Vernekar . 2025-01-17 . ganeshvernekar.com . en.
  30. Web site: 2020-09-26 . Prometheus TSDB (Part 2): WAL and Checkpoint Ganesh Vernekar . 2025-01-17 . ganeshvernekar.com . en.
  31. Web site: Prometheus monitoring: Pros and cons. July 28, 2017. Ryckbosch. Frederick. December 26, 2018.
  32. Web site: Instrumentation - Prometheus. Prometheus. prometheus.io.
  33. Web site: Exporters . prometheus.io.
  34. Web site: Prometheus - Monitoring system & time series database. Prometheus. prometheus.io.
  35. Web site: OpenMetrics. GitHub . 2018-11-13 .
  36. Web site: Telegraf from InfluxData . . 2018-12-25 .
  37. Web site: Announcing Stackdriver Kubernetes Monitoring.
  38. Web site: DataDogHQ.
  39. Web site: Send Prometheus metric data to New Relic New Relic Documentation . docs.newrelic.com . 16 April 2025.
  40. Web site: Configure Prometheus OpenMetrics integrations New Relic Documentation . docs.newrelic.com . 16 April 2025.
  41. Web site: Namespace Poco::Prometheus. 18 October 2025. docs.pocoproject.org. POCO Project.