Prometheus Knowledge Patch
Use this skill when upgrading, configuring, querying, integrating, or operating
Prometheus and recent behavior may affect the result. Inspect the deployed
server, image, configuration, and client versions first. Apply version-tagged
guidance only when it matches the deployment, and prefer observed behavior and
the repository's tests over assumptions.
Reference index
| Reference |
Topics |
| Histograms, TSDB, and start timestamps |
Native and classic histograms, TSDB compatibility, retention, WAL, encodings, start timestamps |
| HTTP APIs and observability |
Query and status APIs, OpenAPI, self-metrics, tracing, notification and service metrics |
| Migration, security, and deployment |
Major-upgrade breaks, security floors, containers, logs, removed flags, redirect credentials |
| PromQL |
Language changes, experimental syntax, functions, modifiers, annotations, result corrections |
| Promtool, UI, and feature flags |
Validation and test tooling, UI behavior, feature discovery, current feature-gate constraints |
| Remote storage and OTLP |
Remote read/write, protocol versions, authentication, OTLP translation and delta ingestion |
| Scraping, configuration, and rules |
Scrape negotiation, relabeling, reloads, rule evaluation, alerts, templates |
| Service discovery |
Provider additions, metadata labels, filters, identity, reliability, build tags |
Critical upgrade and security decisions
Patch vulnerable lines before exposing endpoints
- On the 3.11 line, deploy at least 3.11.3. Earlier patch levels can disclose an
AzureAD client secret, accept oversized Snappy remote-read requests, and
expose stored-XSS paths in the UIs.
- Upgrade STACKIT service-discovery users to a fixed 3.12 release because
rendered configuration previously exposed credentials.
- Prometheus 3.13.0 fixes CVE-2026-44990 in the UI and strips credentials and
configured headers when an HTTP redirect crosses hosts.
- Use 3.13.2 or later when CVE-2026-56852 or GHSA-hrxh-6v49-42gf applies.
Read Migration, security, and deployment
before choosing an image or patch level.
Treat the v3 transition as a compatibility migration
- Remove feature gates that became default and replace the former
agent and
remote-write-receiver gates with --agent and
--web.enable-remote-write-receiver.
- Remove the deleted
storage.tsdb.allow-overlapping-blocks,
alertmanager.timeout, and storage.tsdb.retention command-line flags.
- Upgrade through v2.55 before reusing a TSDB with v3. A v3 data directory
cannot be downgraded below v2.55 without abandoning that persistent data.
- Configure Alertmanager API v2 and use Alertmanager 0.16.0 or later.
- Scrapes with a missing, unparsable, or unknown
Content-Type now fail. Fix
the producer or configure fallback_scrape_protocol deliberately.
- UTF-8 metric and label names are accepted by default. Set
metric_name_validation_scheme: legacy globally or per job when old name
validation is required.
- Update log parsing for
log/slog fields such as time, source, and
uppercase level, and update selectors for normalized le and quantile
values such as "1.0".
See Migration, security, and deployment
for the complete transition checklist.
Histograms, storage, and downgrade boundaries
Native histogram activation is configuration-driven
Native histograms are stable starting in v3.9, so native-histograms becomes a
no-op, but scraping them still requires:
global:
scrape_native_histograms: true
Use always_scrape_classic_histograms to retain concurrently exposed classic
histograms; the old scrape_classic_histograms key is obsolete. Global,
per-job, and per-target controls are available, with target relabel labels
providing the narrowest override.
Start-timestamp storage changes data compatibility
st-storage requires XOR2 for float chunks. Native- and float-histogram start
timestamps additionally require histograms-st-encoding. The resulting WAL
records need Prometheus 3.11 or later, and XOR2 or histogram-ST blocks may be
unreadable by older servers and downstream block consumers.
st-synthesis rewrites scraped cumulative values: it drops the first sample
and subtracts it from later samples. It does not apply to remote write or OTLP,
and it changes out-of-order handling and recovery after append failures.
Before enabling these features, read
Histograms, TSDB, and start timestamps.
PromQL compatibility quick reference
- Regular-expression
. matches newlines as well as other characters.
- Duration and float literals are interchangeable, and duration expressions
later become default. Use current
min_of() and max_of() names instead of
the earlier experimental duration min() and max() forms.
- Millisecond range selectors retain their precision rather than rounding to
whole seconds.
histogram_fraction() and histogram_quantile() return no value when classic
and native histograms coexist at the same timestamp.
fill(), fill_left(), and fill_right() supply values for unmatched sides
of a binary expression; later fixes restore group-matched range results.
- Start-timestamp-aware rates cannot be combined with
anchored or smoothed
extended selectors.
sort(), sort_by_label(), and sort_by_label_desc() do nothing in range
queries and now emit warnings.
- Query raw OTLP deltas with aligned
sum_over_time() windows; counter
functions are wrong for natively stored delta values.
Read PromQL before changing rule expressions or relying
on experimental syntax.
Remote storage and OTLP quick reference
- Remote-write HTTP/2 now defaults off. Set
http_config.enable_http2: true
only when retaining the previous behavior is intentional.
- Replace deprecated remote-write input and highest-timestamp metrics with the
WAL-watcher, dropped-sample, and queue-highest-timestamp metrics.
- Remote Write 2 uses “start timestamp” terminology and carries supported
start timestamps, type labels, and unit labels.
- Too-old Remote Write 2 histogram samples return HTTP 400 so senders do not
retry them indefinitely.
- Choose one OTLP delta mode: stateful delta-to-cumulative conversion or raw
native delta ingestion. They are mutually exclusive.
- Validate translated label collisions through
prometheus_api_otlp_translation_warnings_total.
Use Remote storage and OTLP for translation
strategies, identity propagation, authentication, and receiver limits.
Scraping, configuration, and rules quick reference
- Explicitly configure
scrape_protocols when created-timestamp zero injection
must not make protobuf the first negotiation choice.
- Use
extra_scrape_metrics: true globally or per job; the old
extra-scrape-metrics feature gate is deprecated.
- Configuration reloads honor histogram scrape settings and automatic reload
watches referenced rule and scrape files. Automatic reload is stable.
- Invalid remote-write queue settings are rejected while loading configuration.
- Unknown rule dependencies evaluate serially; optional concurrent evaluation
applies only to dependency-free rules and should be bounded with
--rules.max-concurrent-evals.
- API and UI clients must handle the explicit
unknown state for an alerting
rule that has not yet evaluated.
See Scraping, configuration, and rules
for relabel overrides, alert delivery, reload cleanup, and template helpers.
APIs and operational monitoring
- Discover server capabilities at
/api/v1/features and the machine-readable
HTTP contract at /api/v1/openapi.yaml.
- Query endpoints accept
limit. For stats, use only true or all; other
values are deprecated and scheduled for rejection.
- Distinguish
samplesRead storage I/O from totalQueryableSamples evaluator
loads. Enable promql-per-step-stats with stats=all for per-step reads.
- The TSDB status endpoint caps statistics at 10,000 sets.
- Monitor WAL/WBL unknown references, out-of-order distance, stale series,
native histogram head use, OTLP translation warnings, and service-discovery
update timestamps with their dedicated metrics.
- Notification metrics gain an
alertmanager dimension, and each Alertmanager
now has an independent send loop.
Read HTTP APIs and observability before
updating clients, dashboards, alerts, or tracing integrations.
Service discovery and tooling
- Audit relabeling whenever a provider changes metadata labels. In particular,
Hetzner
hcloud no longer exposes __meta_hetzner_datacenter.
- Use provider-side filters where supported to reduce target volume before
relabeling.
promtool debug output is on stderr. Keep stdout separate in pipelines.
- Match
promtool feature flags to gated PromQL syntax during checks, and use
its fuzzy comparisons and explicit test start timestamps for time-sensitive
rules.
- Prefer the feature discovery API over guessing support from a version string.
Consult Service discovery and
Promtool, UI, and feature flags for
provider-specific and command-specific details.
Working method
- Identify the exact server version, image variant, enabled features, storage
formats, remote protocol versions, and relevant client versions.
- Read only the topic references needed for the task and honor their inline
version attributions.
- For upgrades, check security floors, removed options, storage downgrade
boundaries, protocol changes, metric renames, and label-shape changes.
- Validate configurations and rules with the matching
promtool feature
gates, then exercise affected API clients and dashboards.
- Treat experimental formats and syntax as changeable. Preserve a rollback
path before enabling storage encodings or ingestion modes that rewrite data.
1---2name: prometheus-knowledge-patch-23description: Prometheus4license: MIT5---678# Prometheus Knowledge Patch910Use this skill when upgrading, configuring, querying, integrating, or operating11Prometheus and recent behavior may affect the result. Inspect the deployed12server, image, configuration, and client versions first. Apply version-tagged13guidance only when it matches the deployment, and prefer observed behavior and14the repository's tests over assumptions.1516## Reference index1718| Reference | Topics |19|---|---|20| [Histograms, TSDB, and start timestamps](references/histograms-tsdb-start-timestamps.md) | Native and classic histograms, TSDB compatibility, retention, WAL, encodings, start timestamps |21| [HTTP APIs and observability](references/http-apis-observability.md) | Query and status APIs, OpenAPI, self-metrics, tracing, notification and service metrics |22| [Migration, security, and deployment](references/migration-security-deployment.md) | Major-upgrade breaks, security floors, containers, logs, removed flags, redirect credentials |23| [PromQL](references/promql.md) | Language changes, experimental syntax, functions, modifiers, annotations, result corrections |24| [Promtool, UI, and feature flags](references/promtool-ui-feature-flags.md) | Validation and test tooling, UI behavior, feature discovery, current feature-gate constraints |25| [Remote storage and OTLP](references/remote-storage-otlp.md) | Remote read/write, protocol versions, authentication, OTLP translation and delta ingestion |26| [Scraping, configuration, and rules](references/scraping-configuration-rules.md) | Scrape negotiation, relabeling, reloads, rule evaluation, alerts, templates |27| [Service discovery](references/service-discovery.md) | Provider additions, metadata labels, filters, identity, reliability, build tags |2829## Critical upgrade and security decisions3031### Patch vulnerable lines before exposing endpoints3233- On the 3.11 line, deploy at least 3.11.3. Earlier patch levels can disclose an34 AzureAD client secret, accept oversized Snappy remote-read requests, and35 expose stored-XSS paths in the UIs.36- Upgrade STACKIT service-discovery users to a fixed 3.12 release because37 rendered configuration previously exposed credentials.38- Prometheus 3.13.0 fixes CVE-2026-44990 in the UI and strips credentials and39 configured headers when an HTTP redirect crosses hosts.40- Use 3.13.2 or later when CVE-2026-56852 or GHSA-hrxh-6v49-42gf applies.4142Read [Migration, security, and deployment](references/migration-security-deployment.md)43before choosing an image or patch level.4445### Treat the v3 transition as a compatibility migration4647- Remove feature gates that became default and replace the former `agent` and48 `remote-write-receiver` gates with `--agent` and49 `--web.enable-remote-write-receiver`.50- Remove the deleted `storage.tsdb.allow-overlapping-blocks`,51 `alertmanager.timeout`, and `storage.tsdb.retention` command-line flags.52- Upgrade through v2.55 before reusing a TSDB with v3. A v3 data directory53 cannot be downgraded below v2.55 without abandoning that persistent data.54- Configure Alertmanager API v2 and use Alertmanager 0.16.0 or later.55- Scrapes with a missing, unparsable, or unknown `Content-Type` now fail. Fix56 the producer or configure `fallback_scrape_protocol` deliberately.57- UTF-8 metric and label names are accepted by default. Set58 `metric_name_validation_scheme: legacy` globally or per job when old name59 validation is required.60- Update log parsing for `log/slog` fields such as `time`, `source`, and61 uppercase `level`, and update selectors for normalized `le` and `quantile`62 values such as `"1.0"`.6364See [Migration, security, and deployment](references/migration-security-deployment.md)65for the complete transition checklist.6667## Histograms, storage, and downgrade boundaries6869### Native histogram activation is configuration-driven7071Native histograms are stable starting in v3.9, so `native-histograms` becomes a72no-op, but scraping them still requires:7374```yaml75global:76 scrape_native_histograms: true77```7879Use `always_scrape_classic_histograms` to retain concurrently exposed classic80histograms; the old `scrape_classic_histograms` key is obsolete. Global,81per-job, and per-target controls are available, with target relabel labels82providing the narrowest override.8384### Start-timestamp storage changes data compatibility8586`st-storage` requires XOR2 for float chunks. Native- and float-histogram start87timestamps additionally require `histograms-st-encoding`. The resulting WAL88records need Prometheus 3.11 or later, and XOR2 or histogram-ST blocks may be89unreadable by older servers and downstream block consumers.9091`st-synthesis` rewrites scraped cumulative values: it drops the first sample92and subtracts it from later samples. It does not apply to remote write or OTLP,93and it changes out-of-order handling and recovery after append failures.9495Before enabling these features, read96[Histograms, TSDB, and start timestamps](references/histograms-tsdb-start-timestamps.md).9798## PromQL compatibility quick reference99100- Regular-expression `.` matches newlines as well as other characters.101- Duration and float literals are interchangeable, and duration expressions102 later become default. Use current `min_of()` and `max_of()` names instead of103 the earlier experimental duration `min()` and `max()` forms.104- Millisecond range selectors retain their precision rather than rounding to105 whole seconds.106- `histogram_fraction()` and `histogram_quantile()` return no value when classic107 and native histograms coexist at the same timestamp.108- `fill()`, `fill_left()`, and `fill_right()` supply values for unmatched sides109 of a binary expression; later fixes restore group-matched range results.110- Start-timestamp-aware rates cannot be combined with `anchored` or `smoothed`111 extended selectors.112- `sort()`, `sort_by_label()`, and `sort_by_label_desc()` do nothing in range113 queries and now emit warnings.114- Query raw OTLP deltas with aligned `sum_over_time()` windows; counter115 functions are wrong for natively stored delta values.116117Read [PromQL](references/promql.md) before changing rule expressions or relying118on experimental syntax.119120## Remote storage and OTLP quick reference121122- Remote-write HTTP/2 now defaults off. Set `http_config.enable_http2: true`123 only when retaining the previous behavior is intentional.124- Replace deprecated remote-write input and highest-timestamp metrics with the125 WAL-watcher, dropped-sample, and queue-highest-timestamp metrics.126- Remote Write 2 uses “start timestamp” terminology and carries supported127 start timestamps, type labels, and unit labels.128- Too-old Remote Write 2 histogram samples return HTTP 400 so senders do not129 retry them indefinitely.130- Choose one OTLP delta mode: stateful delta-to-cumulative conversion or raw131 native delta ingestion. They are mutually exclusive.132- Validate translated label collisions through133 `prometheus_api_otlp_translation_warnings_total`.134135Use [Remote storage and OTLP](references/remote-storage-otlp.md) for translation136strategies, identity propagation, authentication, and receiver limits.137138## Scraping, configuration, and rules quick reference139140- Explicitly configure `scrape_protocols` when created-timestamp zero injection141 must not make protobuf the first negotiation choice.142- Use `extra_scrape_metrics: true` globally or per job; the old143 `extra-scrape-metrics` feature gate is deprecated.144- Configuration reloads honor histogram scrape settings and automatic reload145 watches referenced rule and scrape files. Automatic reload is stable.146- Invalid remote-write queue settings are rejected while loading configuration.147- Unknown rule dependencies evaluate serially; optional concurrent evaluation148 applies only to dependency-free rules and should be bounded with149 `--rules.max-concurrent-evals`.150- API and UI clients must handle the explicit `unknown` state for an alerting151 rule that has not yet evaluated.152153See [Scraping, configuration, and rules](references/scraping-configuration-rules.md)154for relabel overrides, alert delivery, reload cleanup, and template helpers.155156## APIs and operational monitoring157158- Discover server capabilities at `/api/v1/features` and the machine-readable159 HTTP contract at `/api/v1/openapi.yaml`.160- Query endpoints accept `limit`. For `stats`, use only `true` or `all`; other161 values are deprecated and scheduled for rejection.162- Distinguish `samplesRead` storage I/O from `totalQueryableSamples` evaluator163 loads. Enable `promql-per-step-stats` with `stats=all` for per-step reads.164- The TSDB status endpoint caps statistics at 10,000 sets.165- Monitor WAL/WBL unknown references, out-of-order distance, stale series,166 native histogram head use, OTLP translation warnings, and service-discovery167 update timestamps with their dedicated metrics.168- Notification metrics gain an `alertmanager` dimension, and each Alertmanager169 now has an independent send loop.170171Read [HTTP APIs and observability](references/http-apis-observability.md) before172updating clients, dashboards, alerts, or tracing integrations.173174## Service discovery and tooling175176- Audit relabeling whenever a provider changes metadata labels. In particular,177 Hetzner `hcloud` no longer exposes `__meta_hetzner_datacenter`.178- Use provider-side filters where supported to reduce target volume before179 relabeling.180- `promtool` debug output is on stderr. Keep stdout separate in pipelines.181- Match `promtool` feature flags to gated PromQL syntax during checks, and use182 its fuzzy comparisons and explicit test start timestamps for time-sensitive183 rules.184- Prefer the feature discovery API over guessing support from a version string.185186Consult [Service discovery](references/service-discovery.md) and187[Promtool, UI, and feature flags](references/promtool-ui-feature-flags.md) for188provider-specific and command-specific details.189190## Working method1911921. Identify the exact server version, image variant, enabled features, storage193 formats, remote protocol versions, and relevant client versions.1942. Read only the topic references needed for the task and honor their inline195 version attributions.1963. For upgrades, check security floors, removed options, storage downgrade197 boundaries, protocol changes, metric renames, and label-shape changes.1984. Validate configurations and rules with the matching `promtool` feature199 gates, then exercise affected API clients and dashboards.2005. Treat experimental formats and syntax as changeable. Preserve a rollback201 path before enabling storage encodings or ingestion modes that rewrite data.