Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Prometheus Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-prometheus-knowledge-patch-nevaberry-plugins)
---
name: prometheus-knowledge-patch
description: Prometheus
version: "3.16.0"
license: MIT
metadata:
author: Nevaberry
---
# Prometheus Compatibility
Load this skill when upgrading or configuring Prometheus, writing PromQL and
rules, troubleshooting ingestion or storage, or integrating its HTTP APIs.
Use the topic references for complete configuration details and examples.
## Reference index
| Reference | Topics |
| --- | --- |
| [Migration, security, operations](references/migration-security-operations.md) | Removed flags, runtime settings, reloads, containers, builds, security fixes |
| [Scraping and ingestion](references/scraping-and-ingestion.md) | UTF-8, relabeling, protocols, histogram settings, start timestamps, staleness |
| [Service discovery](references/service-discovery.md) | Kubernetes, AWS, Azure, Consul, Hetzner, Docker, other cloud providers |
| [OTLP ingestion](references/otlp-ingestion.md) | Translation, attributes, metadata, temporality, exemplars, receiver behavior |
| [Remote I/O and authentication](references/remote-io-and-auth.md) | Remote read/write, federation, OAuth2, Azure, SigV4, Alertmanager |
| [Histograms, TSDB, storage](references/histograms-tsdb-and-storage.md) | Encoding, validation, WAL, retention, compaction, restart behavior |
| [PromQL, rules, templates](references/promql-rules-and-templates.md) | Range semantics, matching, metadata, histograms, experimental functions, alerts |
| [APIs, promtool, observability](references/apis-promtool-and-observability.md) | Query/status/search APIs, statistics, checks, tests, dumps, UI controls |
## Breaking changes and deprecations
### Startup and configuration migration
Remove `--storage.tsdb.allow-overlapping-blocks`, `--alertmanager.timeout`, and
`--storage.tsdb.retention` from startup arguments when upgrading.
Replace `--enable-feature=agent` with `--agent` and
`--enable-feature=remote-write-receiver` with `--web.enable-remote-write-receiver`.
Prometheus 3 enables `promql-at-modifier` and `promql-negative-offset` behavior
by default and warns if those feature names remain in `--enable-feature`.
Remove `expand-external-labels`: `$VAR` and `${VAR}` expand by default in
`global.external_labels`; undefined variables become empty strings and `$$`
produces a literal dollar sign.
Replace `scrape_classic_histograms` with `always_scrape_classic_histograms`.
Prometheus preserves supplied target ports; remove `no-default-scrape-port` and
check selectors for `instance` labels containing an implicit `:80` or `:443`.
Unchanged discoveries continue through reloads; remove `new-service-discovery-manager`.
Prometheus 3 requires Alertmanager 0.16.0 or later and its v2 API. Change explicit
`api_version: v1` under `alerting.alertmanagers` to `api_version: v2`.
Outgoing remote write disables HTTP/2 by default; set `enable_http2: true` on
the corresponding `remote_write` entry to retain it.
### Scrape and selector contracts
A missing, malformed, or unsupported scrape `Content-Type` fails the scrape
unless the job sets `fallback_scrape_protocol`.
Set `global.metric_name_validation_scheme: legacy` for legacy name validation;
a job can opt back into UTF-8 with `metric_name_validation_scheme: utf8`.
Jobs can also independently select `metric_name_validation_scheme: legacy`.
Ingested classic histogram `le` and summary `quantile` labels are normalized.
Update exact selectors such as `le="1"` to `le="1.0"`; the scraping reference
contains rules for preserving old nonnegative integer values.
TSDB-compatible backends, including third-party `remote_read` implementations,
must return only series matching the requested selectors. Unmatched series
can produce undefined behavior.
### Query syntax and monitoring migrations
Ranges and lookback windows exclude samples exactly at their start.
An aligned `rate(requests_total[1m:1m])` can have only one sample and return no
data; `rate(requests_total[2m:1m])` includes two one-minute steps.
Rename `min()` and `max()` in experimental duration expressions to `min_of()`
and `max_of()`. In 3.15.0, duration-expression offsets and `@ start()` or
`@ end()` must follow the range selector, as in
`rate(http_requests_total[5m] @ end())`.
Use `stats=true` or `stats=all` for query statistics. Other values receive a
deprecation warning in 3.14.0 and will be rejected in the next major release.
Read rules pagination tokens from `groupNextToken`, replacing the old literal
JSON key `groupNextToken:omitempty`.
Remote-write input counters have replacements in the remote I/O reference.
Remote Write 2.0 queues no longer expose `prometheus_remote_storage_metadata_total`,
`prometheus_remote_storage_metadata_failed_total`,
`prometheus_remote_storage_metadata_retried_total`, or
`prometheus_remote_storage_metadata_bytes_total`; check dashboards and alerts.
### Runtime, credentials, and deployment
Read log fields `time` and `source` in place of `ts` and `caller`; levels are
uppercase. Timestamps can include numeric timezone offsets, and `source` can
include a full file path and line number.
In 3.15.0, use reloadable `runtime.log_level` instead of deprecated `--log.level`.
Cross-host redirects strip Authorization credentials and configured headers.
Configure the destination URL directly when it needs authentication.
The 3.13.5 and 3.15.1 images remove trust for `emSign ECC Root CA - G3` and
`Comodo AAA Services root`; TLS connections relying on either root can fail.
The `-distroless` image runs as `65532:65532` and has no `VOLUME` declaration.
Mount `/prometheus` explicitly for persistence and give that identity write
access to reused volumes. Prometheus 2.55 is the oldest version able to read
a Prometheus 3.0 TSDB.
## Configuration and feature transitions
| Task | Guidance |
| --- | --- |
| Native histogram scraping | Set `scrape_native_histograms` explicitly; `--enable-feature=native-histograms` becomes a no-op in 3.9. |
| Automatic reload | Stable in 3.12.0 without `--enable-feature=auto-reload-config`; referenced rule and scrape configuration edits can trigger reloads. |
| Extra scrape metrics | Replace deprecated `extra-scrape-metrics` with global or per-job `extra_scrape_metrics`. |
| Float chunk encoding | In 3.15.0, replace deprecated `--enable-feature=xor2-encoding` with `storage.tsdb.chunk_encoding.floats: xor2`. |
| Duration expressions | Enabled by default; `promql-duration-expr` is a no-op. |
| First sample | `first_over_time()` is stable and enabled by default. |
| Extended ranges | Prometheus 3.16 enables `anchored` and `smoothed` without `promql-extended-range-selectors`. |
Prometheus derives `GOMEMLIMIT` from the Linux container memory limit, falling
back to total system memory, and `GOMAXPROCS` from the container CPU quota.
Disable them with `--no-auto-gomemlimit` and `--no-auto-gomaxprocs`, respectively.
Use `--auto-gomemlimit.refresh-interval` to periodically redetect the memory limit.
## PromQL and rules
Use `--enable-feature=promql-binop-fill-modifiers` for `fill(value)` on binary
vector operations when a matching series is absent. `fill_left(value)` and
`fill_right(value)` supply a default only on the specified side.
```promql
rate(http_request_errors_total[5m]) / fill_left(0) rate(http_requests_total[5m])
```
An `anchored` range starts with the latest sample at or before its start within
the lookback delta, falling back to its first in-range sample, and ends with
its last in-range sample. It uses observed changes without extrapolation or
interpolation. With `smoothed`, use a rule-group `query_offset` of at least one
scrape interval so samples after the window are available for interpolation.
Extended range selectors are unavailable on subqueries.
With `--enable-feature=use-start-timestamps`, `rate()`, `irate()`, and
`increase()` use sample start timestamps, and `resets()` considers their changes.
This mode is incompatible with extended range selectors in 3.12.0; in
Prometheus 3.16 it detects float-counter resets with `anchored` or `smoothed`.
The `X-Prometheus-Use-Start-Timestamps` header overrides processing per API query.
Enable `--enable-feature=concurrent-rule-eval` for independent rules in a group.
`--rules.max-concurrent-evals` defaults to `4`. Uncertain dependencies use
sequential evaluation. Rule names accept UTF-8 except `{` and `}`.
With `promql-delayed-name-removal`,
`sum by (__name__) (rate({job="api"}[5m]))` groups by original metric names;
`sum(rate({job="api"}[5m]))` keeps one aggregate across metric names.
## Histograms and storage
`irate()` computes a per-second rate for counter native histograms; `idelta()`
computes the difference for gauge native histograms, using the last two samples.
`histogram_quantile()` and `histogram_fraction()` omit a histogram's result when
its classic and native representations coexist at the same evaluation timestamp.
Histogram samples count toward PromQL's sample limit.
Set `global.convert_classic_histograms_to_nhcb` for default classic-to-native
conversion. Set global `always_scrape_classic_histograms` to retain the classic
representation when both are exposed. Target relabeling can override settings
through `__convert_classic_histograms_to_nhcb__`,
`__always_scrape_classic_histograms__`, and `__scrape_native_histograms__`.
Experimental `--enable-feature=st-storage` preserves start timestamps in the
TSDB or Agent WAL. In 3.15.0 it automatically selects XOR2 for floats and
start-timestamp-capable histogram encoding; remove companion `xor2-encoding`
and `histograms-st-encoding` flags set solely to support it.
Replaying its `SamplesV2` WAL records requires Prometheus 3.11 or later.
Check reader support for XOR2 and histogram start timestamp formats before
upgrading, rolling back, or shipping blocks to another system.
Set `storage.tsdb.retention.percentage` to cap storage by disk-capacity percentage.
Removing a retention setting on reload restores the corresponding CLI value.
## OTLP and remote write
`NoUTF8EscapingWithSuffixes` preserves UTF-8 names while keeping metric suffixes;
`UnderscoreEscapingWithoutSuffixes` keeps underscore escaping without generated
type and unit suffixes. Use `promote_all_resource_attributes` with
`ignore_resource_attributes` to promote attributes selectively.
`--enable-feature=otlp-deltatocumulative` accumulates per-series totals in memory,
discards inactive totals, and restarts accumulation from zero after a restart.
For native deltas, enable `--enable-feature=otlp-native-delta-ingestion` with
`otlp-deltatocumulative` disabled. The receiver ignores `StartTimeUnixNano` and
assigns the `unknown` metadata type. Sum deltas over a multiple of the collection
interval and divide by the window in seconds for a per-second rate.
```promql
sum_over_time(delta_metric[10m]) / 600
```
`st-synthesis` runs at scrape time: it drops the first sample, subtracts its
value from subsequent samples, and can make a single-sample series disappear.
Supply start timestamps upstream for OTLP and Remote Write receivers.
Enable `--enable-feature=metadata-wal-records` for WAL-backed Remote Write 2.0
per-series metadata; Agent mode also supports the flag.
## APIs and promtool
Use `limit` on `/api/v1/query` and `/api/v1/query_range` to cap returned series.
`GET /api/v1/features` discovers server features; `/api/v1/status/self_metrics`
returns current self-metrics as JSON. The experimental search API uses
`--enable-feature=search-api`; `--web.search.max-limit` defaults to `10000`.
Search warns when participating remote-read storage lacks search support.
Use `promtool check config --lint=too-long-scrape-interval prometheus.yml` for
scrape interval linting and `promtool check rules --ignore-unknown-fields rules.yml`
for rule files with extra fields. Set `fuzzy_compare: true` in rule tests to
tolerate last-mantissa-bit differences. `promtool test rules` honors
`--enable-feature` during evaluation; debug output goes to stderr.