1186 Commits

Author SHA1 Message Date
Denys Sedchenko
ca578101af
feat(tsdb/agent): Implement checkpoint based on series in memory (#17948)
Adds CheckpointFromInMemorySeries option for agent.Options to enable a faster checkpoint implementation that skips segment re-read and just uses in-memory data instead.

* feat: impl agent-specific checkpoint dir
* feat: impl ActiveSeries interface
* feat: use new checkpoint impl
* feat: hide new checkpoint impl behind a feature flag
* feat: add benchmark
* feat: add benchstat case
* feat: use feature flag in bench
* feat: use same labels for persisted state and append
* feat: set WAL segment size
* feat: add checkpoint size metric and bump series size
* feat: wal replay test
* feat: expose new checkpoint opts in cmd flags
* feat: update cli doc
* add ActiveSeries and DeletedSeries doc

Signed-off-by: x1unix <9203548+x1unix@users.noreply.github.com>
Signed-off-by: Denys Sedchenko <9203548+x1unix@users.noreply.github.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2026-04-24 19:42:26 +02:00
Julien
551b5b1c56
Merge pull request #17171 from bboreham/aws-external-id
[ENHANCEMENT] AWS SD: Add optional external_id field
2026-04-24 09:41:58 +02:00
Vilius Pranckaitis
321fe34aab
PromQL: use start timestamps for rate()-like calculations (#18344)
* PromQL: use start timestamps for rate() and increase() calculations

* implement start timestamps reset detection for `irate()`
* add `start_timestamps.test`
* add a couple of tests with subqueries
* add a test for cumulative with unknown start timestamp
* update `enable-features` CLI parameter description
* `make cli-documentation`

Signed-off-by: vpranckaitis <vpranckaitis@gmail.com>

---------

Signed-off-by: Vilius Pranckaitis <vpranckaitis@gmail.com>
Signed-off-by: vpranckaitis <vpranckaitis@gmail.com>
2026-04-21 17:43:40 +02:00
GeorgeTyupin
e0ea05665a
cmd/prometheus: add default values for agent min/max retention flags (#18261)
* cmd/prometheus: add default values for agent min/max retention flags

Signed-off-by: GeorgeTyupin <GeorgyTyupin@ya.ru>

* docs: update command-line flags documentation

Signed-off-by: GeorgeTyupin <GeorgyTyupin@ya.ru>

* chore: trigger CI (retry 4)

Signed-off-by: GeorgeTyupin <GeorgyTyupin@ya.ru>

* Reuse db.go constants for agent retention flags to avoid duplication.

Signed-off-by: GeorgeTyupin <GeorgyTyupin@ya.ru>

---------

Signed-off-by: GeorgeTyupin <GeorgyTyupin@ya.ru>
2026-04-21 13:22:15 +02:00
Ayoub Mrini
83962c35a4
test(cmd/prometheus): add TestFeatureFlagsDocumented and adjust --enable-feature description (#18487)
* test(cmd/prometheus): add TestFeatureFlagsDocumented and fix help text

Add TestFeatureFlagsDocumented to ensure the --enable-feature help text
in and docs/feature_flags.md list the same set of flags.

The help text was out of sync with the documentation:
- Flags present in docs but missing from help text: `auto-reload-config`,
  `metadata-wal-records`, `otlp-native-delta-ingestion`,
  `promql-delayed-name-removal`, `type-and-unit-labels`. Added them.
- Flags present in help text but missing from docs: `auto-gomaxprocs`,
  `expand-external-labels`. Removed them.

The help text is now sorted for better readability and kept in sync
with the documentation.

Also, the parsing of an empty `--enable-feature` was changed to
print `msg="Unknown option for --enable-feature" option=""` instead of nothing.

Signed-off-by: Ayoub Mrini <ayoubmrini424@gmail.com>

* main.go remove default for --enable-feature to avoid unwanted

Signed-off-by: Ayoub Mrini <ayoubmrini424@gmail.com>

---------

Signed-off-by: Ayoub Mrini <ayoubmrini424@gmail.com>
2026-04-20 16:08:42 +02:00
Julien
5d0bc055ef
Merge pull request #17877 from roidelapluie/roidelapluie/funcs
PromQL: Add start() end() range() and step() functions
2026-04-17 13:51:37 +02:00
Julien Pivotto
ae9e52c868 PromQL: Add start() end() range() and step() functions
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-16 10:59:23 +02:00
Julius Volz
34cebfe953
Merge pull request #18411 from prometheus/self-metrics-api
Add API endpoint for getting Prometheus' metrics about itself
2026-04-15 14:47:38 +02:00
Julien
12de1243c0
Merge pull request #18518 from prometheus/release-3.11
Merge back release 3.11.2
2026-04-14 10:26:38 +02:00
Julius Volz
034c29411a Use ProtoJSON, allow regex-based filtering of metric names
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-04-10 16:05:40 +02:00
Julius Volz
318c913fe2 Add API endpoint for getting Prometheus' metrics about itself
This adds a /api/v1/status/self_metrics endpoint that allows the frontend to
fetch metrics about the server itself, making it easier to construct frontend
pages that show the current server state. This is needed because fetching
metrics from its own /metrics endpoint would be both hard to parse and also
require CORS permissions on that endpoint (for cases where the frontend
dashboard is not the same origin, at least).

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-04-10 16:05:08 +02:00
Julien
d09ea56b38
Update docs/configuration/configuration.md
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Julien <291750+roidelapluie@users.noreply.github.com>
2026-04-10 14:50:54 +02:00
Julien
485be91363
Merge pull request #18483 from rudo-thomas/patch-1
docs: Copy-paste typo in __meta_kubernetes_namespace in endpointslice role.
2026-04-09 16:22:06 +02:00
Julien Pivotto
1e73d2fcde discovery/consul: add health_filter for Health API filtering
The filter field was documented as targeting the Catalog API but since
PR #17349 it was also passed to the Health API. This broke existing
configs using Catalog-only fields like ServiceTags, which the Health API
rejects (it uses Service.Tags instead).

Introduce a separate health_filter field that is passed exclusively to
the Health API, while filter remains catalog-only. Update the docs to
explain the two-phase discovery (Catalog for service listing, Health for
instances) and the field name differences between the two APIs.

Fixes #18479

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-09 16:03:16 +02:00
Arve Knudsen
56c6370b26
promql: fix info() handling of negated __name__ matchers (#17932)
* promql: fix info() handling of negated __name__ matchers

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-04-08 16:01:27 +00:00
Rudo Thomas
f8f6d53a35
docs: Copy-paste typo in __meta_kubernetes_namespace in endpointslice role.
Signed-off-by: Rudo Thomas <rudo.thomas@gmail.com>
2026-04-08 15:05:09 +02:00
Bryan Boreham
e58f16abc6
Merge pull request #18418 from saikocat/promtool-query-instant-header
promtool: add --header flag to query instant command
2026-04-07 12:23:01 +01:00
Will Bollock
b70a871988
fix(discovery): delete expired refresh metrics on reload (#17614)
Building off config-specific Prometheus refresh metrics from an earlier
PR (https://github.com/prometheus/prometheus/pull/17138), this deletes
refresh metrics like `prometheus_sd_refresh_duration_seconds` and
`prometheus_sd_refresh_failures_total` when the underlying scrape job
configuration is removed on reload. This reduces un-needed cardinality
from scrape job specific metrics while still preserving metrics that
indicate overall health of a service discovery engine.

For example,
`prometheus_sd_refresh_failures_total{config="linode-servers",mechanism="linode"} 1`
will no longer be exported by Prometheus when the `linode-servers`
scrape job for the Linode service provider is removed. The generic,
service discovery specific `prometheus_sd_linode_failures_total` metric
will persist however.

* fix: add targetsMtx lock for targets access

* test: validate refresh/discover metrics are gone

* ref: combine sdMetrics and refreshMetrics

Good idea from @bboreham to combine sdMetrics and refreshMetrics!
They're always passed around together and don't have much of a
reason not to be combined. mechanismMetrics makes it clear what kind of
metrics this is used for (service discovery mechanisms).

---------

Signed-off-by: Will Bollock <wbollock@linode.com>
2026-04-02 13:43:35 +01:00
Frederic Branczyk
b014aa101d
Merge pull request #17601 from joelkbiju12/ft-kubernetes-nodeready-label
discovery: adding kubernetes node condition labels
2026-04-01 18:05:27 +02:00
Hoa
7c0801a926 promtool: add --header flag to query instant command
The `--header` flag was already supported by `promtool query range` but was
missing from `promtool query instant`. This adds the same flag so users can
pass extra HTTP headers (e.g. `X-Scope-OrgID` for multi-tenant setups)
without needing to create an `--http.config.file`.

```
[ENHANCEMENT] promtool: Add `--header` flag to `query instant` command, matching existing `query range` behaviour.
```

Signed-off-by: Hoa <hoameomu@gmail.com>
2026-04-01 17:10:56 +08:00
Aurélien Duboc
fa5960bf08
feat(discovery): add Outscale VM service discovery (#18139)
Add Outscale VM service discovery using osc-sdk-go, including optional secret_key_file support, metrics, docs, and configuration examples. Document the default region (eu-west-2).

Signed-off-by: Aurelien Duboc <aurelienduboc96@gmail.com>
2026-03-31 18:03:51 +02:00
Carrie Edwards
4326d54760
Rename created timestamp to start timestamp in proto (#18368)
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2026-03-31 08:38:45 -07:00
Bryan Boreham
ffb296eed7
Merge pull request #16155 from LukoJy3D/docs/migration/clarify_on_content_type_headers
docs(migration): clarify on content-type headers
2026-03-31 12:58:48 +01:00
Skesov
cf09d9b885
Update docs/configuration/configuration.md
Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Skesov <12987308+Skesov@users.noreply.github.com>
2026-03-30 12:30:14 +03:00
Vladimir Skesov
20ff771593 discovery: add DigitalOcean Managed Databases service discovery
This adds 'databases' role to digitalocean_sd_config to discover DigitalOcean
Managed Database clusters. It follows the multi-role design pattern by
introducing a 'role' parameter (default: 'droplets').

Includes:
- Support for Managed Databases API.
- Pagination handling for Databases API.
- Comprehensive meta labels for database targets.
- Updated documentation and tests.

Signed-off-by: Vladimir Skesov <skesov@gmail.com>
2026-03-30 11:31:17 +03:00
Arve Knudsen
d6c18a4d62
promql: add test and docs for info() behavior when info series goes stale (#18352)
* promql: add test for info() with data label matcher when info series goes stale

When info() is called with a data label matcher that doesn't match
the empty string (e.g. {data=~".+"}), samples at timestamps where
no info series is available should be dropped rather than falling
back to the original un-enriched series.

This case was missing from the test suite.

* docs: document info() behavior when info series is unavailable

Document that when no matching info series exists at a timestamp,
data label matchers that don't match the empty string cause the
sample to be dropped, while empty-matching matchers or no selector
return the series unenriched.

* promql: add test cases for info() fallback when info series goes stale

Add test cases for info(metric, {data=~".*"}) and info(metric) to
complement the existing info(metric, {data=~".+"}) test case, making
the behavioral contrast explicit: empty-matching matchers and no
selector fall back to the unenriched series, while non-empty-matching
matchers drop the sample.

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-03-30 09:32:29 +02:00
Pavel Rysnik
354c0b262a
docs: change 'standard variance' to 'variance'
Update functions.md file, change 'standard variance' to 'variance' in function descriptions

Signed-off-by: Pavel Rysnik <126406830+sakuuj@users.noreply.github.com>
2026-03-23 18:42:45 +03:00
Pavel Rysnik
e680e9bf49
docs: clarify 'stdvar' operator description
Updated the description of the stdvar operator to clarify that it calculates variance instead of standard variance.

Signed-off-by: Pavel Rysnik <126406830+sakuuj@users.noreply.github.com>
2026-03-23 11:12:46 +03:00
Pavel Rysnik
da22492abc
docs: fix 'stdvar' detailed explanation
Signed-off-by: Pavel Rysnik <126406830+sakuuj@users.noreply.github.com>
2026-03-22 18:37:19 +03:00
Julien
16876bab95
Merge pull request #18200 from roidelapluie/roidelapluie/retention-validation
Multiple fixes in retention configuration
2026-03-20 12:27:37 +01:00
Julien Pivotto
1064c26da2 Log retention changes
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-19 17:21:45 +01:00
Jeremy Rickards
530c4bfcc9
docs: clarify that histogram_avg/count/sum/stddev/stdvar are native-histogram-only
The docs for these functions previously described them as acting on
"each histogram sample," which was ambiguous. Add "native" to clarify
they only operate on native histogram samples, not classic histograms.
This distinction was originally documented but lost when the
experimental feature warnings were removed.

Signed-off-by: Jeremy Rickards <jeremy.rickards@sap.com>
2026-03-19 14:33:05 +01:00
Jonas L.
a9d90952ba
Deprecate Hetzner Cloud server datacenter labels (#17850)
[hcloud.Server.Datacenter] is deprecated and will be removed after 1 July 2026. Use [hcloud.Server.Location] instead.

See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters

Changes to Hetzner meta labels:

- `__meta_hetzner_datacenter`
    - is deprecated for the role `robot` but kept for backward compatibility. Using `__meta_hetzner_robot_datacenter` is preferred.
    - is deprecated for the role `hcloud` and will stop working after the 1 July 2026.

-  `__meta_hetzner_hcloud_datacenter_location` label
    - is deprecated but kept for backward compatibility, the same data is available in the [`hcloud.Server.Location`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#Server) struct.
    - using `__meta_hetzner_hcloud_location` is preferred.

-  `__meta_hetzner_hcloud_datacenter_location_network_zone`
    - is deprecated but kept for backward compatibility, the same data is available in the [`hcloud.Server.Location`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#Server) struct.
    - using `__meta_hetzner_hcloud_location_network_zone` is preferred.

- `__meta_hetzner_hcloud_location`
    - replacement label for `__meta_hetzner_hcloud_datacenter_location`

- `__meta_hetzner_hcloud_location_network_zone`
    - replacement label for `__meta_hetzner_hcloud_datacenter_location_network_zone`

- `__meta_hetzner_robot_datacenter`
    - replacement label for `__meta_hetzner_datacenter` with the role `robot`.

Signed-off-by: Jonas Lammler <jonas.lammler@hetzner-cloud.de>
2026-03-19 11:25:01 +01:00
Bartlomiej Plotka
364d70812f
st: disconnect st-storage with xor2-encoding given planned experiments (#18316)
* st: disconnect st-storage with xor2-encoding given planned experiments

Signed-off-by: bwplotka <bwplotka@gmail.com>

* Update docs/feature_flags.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Update docs/feature_flags.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Update docs/feature_flags.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Update docs/feature_flags.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2026-03-19 08:47:42 +00:00
Bartlomiej Plotka
a02e20d98e
Merge branch 'main' into feature/start-time
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-03-17 13:06:25 +01:00
Bartlomiej Plotka
7e2b7e425c
Merge branch 'feature/start-time' into cedwards/document-st-storage
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-03-17 06:21:05 +01:00
Carrie Edwards
870fdf71f1 Update documentation for st-storage feature
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2026-03-16 09:59:36 -07:00
mihir-dixit2k27
c669470f07
docs: add HTTP SD integrations cross-reference (#18278)
* docs: add HTTP SD integrations cross-reference

Signed-off-by: Mihir Dixit <dixitmihir1@gmail.com>

* docs: add HTTP SD integrations cross-reference to configuration.md

Signed-off-by: Mihir Dixit <dixitmihir1@gmail.com>

---------

Signed-off-by: Mihir Dixit <dixitmihir1@gmail.com>
2026-03-16 14:09:54 +01:00
Carrie Edwards
a4a17a77cd Update comments and feature flag description
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2026-03-13 07:43:28 -07:00
Carrie Edwards
b49ad5fc4b Update feature flag description
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2026-03-12 13:24:59 -07:00
Carrie Edwards
7694434044 Document xor2-encoding feature flag
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2026-03-12 11:05:59 -07:00
Charles Korn
24bc6d27ac
docs: clarify that lookback_delta query parameter takes either a duration or number of seconds
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2026-03-06 19:07:33 +11:00
Julius Volz
c023dec14b Docs: Fix Markdown formatting for __name__ label mention
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-03-04 14:22:14 +01:00
Matt
5a02b92c0e
AWS SD: RDS Role (#18206) 2026-03-04 12:17:38 +01:00
Pranshu Srivastava
9d2ed113c8
fixup! fixup! fixup! discovery/kubernetes: Support linked pod controllers
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2026-03-03 18:34:03 +05:30
Pranshu Srivastava
228b94f6eb
discovery/kubernetes: Support linked pod controllers
Extended Kubernetes SD to support the following pod-based labels:
* `__meta_kubernetes_pod_deployment_name`
* `__meta_kubernetes_pod_cronjob_name`
* `__meta_kubernetes_pod_job_name`

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2026-03-03 18:30:48 +05:30
Craig Ringer
158647fb45 Document traceID / spanID injection in query log
Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
2026-02-26 11:48:15 +13:00
George Krajcsovits
5d3f9ee39b
Merge pull request #17904 from linasm/trim_histogram
promql: Implement </ and >/ operators for trimming native histograms
2026-02-24 17:16:24 +01:00
Julien
9d38077e50
Merge pull request #18080 from ldufr/ldufresne/retention-size-percentage
Add percentage based retention
2026-02-24 15:50:36 +01:00
Laurent Dufresne
971143edac Added Retention.Percentage to config file with runtime config reloading
Signed-off-by: Laurent Dufresne <laurent.dufresne@grafana.com>
2026-02-24 15:28:20 +01:00