Prometheus was developed at SoundCloud starting in 2012,[7] 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.[8] 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.[8][9] Prometheus was inspired by the monitoring tool Borgmon used at Google.[10][11]
By 2013, Prometheus was introduced for production monitoring at SoundCloud.[8] The official public announcement was made in January 2015.[8]
PromQL is the query language used to create dashboards and alerts.
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][8][9]
Prometheus stores data locally on disk, which helps for fast data storage and fast querying.[8] 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.[8] 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 rate() 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]
Gauge
Counter
Histogram
Summary
Example code
# A metric with label filteringgo_gc_duration_seconds{instance="localhost:9090",job="alertmanager"}# Aggregation operatorssumby(app,proc)(instance_memory_limit_bytes-instance_memory_usage_bytes)/1024/1024
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.[22] Some other messaging systems like Microsoft Teams[23] could be configured using the Alertmanager Webhook Receiver as a mechanism for external integrations.[24] also Prometheus Alerts can be used to receive alerts directly on android devices even without the requirement of any targets configuration in Alert Manager.[25]
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.[26]
Interoperability
Prometheus favors white-box monitoring. Applications are encouraged to publish (export) internal metrics to be collected periodically by Prometheus.[27] Some exporters and agents for various applications are available to provide metrics.[28] 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.[29] 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.[30] Some products adopted the format: InfluxData's TICK suite,[31]InfluxDB, Google Cloud Platform,[32] and DataDog.[33]
Usage
Prometheus was first used in-house at SoundCloud, where it was developed, for monitoring their systems.[8] The Cloud Native Computing Foundation has a number of case studies of other companies using Prometheus. These include digital hosting service DigitalOcean,[34] digital festival DreamHack,[35] and email and contact migration service ShuttleCloud.[36] Separately, Pandora Radio has mentioned using Prometheus to monitor its data pipeline.[37]
GitLab provides a Prometheus integration guide to export GitLab metrics to Prometheus[38] and it is activated by default since version 9.0[39]
^Murphy, Niall; Beyer, Betsy; Jones, Chris; Petoff, Jennifer (2016). Site Reliability Engineering:How Google Runs Production Systems. O'Reilly Media. ISBN978-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 ...
^Volz, Julius (4 September 2017). "PromCon 2017: Conference Recap" – via 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.
Russ, McKendrick (2015-12-15). Monitoring Docker : monitor your Docker containers and their apps using various native and third-party tools with the help of this exclusive guide!. Birmingham, UK. ISBN9781785885501. OCLC933610431.{{cite book}}: CS1 maint: location missing publisher (link)
JOSEPH., HECK (2018). KUBERNETES FOR DEVELOPERS use kubernetes to develop, test, and deploy your applications with the help of containers;use kubernetes to develop. [S.l.]: PACKT PUBLISHING. ISBN978-1788830607. OCLC1031909876.
Burns, Brendan (2018-02-20). Designing distributed systems : patterns and paradigms for scalable, reliable services (First ed.). Sebastopol, CA. ISBN9781491983614. OCLC1023861580.{{cite book}}: CS1 maint: location missing publisher (link)
Martin., Helmich (2017). Cloud Native programming with Golang Develop microservice-based high performance web apps for the cloud with Go. Andrawos, Mina., Snoeck, Jelmer. Birmingham: Packt Publishing. ISBN9781787127968. OCLC1020029257.
Alok, Shrivastwa (2018-02-23). Hybrid cloud for architects : build robust hybrid cloud solutions using AWS and OpenStack. Birmingham, UK. ISBN9781788627986. OCLC1028641698.{{cite book}}: CS1 maint: location missing publisher (link)