Skip to content
Back to skills

Prometheus Knowledge Patch

ASecurity

Prometheus

  • 25 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 5, 2026
developmentgoexpressdockerkubernetesawsazureapibackendsecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill prometheus-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prometheus Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prometheus Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-prometheus-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-prometheus-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: prometheus-knowledge-patch
description: Prometheus
version: "3.16.0"
license: MIT
metadata:
  author: Nevaberry
---


# Prometheus Knowledge Patch

Load this skill when upgrading Prometheus, adapting scrape or rule configuration,
writing PromQL, integrating remote storage or OTLP, or diagnosing changed behavior.
Use the topic references for complete configuration, API, and compatibility details.

## Reference index

| Reference | Topics |
| --- | --- |
| [Migration, security, and deployment](references/migration-security-deployment.md) | Removed flags, resource settings, logs, images, authentication, security fixes |
| [Scraping, configuration, and rules](references/scraping-configuration-rules.md) | Protocol negotiation, UTF-8, histogram settings, reloads, rules, Alertmanager |
| [Service discovery](references/service-discovery.md) | Kubernetes, AWS, Azure, Consul, Hetzner, Scaleway, Docker, other providers |
| [PromQL](references/promql.md) | Ranges, duration expressions, extended selectors, start timestamps, labels, histograms |
| [Histograms, TSDB, and start timestamps](references/histograms-tsdb-start-timestamps.md) | Encoding, synthesis, ingestion, retention, compaction, replay, exemplars |
| [Remote storage and OTLP](references/remote-storage-otlp.md) | Transport, metadata, authentication, translation, temporality, federation |
| [HTTP APIs and observability](references/http-apis-observability.md) | Search, statistics, limits, metrics, dashboards, profiling |
| [Promtool, UI, and feature flags](references/promtool-ui-feature-flags.md) | Validation, rule tests, data tools, query editor, administration |

## Breaking changes and deprecations

- Remove `--storage.tsdb.allow-overlapping-blocks`, `--alertmanager.timeout`,
  and `--storage.tsdb.retention` when upgrading.
- Replace `--enable-feature=agent` with `--agent`, and
  `--enable-feature=remote-write-receiver` with `--web.enable-remote-write-receiver`.
- Remove `promql-at-modifier`, `promql-negative-offset`, and `expand-external-labels`
  from `--enable-feature`; their behaviors are enabled by default in Prometheus 3.
- External labels expand `$VAR` and `${VAR}`; undefined variables become empty strings,
  and `$$` produces a literal dollar sign.
- Prometheus preserves supplied target ports. Remove `no-default-scrape-port` and
  check selectors matching `instance` labels with an implicit `:80` or `:443`.
- Prometheus 3 requires Alertmanager 0.16.0 or later and its v2 API.
  Change explicit `alerting.alertmanagers` settings from `api_version: v1` to `api_version: v2`.
- Replace scrape-job `scrape_classic_histograms` with `always_scrape_classic_histograms`.
- Scrapes fail on a missing, malformed, or unsupported `Content-Type` unless the job
  sets `fallback_scrape_protocol`.
- Classic histogram `le` and summary `quantile` labels are normalized on ingestion;
  update exact selectors such as `le="1"` to `le="1.0"`.
  The scraping reference contains relabel rules that preserve old nonnegative integers.
- Remote write defaults HTTP/2 off in Prometheus 3; set `enable_http2: true` to retain it.
- Update log consumers to read `time` and `source` instead of `ts` and `caller` and expect
  uppercase levels such as `INFO`; timestamps can have a numeric timezone offset,
  and `source` can contain a full file path and line number.
- Cross-host redirects strip Authorization credentials and configured headers.
  Configure the destination URL directly when that destination needs authentication.

## Replacing feature flags with configuration

Native histogram scraping is stable and opt-in through `scrape_native_histograms`.
Before upgrading to 3.9, where `--enable-feature=native-histograms` becomes a no-op,
set the value explicitly for jobs that need native histogram scraping, remove the flag,
and verify the scrapes.

Automatic configuration reload is stable and can be used without
`--enable-feature=auto-reload-config`. Edits to referenced rule and scrape configuration
files can trigger reloads, and reverting a failed automatic reload now triggers another reload.

Replace the deprecated `extra-scrape-metrics` flag with global or job-level
`extra_scrape_metrics`. Replace deprecated `--log.level` with `runtime.log_level`;
configuration reloads apply the new log level.

XOR2 float chunk encoding is stable in 3.15.0. Replace the deprecated
`--enable-feature=xor2-encoding` with `storage.tsdb.chunk_encoding.floats: xor2`.
With `st-storage`, that release automatically selects XOR2 and histogram encoding
capable of storing start timestamps. Remove companion `xor2-encoding` and
`histograms-st-encoding` flags when set solely to support `st-storage`.

Duration expressions are enabled by default; `promql-duration-expr` is a no-op.
Rename experimental duration-expression `min()` and `max()` to `min_of()` and `max_of()`.
`first_over_time()` is stable and available by default.
Prometheus 3.16 enables `anchored` and `smoothed` by default, so those queries no longer
require `--enable-feature=promql-extended-range-selectors`.

## Scrapes, UTF-8, and rule configuration

Set `metric_name_validation_scheme: legacy` per job to retain legacy name validation,
or use `global.metric_name_validation_scheme: legacy` across jobs.
A job can opt back into UTF-8 with `metric_name_validation_scheme: utf8`.
The `replace` action's `target_label` and `labelmap` action's `replacement` accept UTF-8
and expand `$name` or `${name}` references, including numbered captures.

`always_scrape_classic_histograms` under `global` retains the classic representation when
targets expose both classic and native histograms. Set
`global.convert_classic_histograms_to_nhcb` for conversion to custom-bucket native histograms.
Target relabeling can override the corresponding settings with
`__always_scrape_classic_histograms__`, `__convert_classic_histograms_to_nhcb__`,
and `__scrape_native_histograms__`, using `"true"` or `"false"`.

A target's `__param_<name>` takes precedence over the job's `params` value.
Rule files support YAML anchors and aliases. Rule names can contain UTF-8 except `{` and `}`.
`--enable-feature=concurrent-rule-eval` evaluates independent rules within a group
concurrently; `--rules.max-concurrent-evals` defaults to `4`.
Uncertain rule dependencies fall back to sequential evaluation.

## PromQL range and matching behavior

Ranges and lookback windows exclude samples exactly at their start. An aligned
`rate(requests_total[1m:1m])` can return no data because it supplies only one sample;
use `rate(requests_total[2m:1m])` to include two one-minute steps.

Use `fill(value)` for a missing match on either side of a binary vector operation,
or `fill_left(value)` / `fill_right(value)` for the specified side.
Enable `--enable-feature=promql-binop-fill-modifiers` on the server and when checking
such rules with `promtool check rules`.

An `anchored` range starts with the latest sample at or before the start within the
lookback delta, falling back to the first in-range sample, and ends at the last
in-range sample. It uses observed values without extrapolation or interpolation.
For `smoothed` in rules, use a group `query_offset` of at least one scrape interval
so samples after the evaluation window are available for interpolation.
Extended range selectors are unavailable on subqueries.

With `--enable-feature=promql-delayed-name-removal`, copy the original metric name
into a regular label after a name-dropping expression, or group by `__name__`.
Evaluating the inner expression by itself can still cause a duplicate-label-set error.

`info()` applies the input selector's `@` or `offset` when evaluating metadata.
Place duration-expression offsets and `@ start()` or `@ end()` after the range selector,
as in `rate(http_requests_total[5m] @ end())`.

## Histograms and start timestamps

`irate()` computes a per-second rate for counter native histograms; `idelta()` computes
the difference for gauge native histograms. Both use 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.
Use `</` to trim a native histogram's upper tail or `>/` to trim its lower tail,
with a scalar cutoff on the right. `histogram_quantiles()` is experimental.

Experimental `--enable-feature=st-storage` preserves start timestamps from scrapes and
OTLP in the TSDB or Agent WAL; stored timestamps can be sent over Remote Write 2.0.
Replaying its `SamplesV2` WAL records requires Prometheus 3.11 or later.
Check XOR2 and histogram start timestamp format support before upgrades, rollbacks,
or shipping blocks; incompatible readers cannot query those blocks.

`--enable-feature=st-synthesis` fills unknown start timestamps for scraped cumulative
metrics by dropping the first sample and subtracting its value from later samples.
A series with one sample can disappear. Cumulative samples without start timestamps
must arrive in order even with `storage.tsdb.out_of_order_time_window` set;
a failed append clears the series reference, so the next sample is dropped again.
Supply start timestamps upstream for OTLP and Remote Write receivers; synthesis runs at scrape time.

With `--enable-feature=use-start-timestamps`, query `start_timestamp(instant-vector)`
and use start timestamps in counter calculations. The PromQL reference distinguishes
the earlier incompatibility with extended selectors from later float-counter reset support.
The `X-Prometheus-Use-Start-Timestamps` HTTP header overrides processing per API query.

## Remote storage and OTLP

TSDB-compatible backends, including third-party `remote_read` implementations, must
return only series matching the requested selectors; unmatched series can cause undefined behavior.
The remote-write receiver rejects Snappy requests with declared decoded sizes over 32 MB.
Remote Write 1.0 skips custom-bucket native histograms and logs a warning;
federation can carry them. Experimental remote-write `convert_nhcb_to_classic` converts
them for a receiver that needs classic histograms.

Enable `--enable-feature=metadata-wal-records` for WAL-backed per-series metadata
with Remote Write 2.0; Agent mode also supports it.
With experimental `type-and-unit-labels`, metadata-derived `__type__` and `__unit__`
overwrite incoming labels and follow `__name__` removal rules. Remote Write 2.0 uses
those label values when they disagree with WAL metadata.

`--enable-feature=otlp-deltatocumulative` accumulates OTLP deltas in memory per series,
discards totals for inactive series, and restarts accumulation from zero after restart.
For native delta ingestion, enable `--enable-feature=otlp-native-delta-ingestion`
with `otlp-deltatocumulative` disabled. It ignores `StartTimeUnixNano` and assigns
the `unknown` metadata type; use `sum_over_time(delta_metric[10m]) / 600` for a rate,
with a window that is a multiple of the collection interval.
Match federation scrape intervals to delta ingestion intervals to avoid miscounting.

## APIs, diagnostics, and tools

Use `limit` on `/api/v1/query` and `/api/v1/query_range` to cap returned series.
Use `stats=true` or `stats=all`; other values are deprecated and will be rejected
in the next major release. With `--enable-feature=promql-per-step-stats`,
`stats=all` includes `samplesReadPerStep`.

Experimental `--enable-feature=search-api` enables fuzzy matching and filtering.
`--web.search.max-limit` defaults to `10000`; larger explicit limits return HTTP 400.
It clamps the default response limit of `100`; a cap of `0` removes explicit-request limits.
Search warns when participating remote-read backends lack search support.

Remote-write metric replacements and removed Remote Write 2.0 metadata metrics are
listed in the observability reference for dashboard and alert updates.
`GET /api/v1/features` discovers server features; `GET /api/v1/openapi.yaml` serves
the OpenAPI 3.2 specification; `GET /api/v1/status/self_metrics` returns current metrics as JSON.

Use `promtool check config --lint=too-long-scrape-interval prometheus.yml` to flag
overly long scrape intervals, and `promtool check rules --ignore-unknown-fields rules.yml`
for rule files with extra fields. `fuzzy_compare: true` in rule tests tolerates
differences in the last bit of the floating-point mantissa.
Promtool debug output goes to stderr; command output goes to stdout.

Files in this skill

  • SKILL.md10.4 KB
  • coverage.json1.9 KB
  • references/histograms-tsdb-start-timestamps.md7.6 KB
  • references/http-apis-observability.md4.5 KB
  • references/migration-security-deployment.md4.9 KB
  • references/promql.md6.7 KB
  • references/promtool-ui-feature-flags.md5.6 KB
  • references/remote-storage-otlp.md6.8 KB
  • references/scraping-configuration-rules.md5.9 KB
  • references/service-discovery.md4.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.