<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Prometheus on Giedrius Statkevičius</title><link>https://giedrius.blog/categories/prometheus/</link><description>Recent content in Prometheus on Giedrius Statkevičius</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 22 Jun 2025 10:56:40 +0000</lastBuildDate><atom:link href="https://giedrius.blog/categories/prometheus/feed.xml" rel="self" type="application/rss+xml"/><item><title>OpenTelemetry-go makes it hard to migrate to exponential histograms</title><link>https://giedrius.blog/2025/06/22/opentelemetry-go-makes-it-hard-to-migrate-to-exponential-histograms/</link><pubDate>Sun, 22 Jun 2025 10:56:40 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=1240</guid><description>&lt;p&gt;&lt;em&gt;github.com/prometheus/client_golang&lt;/em&gt; has a nice feature where a histogram can simultaneously be both an exponential (native) histogram and a classic (explicit bucket) one. Then, depending on what formats are accepted by the scraper, either both the native histogram version and the classical one are exposed, or just the classical one (text format). There has been an initiative to expose native histograms in text format, but it hasn&amp;rsquo;t yet solidified.&lt;/p&gt;
&lt;p&gt;Unfortunately, in the OpenTelemetry standards, a histogram at any point can only have either explicit buckets or exponential buckets. From &lt;a href="https://opentelemetry.io/docs/specs/otel/metrics/data-model/#model-details"&gt;https://opentelemetry.io/docs/specs/otel/metrics/data-model/#model-details&lt;/a&gt;:&lt;/p&gt;</description></item><item><title>Perils of /metrics data assertions</title><link>https://giedrius.blog/2024/02/28/perils-of-metrics-data-assertions/</link><pubDate>Wed, 28 Feb 2024 10:17:44 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=1155</guid><description>&lt;p&gt;In the Thanos project the e2e tests are written in part using assertions on the metrics data. I have encountered a few challenges with those assertions that I wanted to share with you.&lt;/p&gt;
&lt;h2 id="always-check-for-the-maximum-possible-value"&gt;Always check for the maximum possible value&lt;/h2&gt;
&lt;p&gt;Writing tests on /metrics data means your testing harness continuously checks /metrics data to see whether some metric equals some value. If the metric takes some time to reach the maximum value, you might erroneously write an equals check that checks for a smaller value. Later on, this will lead to a flaky test situation.&lt;/p&gt;</description></item><item><title>Starting up GitHub sponsors and some recent postings work</title><link>https://giedrius.blog/2024/02/22/starting-up-github-sponsors-and-some-recent-postings-work/</link><pubDate>Thu, 22 Feb 2024 19:04:51 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=1160</guid><description>&lt;p&gt;Hello everyone! I am happy to announce that I&amp;rsquo;ve set up GitHub sponsors on my &lt;a href="https://github.com/GiedriusS"&gt;profile&lt;/a&gt;. If you want to support my blog or my work on Thanos/Prometheus, and you have some free money then now you have a way to throw some money at these projects. Let&amp;rsquo;s see if I will even get one sponsor. I was thinking that maybe I should work on some custom features that could be behind a paywall. Let&amp;rsquo;s see when I will have some time to work on them.&lt;/p&gt;</description></item><item><title>Taxonomy of PromQL engines</title><link>https://giedrius.blog/2023/02/25/taxonomy-of-promql-engines/</link><pubDate>Sat, 25 Feb 2023 17:19:34 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=1021</guid><description>&lt;p&gt;PromQL kind of became a de facto standard of querying metrics. PromQL is the querying language of Prometheus. Over the recent years, a lot of different vendors started making products that are &amp;ldquo;compatible&amp;rdquo; with Prometheus. Julius Volz covers the general aspects of compatibility in his blog at &lt;a href="https://promlabs.com/promql-compliance-tests/"&gt;https://promlabs.com/promql-compliance-tests/&lt;/a&gt;. However, it would be interesting to look at the technical differences between PromQL engines embedded in each product. I will be mostly looking at the differences between engines in terms of how much they support concurrency, distributed evaluation features such as pushdown or general evaluation over many servers, optimizations, and how close they are to the vanilla engine.&lt;/p&gt;</description></item><item><title>How to Visualize Prometheus TSDB With Thanos</title><link>https://giedrius.blog/2021/01/10/how-to-visualize-prometheus-tsdb-with-thanos/</link><pubDate>Sun, 10 Jan 2021 19:18:55 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=785</guid><description>&lt;p&gt;Have you ever tried to &lt;code&gt;ls&lt;/code&gt; the Prometheus TSDB data directory just to understand what kind of data you have from the perspective of time? Here is an example listing:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;drwxrwxr-x 3 gstatkevicius gstatkevicius 4096 Jun 26 2020 01EBRP7DA9N67RTT9AFE0KMXFJ
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;drwxrwxr-x 3 gstatkevicius gstatkevicius 4096 Jun 26 2020 01EBRP7DCM68X5SPQGK3T8NNER
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;drwxrwxr-x 2 gstatkevicius gstatkevicius 4096 Jun 26 2020 chunks_head
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-rw-r--r-- 1 gstatkevicius gstatkevicius 0 Apr 17 2020 lock
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-rw-r--r-- 1 gstatkevicius gstatkevicius 20001 Jan 2 14:01 queries.active
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;drwxr-xr-x 3 gstatkevicius gstatkevicius 4096 Jan 2 14:01 wal
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We could assume that each block is 2 hours long. However, they can be compacted i.e. &amp;ldquo;joined&amp;rdquo; into bigger ones if that is enabled. Then, the blocks would not line up in a sequential way. Plus, this output of &lt;code&gt;ls&lt;/code&gt; doesn&amp;rsquo;t even show the creation time of different blocks. We could theoretically get those timestamps with &lt;code&gt;stat(2)&lt;/code&gt;, &lt;code&gt;statx(2)&lt;/code&gt; and some shell magic but that&amp;rsquo;s cumbersome. Overall, this doesn&amp;rsquo;t seem too helpful and we can do better.&lt;/p&gt;</description></item><item><title>Is it a good idea to use Prometheus for storing ASCII paintings?</title><link>https://giedrius.blog/2019/09/21/is-it-a-good-idea-to-use-prometheus-for-storing-ascii-paintings/</link><pubDate>Sat, 21 Sep 2019 10:35:31 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=592</guid><description>&lt;p&gt;In the Cloud-based computing world, a relatively popular free and open-source software product called &lt;a href="https://prometheus.io/"&gt;Prometheus&lt;/a&gt; exists which lets you monitor and observe other things. One of the components of its user interface lets you execute ad-hoc queries on the data that it has and see their results - not just in a table but also in a graphical way as well. For example, this is a query &lt;code&gt;time()&lt;/code&gt; which plots the current time using two dimensions:&lt;/p&gt;</description></item><item><title>What Is New In Thanos 0.5.0</title><link>https://giedrius.blog/2019/06/03/what-is-new-in-thanos-0-5-0/</link><pubDate>Mon, 03 Jun 2019 16:52:32 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=480</guid><description>&lt;figure&gt;
&lt;img loading="lazy" src="https://giedrius.blog/wp-content/uploads/2019/06/97e49180-661b-11e9-9882-fdc44b74debd.png"/&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;a href="https://thanos.io/"&gt;Thanos&lt;/a&gt; 0.5.0-rc.0 has been recently released and the final 0.5.0 version is just around the corner. It is a good opportunity to look back on what has changed since the last version. I hope that I will be able to present a good enough perspective since I have been recently appointed as a maintainer of the project. Thanks to everyone who has contributed pull requests and bug reports 💖This could not have been done without you.&lt;/p&gt;</description></item><item><title>Push Vs. Pull In Monitoring Systems</title><link>https://giedrius.blog/2019/05/11/push-vs-pull-in-monitoring-systems/</link><pubDate>Sat, 11 May 2019 18:04:49 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=484</guid><description>&lt;h1 id="intro"&gt;Intro&lt;/h1&gt;
&lt;p&gt;There are two different schools of thought when thinking about how metrics are ingested into a monitoring system: either the metrics get &lt;em&gt;pushed (usually via UDP)&lt;/em&gt; into the system or they get &lt;em&gt;pulled (usually via HTTP)&lt;/em&gt;. I might not mention that I have that in mind when saying &amp;ldquo;push or pull based systems&amp;rdquo; in some places to keep the article terse.&lt;/p&gt;
&lt;p&gt;The push method is used in systems such as &lt;a href="https://graphiteapp.org/"&gt;Graphite&lt;/a&gt; whereas the pull method is used by monitoring systems like &lt;a href="https://prometheus.io/"&gt;Prometheus&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Choosing Maximum Concurrent Queries in Prometheus Smartly</title><link>https://giedrius.blog/2019/01/13/choosing-maximum-concurrent-queries-in-prometheus-smartly/</link><pubDate>Sun, 13 Jan 2019 16:59:27 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=368</guid><description>&lt;p&gt;The popular monitoring software Prometheus has recently introduced (from &lt;strong&gt;2.6&lt;/strong&gt;) new knobs which regulate how many queries can be executed concurrently.&lt;/p&gt;
&lt;figure&gt;
&lt;img loading="lazy" src="https://upload.wikimedia.org/wikipedia/en/thumb/3/38/Prometheus%5Fsoftware%5Flogo.svg/1033px-Prometheus%5Fsoftware%5Flogo.svg.png"
alt="Prometheus logo from Wikipedia" width="382"/&gt; &lt;figcaption&gt;
&lt;p&gt;Prometheus logo from Wikipedia&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;There are even the same knobs for different interfaces. Here they are with their default values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;ndash;storage.remote.read-concurrent-limit=10&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;ndash;query.max-concurrency=20&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The latter is an upper-bound value to the former option. However, the question is:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How do you choose sensible values for them?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Well, I think I have the answer.&lt;/p&gt;</description></item><item><title>Apply The Same Principle to Monitoring Alerts as to Software Bugs</title><link>https://giedrius.blog/2019/01/06/apply-the-same-principle-to-monitoring-alerts-as-to-software-bugs/</link><pubDate>Sun, 06 Jan 2019 14:04:52 +0000</pubDate><guid isPermaLink="false">https://giedrius.blog/?p=366</guid><description>&lt;p&gt;It is almost a mantra in the quality assurance world to always add a test case to your unit, integration, or any other tests whenever you find a new error in your software product which checks for exactly that case. Over time I have noticed that the same principle should be applied to monitoring.&lt;/p&gt;
&lt;p&gt;Consider adding new alerting rules whenever you run into anomalous behavior and afterward you see the metrics which have indicated it. Treat it as if they are tests but they are &amp;ldquo;real-time&amp;rdquo; tests which provide not just more confidence in your software but also more transparency. After all, all tests &lt;strong&gt;do not show that there are no bugs in your program&lt;/strong&gt; &lt;strong&gt;but that at least those defined use cases &lt;a href="http://wiki.c2.com/?TestsCantProveTheAbsenceOfBugs"&gt;work&lt;/a&gt;:&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>