{"id":382415,"date":"2021-12-17T17:07:07","date_gmt":"2021-12-17T14:07:07","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it\/"},"modified":"2021-12-17T17:07:07","modified_gmt":"2021-12-17T14:07:07","slug":"what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it\/","title":{"rendered":"#What Is Prometheus and Why Is It So Popular? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a284cb885fe8\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a284cb885fe8\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it\/#What_Does_Prometheus_Do\" >What Does Prometheus Do?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it\/#More_About_Exporters\" >More About Exporters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it\/#Querying_Prometheus_Data\" >Querying Prometheus Data<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it\/#Alerts\" >Alerts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it\/#What_Cant_Prometheus_Do\" >What Can\u2019t Prometheus Do?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-prometheus-and-why-is-it-so-popular-cloudsavvy-it\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#What Is Prometheus and Why Is It So Popular? \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage aligncenter size-full wp-image-15125\" data-pagespeed-lazy-srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/12\/c53161a5.jpeg?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/12\/c53161a5.jpeg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/12\/c53161a5.jpeg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Graphic showing the Prometheus logo\" width=\"1202\" height=\"677\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\">Prometheus<\/a> is an open-source monitoring solution for collecting and aggregating metrics as time <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/watch-movies-tv-seriess\/\" data-internallinksmanager029f6b8e52c=\"8\" title=\"Watch Movies &amp; TV Series\" target=\"_blank\" rel=\"noopener\">series<\/a> data. Put more simply, each item in a Prometheus store is a metric event accompanied by the timestamp it occurred.<\/p>\n<p>Prometheus was originally developed at Soundcloud but is now a community project backed by the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.cncf.io\">Cloud Native Computing Foundation<\/a> (CNCF). It\u2019s rapidly grown to prominence over the past decade as its combination of querying features and cloud-native architecture have made it the ideal monitoring stack for modern <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>lications.<\/p>\n<p>In this article, we\u2019ll explain the role of Prometheus, tour how it stores and exposes data, and highlight where Prometheus\u2019 responsibility ends. Part of its popularity is down to the software\u2019s interoperability with other platforms which can surface data in more convenient formats.<\/p>\n<h2 id=\"what-does-prometheus-do\"><span class=\"ez-toc-section\" id=\"What_Does_Prometheus_Do\"><\/span>What Does Prometheus Do?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Prometheus stores events in real-time. These events can be anything relevant to your application, such as memory consumption, network utilization, or individual incoming requests.<\/p>\n<p>The fundamental data unit is a \u201cmetric.\u201d Each metric is assigned a name it can be referenced by as well and a set of labels. Labels are arbitrary key-value data pairs that can be used to filter the metrics in your database.<\/p>\n<p>Metrics are always based on one of four core <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/concepts\/metric_types\">instrument types<\/a>:<\/p>\n<ul>\n<li><strong>Counter<\/strong> \u2013 A value that steadily increments, never decreasing or resetting.<\/li>\n<li><strong>Gauge<\/strong> \u2013 A value that can change in any direction at any time.<\/li>\n<li><strong>Histogram<\/strong> \u2013 A sampling of multiple values that provides a sum of all the stored values, as well as the count of recorded events.<\/li>\n<li><strong>Summary<\/strong> \u2013 A summary functions similarly to a histogram but supports configurable quantiles for aggregate monitoring over sliding time periods.<\/li>\n<\/ul>\n<p>Prometheus determines the current value of your metrics by using a pull-based data fetching mechanism. It\u2019ll periodically poll the data source that backs each metric, then store the result as a new event in the time-series database. The monitored application is responsible for implementing the endpoint used as the data source; such data providers are commonly described as <em>exporters<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-15130\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/12\/13740cdd.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"1266\" height=\"671\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The pull-based model simplifies integrating Prometheus into your applications. All you need to do is provide a compatible endpoint that surfaces the <em>current<\/em> value of the metric to collect. Prometheus handles everything else. Although this can lead to inefficiencies \u2013 for example, if Prometheus polls the endpoint again before its data has changed \u2013 it means your code doesn\u2019t need to handle metric transportation.<\/p>\n<h2 id=\"more-about-exporters\"><span class=\"ez-toc-section\" id=\"More_About_Exporters\"><\/span>More About Exporters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Exporters are responsible for exposing your application\u2019s metrics ready for Prometheus to collect. Many users will begin with a simple deployment of the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/guides\/node-exporter\">Node Exporter<\/a> which collects basic system metrics from the Linux host it\u2019s installed on.<\/p>\n<p>A wide variety of exporters <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/instrumenting\/exporters\">are available<\/a> with many provided by Prometheus itself or official community vendors. Whether you\u2019re monitoring a popular database engine like MySQL, PostgreSQL, and MongoDB, or you\u2019re tracking an HTTP server, logging engine, or messaging bus, there\u2019s a good chance an exporter already exists.<\/p>\n<p>You can track your application\u2019s own metrics by <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/instrumenting\/writing_exporters\">writing your own exporter<\/a>. There\u2019s really no limits with this approach \u2013 you could capture time spent on a landing page, sales volume, user registrations, or anything else that matters to your system.<\/p>\n<p>Exporters are simple HTTP API endpoints so they can be constructed in any programming language. Prometheus provides official client libraries for Go, Java\/Scala, Python, and Ruby which make it easier to instrument your code. Community initiatives have provided <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/instrumenting\/writing_exporters\">unofficial libraries for<\/a> most other popular languages too.<\/p>\n<h2 id=\"querying-prometheus-data\"><span class=\"ez-toc-section\" id=\"Querying_Prometheus_Data\"><\/span>Querying Prometheus Data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Data within Prometheus is queried using <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/querying\/basics\">PromQL<\/a>, a built-in query language that lets you select, parse, and format metrics using a variety of operators and functions. As Prometheus uses time-series storage, there\u2019s support for time-based range and duration selections that make light work of surfacing data added within a specific time period.<\/p>\n<p>Here\u2019s an example that surfaces all the <code>memory_consumption<\/code> events within the last hour:<\/p>\n<pre><code>memory_consumption[1h]<\/code><\/pre>\n<p>This example only surfaces the memory consumption events recorded during the last hour.<\/p>\n<p>You can filter by label by adding key-value pairs inside curly braces:<\/p>\n<pre><code>memory_consumption{app=\"api\"}[1h]<\/code><\/pre>\n<p>Built-in functions provide opportunities for more precise analysis. Here\u2019s an example that uses the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/querying\/functions\/#rate\"><code>rate()<\/code> function<\/a> to calculate the rate of increase of the <code>memory_consumption<\/code> metric over the selected time period:<\/p>\n<pre><code>rate(memory_consumption[1h])<\/code><\/pre>\n<p>Prometheus data can be accessed via the built-in web UI, usually exposed on port 9090, or the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/querying\/api\">HTTP API<\/a>. The latter provides a robust way to get data from Prometheus into other tools such as dashboard solutions.<\/p>\n<h2 id=\"alerts\"><span class=\"ez-toc-section\" id=\"Alerts\"><\/span>Alerts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Prometheus comes with an <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/alerting\/latest\/alertmanager\">Alertmanager component<\/a> that can send you notifications when metrics change. It supports rule-based policies that determine when an alert should be sent.<\/p>\n<p>You can receive alerts to your email address, arbitrary HTTP webhooks, and popular messaging platforms such as Slack. Alertmanager includes integrated support for aggregating and muting repetitive alerts so you won\u2019t be inundated when multiple events occur in a short timeframe.<\/p>\n<p>Alertmanager is configured independently of the main Prometheus system. You set up the alerting rules in Prometheus, determining the conditions when a metric should send an alert to Alertmanager. The latter component then gets to decide whether the alert should be delivered to each configured platform.<\/p>\n<h2 id=\"what-cant-prometheus-do\"><span class=\"ez-toc-section\" id=\"What_Cant_Prometheus_Do\"><\/span>What Can\u2019t Prometheus Do?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>While Prometheus is a comprehensive monitoring solution, there are some roles it\u2019s ill-suited for. Prometheus is engineered with reliability and performance as its core tenets. This leads to trade-offs in the accuracy of metrics.<\/p>\n<p>Prometheus does not guarantee the collected data will be 100% accurate. It\u2019s intended for high-volume scenarios where occasional dropped events don\u2019t influence the bigger picture. If you\u2019re tracking sensitive statistics which need to be correct, you should use another platform for those metrics. You could still adopt Prometheus for the less critical values in your system.<\/p>\n<p>Furthermore, Prometheus may not be the only component you want in your monitoring stack. It\u2019s focused on storing and querying your events, primarily using HTTP APIs. The built-in web UI provides basic graphing capabilities but can\u2019t support advanced custom dashboards. Data visualization scenarios are usually handled by deploying a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/grafana.com\">Grafana<\/a> instance alongside; this provides dashboarding and metric analysis capabilities with built-in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/visualization\/grafana\">Prometheus integration<\/a>.<\/p>\n<h2 id=\"conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>At its simplest, Prometheus is a time series data store which can be used for managing any sequential time-based data. It\u2019s most commonly used to monitor the metrics of other applications in your stack. While Prometheus is an effective system for storing and querying metrics, it\u2019s usually integrated with other solutions to power graphical dashboards and advanced visualizations. Its popularity is down to its ability to work with custom metrics, support rich queries, and interoperate with other members of the cloud-native ecosystem.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-15129\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/12\/0d9b87f1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"1266\" height=\"1206\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Prometheus aims for maximum reliability. It\u2019s <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/introduction\/overview\">designed to be<\/a> your go-to tool during an incident that helps you understand why other components are failing. Individual Prometheus nodes in a clustered deployment are fully autonomous with no dependencies on remote storage. As a consequence of its dependability, Prometheus doesn\u2019t guarantee data accuracy. This drawback should be your primary consideration when planning a new deployment.<\/p>\n<p>While we\u2019ve not covered the practical steps of installing Prometheus in this article, the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/installation\">official documentation<\/a> provides a comprehensive quick-start guide if you\u2019d like to try the system yourself. Prometheus is commonly deployed as a Docker container but is also available from source or as pre-compiled binaries for popular Linux distributions. The Dockerized approach is easiest to work with as it includes all core components in a ready-to-run configuration.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/15124\/what-is-prometheus-and-why-is-it-so-popular\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#What Is Prometheus and Why Is It So Popular? \u2013 CloudSavvy IT&#8221; Prometheus is an open-source monitoring solution for collecting and aggregating metrics as time series data. Put more simply, each item in a Prometheus store is a metric event accompanied by the timestamp it occurred. Prometheus was originally developed at Soundcloud but is now&#8230;<\/p>\n","protected":false},"author":1,"featured_media":382416,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/12\/c53161a5.jpeg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-382415","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/382415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=382415"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/382415\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/382416"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=382415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=382415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=382415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}