The post has been translated automatically. Original language: Russian
On September 7, 2026, Prometheus 3.13.3 was released, a patch to branch 3.13, which the project announced as a long-term support (LTS) release on July 1, 2026. There are no new features in it, but seven defects have been closed and two dependencies with security notifications have been raised. One defect is more interesting than monitoring: it shows how optimizing regular expressions quietly breaks the correctness of the selection.
Case-insensitive regular expressions lost their matches
Prometheus's Fast regular expression matcher can speed up matching by cutting out a fixed prefix and suffix from a template and comparing them directly. For case-insensitive matching, this optimization relied on an incorrect assumption.: that simplified case folding in Unicode preserves the length of a character in bytes. This is not the case — the Latin "k" is collapsed with the Kelvin sign U+212A, which takes up three bytes. The matcher sliced the input string along byte boundaries that did not match the character boundaries, and discarded the values it was required to accept.
The edit description contains three cases: the pattern `(?i)k.*` did not match the string "Kelvin", the pattern `(?i)(ka.+|kb.+)` — with the string "Ka", and the template `.*(?i:k)` — with the string "abcK". The defect came from two earlier optimizations of the prefix and suffix, meaning it wasn't released yesterday. The correction compares the prefix and suffix character by character, taking into account the case folding, and passes on exactly those bytes that were actually consumed. The fee for correctness is meager: the microbenchmark on ASCII inputs showed an increase from 30.7 to 36.5 nanoseconds per four calls.
Storage: compaction, deleted series and corrupted data
Three edits relate to the local time series storage:
- requests for data that arrived late blocked compaction for a long time, which increased memory consumption.;
- deleted series led to missing counts and errors after restarting the process.;
- when opening the damaged storage, goroutines and file descriptors leaked, and on Windows, unclosed descriptors prevented the data directory from being deleted.
Shutdown and exploration of services
Two more edits about stopping the process: the metrics collection manager and the alert subsystem went into one hundred percent CPU usage at shutdown. In the case of alerting, this broke the correct completion — the process did not have time to stop and was finished off by timeout. Separately, the panic in the exploration of Docker Swarm services when working with plug-ins and network connections has been eliminated. The klauspost/compress compression library was lifted from the dependencies to version 1.18.7 and the x/crypto cryptographic package from the standard set of Go language extensions to version 0.55.0 — both according to notifications from the Go vulnerability database.
What does this mean in practice?
The patch is inside the LTS branch, you can update it without much hesitation, but a couple of things deserve to be checked.
Firstly, the defect with the register did not give an error, but an incomplete answer. If you have rules for recording or case—insensitive alerts — for example, selecting instances or environments based on a template- some of the episodes might not be included in them, and it was impossible to notice this from the logs. The update will not recalculate the history recorded by such rules: if the data is important, you will have to regenerate it manually.
Secondly, one hundred percent CPU usage during shutdown is a typical reason for "mysteriously long" restarts running systemd or in a container: the process does not respond, it is killed by timeout, and the unclosed storage is then opened with recovery. If you've regularly seen timeout kills on restart, this edit explains some of these cases.
Thirdly, it is easy to get a compression lock when receiving metrics from remote agents with time running out on the hosts: memory growth looks like a leak, although the reason is stuck compression. Before updating, you should remove the current memory values so that you can see the difference after restarting.
The draft text was prepared with the participation of AI, the facts were checked against the original source — the official notes for the release of Prometheus 3.13.3 on GitHub.
7 сентября 2026 года вышел Prometheus 3.13.3 — патч к ветке 3.13, которую проект 1 июля 2026 года объявил выпуском с длительной поддержкой (LTS). Новых возможностей в нём нет, зато закрыты семь дефектов и подняты две зависимости с уведомлениями о безопасности. Один дефект интересен шире мониторинга: он показывает, как оптимизация регулярных выражений тихо ломает корректность выборки.
Регулярные выражения без учёта регистра теряли совпадения
Быстрый матчер регулярных выражений в Prometheus умеет ускорять сопоставление, вырезая из шаблона фиксированный префикс и суффикс и сравнивая их напрямую. Для сопоставления без учёта регистра эта оптимизация опиралась на неверное допущение: что упрощённое сворачивание регистра в Unicode сохраняет длину символа в байтах. Это не так — латинская «k» сворачивается со знаком Кельвина U+212A, который занимает три байта. Матчер нарезал входную строку по границам байтов, не совпадающим с границами символов, и отбрасывал значения, которые обязан был принять.
В описании правки приведены три случая: шаблон `(?i)k.*` не совпадал со строкой «Kelvin», шаблон `(?i)(ka.+|kb.+)` — со строкой «Ka», а шаблон `.*(?i:k)` — со строкой «abcK». Дефект пришёл из двух более ранних оптимизаций префикса и суффикса, то есть попал в релизы не вчера. Исправление сравнивает префикс и суффикс посимвольно, с учётом сворачивания регистра, и передаёт дальше ровно те байты, которые были реально потреблены. Плата за корректность мизерная: микробенчмарк на ASCII-входах показал рост с 30,7 до 36,5 наносекунды на четыре вызова.
Хранилище: компакция, удалённые серии и повреждённые данные
Три правки касаются локального хранилища временных рядов:
- запросы к данным, пришедшим с опозданием, надолго блокировали компакцию, из-за чего росло потребление памяти;
- удалённые серии приводили к пропаже отсчётов и ошибкам после перезапуска процесса;
- при открытии повреждённого хранилища утекали горутины и файловые дескрипторы, а на Windows незакрытые дескрипторы мешали удалить каталог с данными.
Завершение работы и разведка сервисов
Ещё две правки про остановку процесса: менеджер сбора метрик и подсистема алертинга при завершении работы уходили в стопроцентную загрузку процессора. В случае алертинга это ломало корректное завершение — процесс не успевал остановиться и его добивали по таймауту. Отдельно устранена паника в разведке сервисов Docker Swarm при работе с плагинами и сетевыми подключениями. Из зависимостей подняты библиотека сжатия klauspost/compress до версии 1.18.7 и криптографический пакет x/crypto из стандартного набора расширений языка Go до версии 0.55.0 — обе по уведомлениям из базы уязвимостей Go.
Что это значит на практике
Патч внутри LTS-ветки, обновляться можно без долгих раздумий, но пара вещей заслуживает проверки.
Во-первых, дефект с регистром давал не ошибку, а неполный ответ. Если у вас есть правила записи или алерты с сопоставлением без учёта регистра — например, отбор инстансов или окружений по шаблону, — часть серий могла в них не попадать, и заметить это по логам было невозможно. Историю, записанную такими правилами, обновление не пересчитает: если данные важны, придётся перегенерировать их вручную.
Во-вторых, стопроцентная загрузка процессора при остановке — типичная причина «загадочно долгих» рестартов под управлением systemd или в контейнере: процесс не отвечает, его убивают по таймауту, а незакрытое хранилище потом открывается с восстановлением. Если вы регулярно видели убийство по таймауту при перезапуске, эта правка объясняет часть таких случаев.
В-третьих, блокировку компакции легко получить при приёме метрик от удалённых агентов с разъехавшимся временем на хостах: рост памяти выглядит как утечка, хотя причина в застрявшей компакции. Перед обновлением стоит снять текущие показатели памяти, чтобы после перезапуска увидеть разницу.
Черновик текста подготовлен с участием ИИ, факты сверены с первоисточником — официальные заметки к выпуску Prometheus 3.13.3 на GitHub.