Software:Prometheus

From HandWiki
Short description: Application used for event monitoring and alerting
Prometheus
Prometheus software logo.svg
Initial release24 November 2012; 11 years ago (2012-11-24)
Stable release
v2.47.0[1] / 6 September 2023; 5 months ago (2023-09-06)
Repositorygithub.com/prometheus/prometheus
Written inGo
Operating systemCross-platform
TypeTime series database
LicenseApache License 2.0
Websiteprometheus.io

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] and is a graduated project of the Cloud Native Computing Foundation, along with Kubernetes and Envoy.[6]

History

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]

In May 2016, the Cloud Native Computing Foundation accepted Prometheus as its second incubated project, after Kubernetes. The blog post announcing this stated that the tool was in use at many companies including DigitalOcean, Ericsson, CoreOS, Weaveworks, Red Hat, and Google.[12]

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]

In August 2018, the Cloud Native Computing Foundation announced that the Prometheus project had graduated.[6]

A variety of conferences focused on Prometheus have been held.

Architecture

A typical monitoring platform with Prometheus is composed of multiple tools:[citation needed]

  • Multiple exporters typically run on the monitored host to export local metrics.
  • Prometheus to centralize and store the metrics.
  • Alertmanager[15] to trigger alerts based on those metrics.
  • Grafana to produce dashboards.
  • 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

  • Gauge
  • Counter
  • Histogram
  • Summary

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.[20] Some other messaging systems like Microsoft Teams[21] could be configured using the Alertmanager Webhook Receiver as a mechanism for external integrations.[22] also Prometheus Alerts can be used to receive alerts directly on android devices even without the requirement of any targets configuration in Alert Manager.[23]

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.[24]

Interoperability

Prometheus favors white-box monitoring. Applications are encouraged to publish (export) internal metrics to be collected periodically by Prometheus.[25] Some exporters and agents for various applications are available to provide metrics.[26] 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.[27] 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.[28] Some products adopted the format: InfluxData's TICK suite,[29] InfluxDB, Google Cloud Platform,[30] and DataDog.[31]

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,[32] digital festival DreamHack,[33] and email and contact migration service ShuttleCloud.[34] Separately, Pandora Radio has mentioned using Prometheus to monitor its data pipeline.[35]

GitLab provides a Prometheus integration guide to export GitLab metrics to Prometheus[36] and it is activated by default since version 9.0[37]

See also

References

  1. Latest release at Github
  2. "Overview". https://prometheus.io/docs/introduction/overview/. 
  3. James Turnbull (12 June 2018). Monitoring with Prometheus. Turnbull Press. ISBN 978-0-9888202-8-9. https://books.google.com/books?id=EtlfDwAAQBAJ. 
  4. "Prometheus: From metrics to insight. Power your metrics and alerting with a leading open-source monitoring solution". https://prometheus.io/. Retrieved December 26, 2018. 
  5. "Prometheus". https://github.com/prometheus. Retrieved December 26, 2018. 
  6. 6.0 6.1 Evans, Kristen (August 9, 2018). "Cloud Native Computing Foundation Announces Prometheus Graduation". https://www.cncf.io/announcement/2018/08/09/prometheus-graduates/. Retrieved December 26, 2018. 
  7. Brian Brazil (9 July 2018). Prometheus: Up & Running: Infrastructure and Application Performance Monitoring. O'Reilly Media. p. 3. ISBN 978-1-4920-3409-4. https://books.google.com/books?id=QW1jDwAAQBAJ. 
  8. 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 Volz, Julius; Rabenstein, Björn (January 26, 2015). "Prometheus: Monitoring at SoundCloud". SoundCloud. https://developers.soundcloud.com/blog/prometheus-monitoring-at-soundcloud. 
  9. 9.0 9.1 "Monitor Docker Containers with Prometheus". 5π Consulting. January 26, 2015. http://5pi.de/2015/01/26/monitor-docker-containers-with-prometheus/. 
  10. Murphy, Niall; Beyer, Betsy; Jones, Chris; Petoff, Jennifer (2016). Site Reliability Engineering:How Google Runs Production Systems. O'Reilly Media. ISBN 978-1491929124. http://shop.oreilly.com/product/0636920041528.do. "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 ..." 
  11. Volz, Julius (4 September 2017). "PromCon 2017: Conference Recap". https://www.youtube.com/watch?v=4Pr-z8-r1eo. "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." 
  12. "Cloud Native Computing Foundation Accepts Prometheus as Second Hosted Project". Cloud Native Computing Foundation. May 9, 2016. https://www.cncf.io/announcement/2016/05/09/cloud-native-computing-foundation-accepts-prometheus-as-second-hosted-project/. Retrieved December 26, 2018. 
  13. "Prometheus 1.0 Is Here". Cloud Native Computing Foundation. July 18, 2016. https://www.cncf.io/blog/2016/07/18/prometheus-1-0-is-here/. Retrieved December 26, 2018. 
  14. "New Features in Prometheus 2.0.0". Robust Perception. November 8, 2017. https://www.robustperception.io/new-features-in-prometheus-2-0-0. Retrieved December 26, 2018. 
  15. "Alertmanager". 17 May 2022. https://github.com/prometheus/alertmanager. 
  16. "Data model". Prometheus. https://prometheus.io/docs/concepts/data_model/. Retrieved December 26, 2018. 
  17. 17.0 17.1 "Integrations - Prometheus". https://prometheus.io/docs/operating/integrations/#remote-endpoints-and-storage. 
  18. "Prometheus: Collects metrics, provides alerting and graphs web UI". March 18, 2017. http://www.openwebit.com/c/prometheus-collects-metrics-provides-alerting-and-graphs-web-ui/. Retrieved December 26, 2018. 
  19. "Querying Prometheus". https://prometheus.io/docs/prometheus/latest/querying/basics/. Retrieved November 4, 2019. 
  20. Dubey, Abhishek (March 25, 2018). "AlertManager Integration with Prometheus". https://medium.com/@abhishekbhardwaj510/alertmanager-integration-in-prometheus-197e03bfabdf. 
  21. Danuka, Praneeth (March 8, 2020). "Alerting for Cloud-native Applications with Prometheus". https://medium.com/@Danuka_Praneeth/generating-alerts-from-prometheus-dc66522ecbe5. 
  22. "Integrations | Prometheus". https://prometheus.io/docs/operating/integrations/#alertmanager-webhook-receiver. 
  23. "Prometheus alerts - Apps on Google Play". https://play.google.com/store/apps/details?id=com.khafan.prometheusalerts. 
  24. Ryckbosch, Frederick (July 28, 2017). "Prometheus monitoring: Pros and cons". https://jaxenter.com/prometheus-monitoring-pros-cons-136019.html. Retrieved December 26, 2018. 
  25. Prometheus. "Instrumentation - Prometheus". https://prometheus.io/docs/practices/instrumentation/. 
  26. "Exporters". https://prometheus.io/docs/instrumenting/exporters/. 
  27. Prometheus. "Prometheus - Monitoring system & time series database". https://prometheus.io/. 
  28. "OpenMetrics". 2018-11-13. https://github.com/OpenObservability/OpenMetrics. 
  29. "Telegraf from InfluxData". 2018-12-25. https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus. 
  30. "Announcing Stackdriver Kubernetes Monitoring". https://cloudplatform.googleblog.com/2018/05/Announcing-Stackdriver-Kubernetes-Monitoring-Comprehensive-Kubernetes-observability-from-the-start.html. 
  31. "DataDogHQ". https://docs.datadoghq.com/agent/prometheus/. 
  32. Evans, Kristen (February 28, 2017). "Prometheus User Profile: How DigitalOcean Uses Prometheus". Cloud Native Computing Foundation. https://www.cncf.io/blog/2017/02/28/prometheus-user-profile-digitalocean-uses-prometheus/. Retrieved December 26, 2018. 
  33. Evans, Kristen (August 24, 2016). "Prometheus User Profile: Monitoring the World's Largest Digital Festival – DreamHack". Cloud Native Computing Foundation. https://www.cncf.io/blog/2016/08/24/prometheus-user-profile-monitoring-the-worlds-largest-digital-festival-dreamhack/. Retrieved December 26, 2018. 
  34. Evans, Kirsten (May 17, 2017). "Prometheus User Profile: ShuttleCloud Explains Why Prometheus Is Good for Your Small Startup". Cloud Native Computing Foundation. https://www.cncf.io/blog/2017/05/17/prometheus-user-profile-shuttlecloud-explains-prometheus-good-small-startup/. Retrieved December 26, 2018. 
  35. Haidrey, Ace (March 15, 2018). "Apache Airflow at Pandora". Engineering at Pandora. https://engineering.pandora.com/apache-airflow-at-pandora-1d7a844d68ee. Retrieved December 26, 2018. 
  36. "GitLab Prometheus metrics". https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html. Retrieved December 26, 2018. 
  37. "GitLab 9.0 released with Subgroups and Deploy Boards". GitLab. 2017-03-22. https://about.gitlab.com/2017/03/22/gitlab-9-0-released/. 

Further reading

  • 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. ISBN 9781785885501. OCLC 933610431. 
  • 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. ISBN 978-1788830607. OCLC 1031909876. 
  • Burns, Brendan (2018-02-20). Designing distributed systems : patterns and paradigms for scalable, reliable services (First ed.). Sebastopol, CA. ISBN 9781491983614. OCLC 1023861580. 
  • 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. ISBN 9781787127968. OCLC 1020029257. 
  • Alok, Shrivastwa (2018-02-23). Hybrid cloud for architects : build robust hybrid cloud solutions using AWS and OpenStack. Birmingham, UK. ISBN 9781788627986. OCLC 1028641698. 
  • Kaewkasi, Chanwit (2016). Native Docker Clustering with Swarm. ISBN 978-1786469755.