1115 Commits

Author SHA1 Message Date
Arthur Silva Sens
1e317d0098
Add configuration option to control extra-scrape-metrics (#17606) 2026-01-06 09:00:49 -03:00
Julien Pivotto
bbd1e63783 docs: Update API documentation for missing features
- Add stats parameter documentation for query endpoints.
- Add documentation for new /api/v1/scrape_pools endpoint (added in v2.42).

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-02 17:35:41 +01:00
Joe Adams
b6c230f324
Merge pull request #17599 from matt-gp/aws-ecs-sd-networking
[BUGFIX] AWS SD: ECS Discover Instance Using Host/Bridge Networking Mode
2025-12-27 20:58:56 -05:00
Julien
48e6f6a751
Merge pull request #17670 from roidelapluie/roidelapluie/promql-range
PromQL: duration expression: add range()
2025-12-26 16:31:18 +01:00
matt-gp
9b6e244b83
AWS SD: ECS Bridge Mode
Previously the AWS SD ECS Role only discovered instances that used
`awsvpc` network mode, which attaches a dedicated Elastic Network
Interface (ENI). This change adds in additional logic so that we
discover instances that are using `host` and `bridge` networking modes,
where the IP address is that of the EC2 instance that is hosting the
container. Also this change exposes a number of additional labels that
relate to the EC2 instance when the launch type is `EC2`.

Signed-off-by: matt-gp <small_minority@hotmail.com>
2025-12-25 19:26:14 +00:00
Jan Fajerski
45cf485168
Merge pull request #17639 from JorTurFer/oauth-docs
chore: Update docs to reflect new oauth parameters
2025-12-18 13:41:37 +01:00
Aditya Tiwari
146080186d
promtool: Add --lint flag to check metrics command to allow disabling linting (#17669)
* promtool: allow cardinality with metrics linting and add --lint to check metrics

Signed-off-by: ADITYA TIWARI <adityatiwari342005@gmail.com>

* fix/ci: Simplify test case variable declaration

Remove unnecessary variable declaration in test cases.

Signed-off-by: ADITYA TIWARI <142050150+ADITYATIWARI342005@users.noreply.github.com>

* promtool: avoid Tee for --lint=none

Signed-off-by: ADITYA TIWARI <adityatiwari342005@gmail.com>

* promtool: validate at least one feature enabled in check metrics
addresses feedback to ensure the command does something useful
now fails with clear error when both --lint=none and no --extended flag.

Signed-off-by: ADITYA TIWARI <adityatiwari342005@gmail.com>

---------

Signed-off-by: ADITYA TIWARI <adityatiwari342005@gmail.com>
Signed-off-by: ADITYA TIWARI <142050150+ADITYATIWARI342005@users.noreply.github.com>
2025-12-18 10:19:06 +00:00
Jorge Turrado Ferrero
cdc31d96f9
feat: Document how to authenticate STACKIT Service Accounts using RFC7523 (#17645) 2025-12-16 22:50:51 +01:00
Bryan Boreham
6f18cc3074
Merge pull request #13409 from smallfish/feature/promtool-dump-series
promtool: add dump-series
2025-12-16 11:51:06 +00:00
Bryan Boreham
ad5951f1da
Merge pull request #14317 from anarcat/wal-backups
Explain how to ignore WAL files when cleaning up.
2025-12-16 11:35:43 +00:00
Julien Pivotto
d0b122a711 PromQL: duration expression: add range()
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-12-10 16:27:18 +01:00
Julien
f73aba34cd
Merge pull request #17427 from roidelapluie/roidelapluie/ffapi
API: Add a /api/v1/features endpoint
2025-12-10 10:14:03 +01:00
Julien Pivotto
a5671a002f API: Add a /api/v1/features endpoint
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-12-09 16:13:14 +01:00
Julien
e77dd5bec2
Merge pull request #17647 from roidelapluie/roidelapluie/resource-limit-fix
web/api: Add maximum limit validation to TSDB status endpoint
2025-12-09 16:06:09 +01:00
Julien Pivotto
5b26619565 web/api: Add maximum limit validation to TSDB status endpoint
Add a maximum limit of 10,000 to the TSDB status endpoint to prevent
resource exhaustion from excessively large limit values, as we preallocate
[]Stat for up to the limit: `make([]Stat, 0, length)`.

Note that the endpoint acquires a cardinality mutex during
stats calculation, so this can not be run in parallel.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-12-09 14:30:08 +01:00
Jorge Turrado
f0325c5875 apply feedback
Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
2025-12-04 16:00:18 +01:00
Julien
0279e14d4a
Merge pull request #17636 from roidelapluie/roidelapluie/starttime
Add start_timestamp field for unit tests
2025-12-04 10:47:24 +01:00
Julien Pivotto
1a853e23db Add start_timestamp field for unit tests.
This commit adds support for configuring a custom start timestamp
for Prometheus unit tests, allowing tests to use realistic timestamps
instead of starting at Unix epoch 0.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-12-03 11:20:23 +01:00
Jorge Turrado Ferrero
e69806289a chore: Update docs to reflect new oauth parameters
Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
2025-12-02 22:52:46 +01:00
Gabriel Filion
9f0b52d73a docs: Describe how time() is set to start at 0 in unit tests
The return value of functions relating to the current time, e.g. time(),
is set by promtool to start at timestamp 0 at the start of a test's
evaluation.

This has the very nice consequence that tests can run reliably without
depending on when they are run.

It does, however, mean that tests will give out results that can be
unexpected by users.

If this behaviour is documented, then users will be empowered to write
tests for their rules that use time-dependent functions.

(Closes: prometheus/docs#1464)

Signed-off-by: Gabriel Filion <lelutin@torproject.org>
2025-12-02 16:57:01 +01:00
Ben Edmunds
0e682a70a6
RW2: Allow custom scope in azuread (#17483)
Signed-off-by: Ben Edmunds <sammybenblue2@gmail.com>
2025-12-02 11:45:23 +00:00
Łukasz Mierzwa
8a1086a128
feat: Add flag that blocks lvl 1 compactions until upload is confirmed in an external JSON file (#17435)
* Delay compactions until Thanos uploads all blocks

Using Thanos sidecar with Prometheus requires us to disable TSDB compactions on Prometheus side by setting --storage.tsdb.min-block-duration and --storage.tsdb.max-block-duration to the same value. See https://thanos.io/tip/components/sidecar.md. The main problem this avoids is that Prometheus might compact given block before Thanos uploads it, creating a gap in Thanos metrics. Thanos does not upload compacted blocks because that would upload the same sample multiple times. You can tell Thanos to upload compacted blocks but that is aimed at one time migrations. This patch creates a bridge between Thanos and Prometheus by allowing Prometheus to read the shipper file Thanos creates, where it tracks which blocks were already uploaded, and using that data delays compaction of blocks until they are marked as uploaded by Thanos. Thanks to this both services can coordinate with each other (in a way) and we can stop disabling compaction on Prometheus side when Thanos uploads are enabled.

The reason to have this is that disabling compactions have very dramatic performance cost. Since most time series exist for longer than a single block duration (2h by default) large chunks of block index will reference the same series, so 10 * 2h blocks will each have an index that is usually fairly big and is almost the same for all 10 blocks. Compaction de-duplicates the index so merging 10 blocks together would leave us with a single index that is around the same size as each of these 10 2h blocks would have (plus some extra for series that only exists in some blocks, but not all). Every range query that iterates over all 10 blocks would then have to read each index and so we're doing 10x more work then if we had a single compacted block.

Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>

* Rename structs and functions to make this more generic

Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>

* Address review comments

Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>

* Cache UploadMeta for 1 minute

Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>

---------

Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>
2025-12-02 10:39:45 +00:00
Ben Kochie
d0d2699dc5
Update Prometheus Agent doc (#17591)
* Add a nav title to fix docs website generator.
* Make it more clear that "Prometheus Agent" is a mode, not a seaparate
  service.
* Add to index.
* Cleanup some wording.
* Add a downsides section.

Signed-off-by: SuperQ <superq@gmail.com>
2025-11-21 11:34:19 +01:00
beorn7
be4efd740c cmd: Make feature flag native-histograms a no-op.
Signed-off-by: beorn7 <beorn@grafana.com>
2025-11-16 23:22:02 +01:00
zenador
c64dd612ef
PromQL: Fix bug with inconsistent results for queries with OR expression and EnableDelayedNameRemoval (#17161)
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: zenador <zenador@users.noreply.github.com>
Co-authored-by: Björn Rabenstein <github@rabenste.in>
2025-11-15 21:07:36 +01:00
Raul Leite
407b697ee2
structure adjusted as reccomended
Corrected the structure of the explanation regarding how samples are organized in the chunks directory and the handling of deletion records.

Signed-off-by: Raul Leite <sp4wn.root@gmail.com>
2025-11-15 10:55:26 -06:00
Raul Leite
c9827ef983
Fix formatting in storage.md
extra space removed

Signed-off-by: Raul Leite <sp4wn.root@gmail.com>
2025-11-15 10:52:18 -06:00
Raul Leite
e022a727a8 I’ve proposed a slight rewording of this section to improve clarity and readability. (On-Disk Layout Paragraph)
Signed-off-by: Raul Leite <sp4wn.root@gmail.com>
2025-11-14 15:31:21 -06:00
Bartlomiej Plotka
f50ff0a40a
feat: rename CreatedTimestamp to StartTimestamp (#17523)
Partially fixes https://github.com/prometheus/prometheus/issues/17416 by
renaming all CT* names to ST* in the whole codebase except RW2 (this is
done in separate
[PR](https://github.com/prometheus/prometheus/pull/17411)) and
PrometheusProto exposition proto.

```
CreatedTimestamp -> StartTimestamp
CreatedTimeStamp -> StartTimestamp
created_timestamp -> start_timestamp
CT -> ST
ct -> st

```

Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-11-13 14:17:51 +00:00
Bryan Boreham
e02a65b6bd
Merge pull request #17138 from wbollock/feat/prometheus_refresh_config_label
feat(metrics): add config label to refresh metrics
2025-11-13 14:51:39 +01:00
Bryan Boreham
beea578b20 Make dump-series a --format flag on the dump command
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-11-10 18:07:23 +00:00
smallfish
5560397a70 promtool: add dump-series
Signed-off-by: smallfish <smallfish.xy@gmail.com>
2025-11-10 17:13:33 +00:00
Charles Korn
0fbe5af961
Fix heading for limitk docs
Signed-off-by: Charles Korn <charleskorn@users.noreply.github.com>
2025-11-10 11:55:30 +11:00
Jan Fajerski
198d665eac
Merge pull request #17304 from Devansh-ops/docs/sigv4-fips-sts-endpoint
docs: add `use_fips_sts_endpoint` to sigv4 config
2025-11-07 14:38:53 +01:00
Jan Fajerski
ef05508ae0
Merge pull request #14519 from mercenarysre/prometheus-agent-documentation
Docs: Prometheus Agent Documentation
2025-11-07 14:33:54 +01:00
matt-gp
1b52ab9e3b
feat: AWS ECS Service Discovery
Signed-off-by: matt-gp <small_minority@hotmail.com>
2025-11-06 22:48:07 +00:00
Julius Volz
0093e2159e
Merge pull request #17337 from prometheus/ui/visualize-relabel-steps
ui: Allow viewing detailed relabeling steps for each discovered target
2025-11-02 13:51:55 +01:00
Minh Nguyen
9f93c2d2e1
promtool: Add Remote Write 2.0 support to push metrics command (#17417)
* add feature flag for remote write v2

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* change from number to protobuf_message

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* fix test

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* fix name

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* run make cli-documentation

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* fix help

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* run make cli-documentation

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

---------

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
2025-10-31 11:38:40 +00:00
Minh Nguyen
c8f1de18a7
[RW2] Fix type and unit labels propagation in Remote Write v2 receiver to prioritize type-and-unit-labels feature (#17387)
* fix

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* fix nits & update docs

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* fix docs

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

---------

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
2025-10-31 08:59:03 +00:00
geogrego
58dbe927d5 docs: minor improvement for docs
Signed-off-by: geogrego <geogrego@outlook.com>
2025-10-29 14:42:14 +08:00
Minh Nguyen
ad4b59c504
tsdb: Deprecate retention flags; add tsdb.retention runtime configuration (#17026)
* Move storage from CL to config file

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* Fix .md

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* run make cli-documentation

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* fix

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* run make cli-documentation

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* nit_fixed

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* fix

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* add test and update configuration.md

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

* fix lint

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>

---------

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
2025-10-27 14:51:33 +00:00
Sylvain Rabot
50de066a7e
Add urlQueryEscape to template functions
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2025-10-27 10:47:29 +01:00
György Krajcsovits
c929578718
feat(nh): mark native histograms as stable in docs
Fixes: #16572

Mark as stable means that breaking changes are only allowed together with
major version release of Prometheus.

Co-authored-by: Björn Rabenstein <beorn@grafana.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-10-24 12:31:42 +02:00
Julius Volz
ae83804ab0
docs: Minor formatting/typo fixes in the HTTP API docs (#17339)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-10-23 09:48:36 +00:00
Arve Knudsen
ef42c088ba
OTLP: Add configuration parameters to control label name translation (#17345)
As a follow-up to #17344, add two configuration parameters for controlling label
name translation, both defaulting to on for backwards compatibility (currently
these behaviours are hardcoded as enabled):

* otlp.label_name_underscore_sanitization => Prefix label names starting with a
  single underscore with key_ when translating OTel attribute names
* otlp.label_name_preserve_multiple_underscores => Keep multiple consecutive
  underscores in label names when translating OTel attribute names

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-10-22 08:27:35 +02:00
Julius Volz
8b1bd7d6c3 ui: Allow viewing detailed relabeling steps for each discovered target
This adds:

* A `ScrapePoolConfig()` method to the scrape manager that allows getting
  the scrape config for a given pool.
* An API endpoint at `/api/v1/targets/relabel_steps` that takes a pool name
  and a label set of a target and returns a detailed list of applied
  relabeling rules and their output for each step.
* A "show relabeling" link/button for each target on the discovery page
  that shows the detailed flow of all relabeling rules (based on the API
  response) for that target.

Note that this changes the JSON encoding of the relabeling rule config
struct to output the original snake_case (instead of camelCase) field names,
and before merging, we need to be sure that's ok :) See my comment about
that at https://github.com/prometheus/prometheus/pull/15383#issuecomment-3405591487

Fixes https://github.com/prometheus/prometheus/issues/17283

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-10-15 15:33:27 +02:00
beorn7
ad7d1aed99 Phase out native histogram feature flag
The detailed plan for this is laid out in
https://github.com/prometheus/prometheus/issues/16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
https://github.com/prometheus/prometheus/pull/17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
2025-10-15 14:50:52 +02:00
Will Bollock
e894a22b88 feat: add config label to refresh metrics
Adds a `config` label (similar to `prometheus_sd_discovered_targets`) to
refresh metrics to help identify the source of refresh issues or
performance stats. In particular for HTTP SD, it can be common to have
multiple disparate HTTP SD sources that should be identified and not
lumped together. For example if one HTTP SD service has failures, that
should be evident in its own time series seperate from other HTTP SD
sources.

`config` seemed more appropriate than `endpoint` as a general standard
for `prometheus_sd` metrics.

Docs were also updated for HTTP SD to point at the new refresh metrics
rather than the older metrics.

Signed-off-by: Will Bollock <wbollock@linode.com>
2025-10-14 11:36:14 -04:00
Devansh Sehgal
abf67c8641 docs: document sigv4.use_fips_sts_endpoint in <http_config>
Signed-off-by: Devansh Sehgal <devanshsehgal02@gmail.com>
2025-10-08 01:31:44 +05:30
beorn7
e94031abd2 docs: Clarify the handling of negative histograms
Signed-off-by: beorn7 <beorn@grafana.com>
2025-10-01 16:42:20 +02:00