Commit Graph

1026 Commits

Author SHA1 Message Date
sujal shah
4408a6bcaf api: Create /status/tsdb/blocks endpoint.
this endpoint serves blocks data to the client.

Signed-off-by: sujal shah <sujalshah28092004@gmail.com>
2025-07-04 03:13:54 +05:30
Julien
432f130a32 PromQL: min/max/step: Address review comments
Signed-off-by: Julien <291750+roidelapluie@users.noreply.github.com>
2025-07-02 11:17:36 +02:00
Julien Pivotto
ee7d5158a7 Add step(), min(a,b) and max(a,b) in promql duration expressions
step() is a new keyword introduced to represent the query step width in duration expressions.

min(a,b) and max(a,b) return the min and max from two duration expressions.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-07-02 11:17:17 +02:00
Julius Volz
bfbae39931
Merge pull request #16716 from charleskorn/charleskorn/binops-docs
docs: clarify and expand binary operations documentation
2025-07-02 10:02:17 +02:00
Charles Korn
d19a9ab673
Remove other instances of "obvious"
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-07-01 20:13:46 +10:00
Charles Korn
1977452331
Address PR feedback: adjust docs to match current behaviour
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-07-01 20:10:20 +10:00
Charles Korn
665eb3d6cb
Address PR feedback: remove use of "obvious"
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-07-01 20:08:18 +10:00
Charles Korn
70df21a680
Address PR feedback: format Inf and NaN as monospace
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-07-01 20:07:07 +10:00
Charles Korn
9c6916f4f9
Address PR feedback: add blank lines before lists
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-07-01 20:06:15 +10:00
George Krajcsovits
5b7ff92d95
fix(promql): histogram_quantile and histogram_fraction NaN observed in native histogram (#16724)
* fix(promql): histogram_quantile NaN observed in native histogram

Fixes: #16578

See the issue for detailed explanation.
When a histogram had only NaN observations and no normal observations,
we returned 0 from the quantile, which is completely wrong. If there were
normal observations but we went over them, we returned the upper bound of
the existing buckets, however that contradicts expectations on
histogram_fraction. Now we return NaN if the quantile is calculated to be
over all normal observations, falling into NaNs (in a virtual +Inf bucket).

We also return info level annotations if we see any NaN observations.
The annotation calls out if we returned NaN or even if we took the
virtual +Inf bucket into account.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>

* fix(promql): histogram_fraction NaN observed in native histogram

Fixes: #16580

According to the specification we should not take NaN observations
into account when calculating the fraction. This commit fixes that
and adds an info level annotation to let the user know about this.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-06-25 13:37:43 +02:00
Rishi Jat
31e158b749
Add documentation for custom_values usage in NHCB (#16757)
Signed-off-by: rishi-jat <rishijat098@gmail.com>
Signed-off-by: Rishi Jat <rishijat098@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2025-06-24 21:52:55 +02:00
Arve Knudsen
c701636034
OTLP receiver: Rename otlp.convert_scope_metadata to otlp.promote_scope_metadata (#16760)
* Rename otlp.convert_scope_metadata to otlp.promote_scope_metadata

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Julius Hinze <juliusmh@proton.me>
2025-06-20 13:09:02 +00:00
Arve Knudsen
964bd7d1a9
OTLP: Support including scope metadata as metric labels (#16730)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-06-18 09:13:51 +02:00
Jan-Otto Kröpke
ceaa3bd6f9
discovery: add STACKIT SD (#16401) 2025-06-17 15:41:14 +02:00
Julien
998840c496
Merge pull request #16713 from roidelapluie/fix-pow-dur-expr
promql: Fix unary operator precedence in duration expressions
2025-06-16 11:13:34 +02:00
Julien Pivotto
db15681633 Update duration expression docs
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-06-16 10:53:36 +02:00
Michael Hoffmann
a5fa9431d8 promql: add ts_of_(max,min,last)_over_time functions
This commit adds the ts_of_(max,min,last)_over_time functions behind the experimental feature flag.

Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
2025-06-12 15:03:28 +00:00
Charles Korn
5926159f2a
Clarify expected behaviour of on(__name__)
See https://github.com/prometheus/prometheus/issues/16631

Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-06-11 13:38:06 +10:00
Charles Korn
0c6ef1b23c
Clarify behaviour of bool modifier
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-06-11 13:38:05 +10:00
Charles Korn
40bed6281e
Clarify behaviour of metric names with bool modifier
Based on discussion in https://github.com/prometheus/prometheus/issues/15471

Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-06-11 13:38:02 +10:00
Charles Korn
1e794f7ef9
Break large paragraphs into smaller pieces
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2025-06-11 13:21:10 +10:00
Ayoub Mrini
50ba25f273
chore(docs/kubernetes SD): add a note about Endpoints API being deprecated in kubernetes 1.33+ (#16684)
* chore(docs/kubernetes SD): add a note about Endpoints API being deprecated in kubernetes 1.33+

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

* chore(discovery/kubernetes): add Endpoints API deprecation comment

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

---------

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2025-06-06 11:56:27 +02:00
Björn Rabenstein
eb1272eda7
Merge pull request #16653 from jkroepke/release-3.4-main
Merge release-3.4 into main
2025-06-04 18:06:11 +02:00
Jan-Otto Kröpke
638dc8dbdc
Merge branch 'release-3.4' into release-3.4-main
# Conflicts:
#	.github/workflows/ci.yml
#	CHANGELOG.md
#	RELEASE.md
#	VERSION
#	cmd/prometheus/main_test.go
#	docs/configuration/configuration.md
#	web/ui/mantine-ui/package.json
#	web/ui/module/codemirror-promql/package.json
#	web/ui/module/lezer-promql/package.json
#	web/ui/package-lock.json
#	web/ui/package.json
2025-05-31 12:48:16 +02:00
Julius Volz
13564c03ef Standardize doc page title handling
See https://groups.google.com/g/prometheus-developers/c/cwL3cM66Em8

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-05-28 21:37:27 +02:00
Antonio Jimenez
2834a665ed
Add support for promoting all OTel resource attributes (#16426)
Add support for promoting all OTel resource attributes via `promote_all_resource_attributes`,
except for those ignored using 'ignore_resource_attributes'.

---------

Signed-off-by: Antonio Jimenez <antonjim@thousandEyes.com>
Signed-off-by: Antonio Jimenez <123171955+antonjim-te@users.noreply.github.com>
2025-05-26 18:15:01 +02:00
bragi92
14fc57e4cf
remote_write azure auth : allow empty client_id to suppport system assigned managed identity (#16421)
* squash (#1)

* remote-write: allow empty azure client_id to support system assigned managed identity

* add blank line for tests

* remote-write: allow empty azure client_id to support system assigned managed identity

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>

* add blank line for tests

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>

---------

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>

* treat empty client_id as system-assigned identity; this is a valid case

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>

* rename file 

Signed-off-by: bragi92 <kadubey@microsoft.com>

---------

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>
Signed-off-by: bragi92 <kadubey@microsoft.com>
2025-05-24 15:01:49 +02:00
dongjiang
8d9332c199
fix metric_name_escaping_scheme option (#16625) 2025-05-24 14:25:39 +02:00
Ayoub Mrini
2edc3ed6c5
feat(tsdb): introduce --use-uncached-io feature flag and allow using it for chunks writing (#15365)
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
Signed-off-by: Ayoub Mrini <ayoubmrini424@gmail.com>
2025-05-21 14:42:30 +02:00
Ayoub Mrini
f2fac45eaf
Merge pull request #16563 from zepellin/patch-1
docs: Fix `metric_name_escaping_scheme` config parameter
2025-05-19 16:31:57 +02:00
Ayoub Mrini
4b7321c8e8
Merge pull request #16607 from marcoderama/patch-3
docs: fix typo in operators.md
2025-05-19 10:55:42 +02:00
Bartlomiej Plotka
8e6b008608
feature: type-and-unit-labels (PROM-39 implementation) (#16228)
* feature: type-and-unit-labels (extended MetricIdentity)

Experimental implementation of https://github.com/prometheus/proposals/pull/39

Previous (unmerged) experiments:
* https://github.com/prometheus/prometheus/compare/main...dashpole:prometheus:type_and_unit_labels
* https://github.com/prometheus/prometheus/pull/16025

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

feature: type-and-unit-labels (extended MetricIdentity)

Experimental implementation of https://github.com/prometheus/proposals/pull/39

Previous (unmerged) experiments:
* https://github.com/prometheus/prometheus/compare/main...dashpole:prometheus:type_and_unit_labels
* https://github.com/prometheus/prometheus/pull/16025

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

* Fix compilation errors

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

Lint

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

Revert change made to protobuf 'Accept' header

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

Fix compilation errors for 'dedupelabels' tag

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Rectored into schema.Metadata

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

* texparse: Added tests for PromParse

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

* add OM tests.

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

* add proto tests

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

* Addressed comments.

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

* add schema label tests.

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

* addressed comments.

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

* fix tests.

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

* add promql tests.

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

* lint

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

* Addressed comments.

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

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-05-17 09:37:25 +00:00
marcoderama
778d49bbfb
docs: fix typo in operators.md
Signed-off-by: marcoderama <marcoderamagit@gmail.com>
2025-05-16 12:03:24 -07:00
Julius Volz
1b818b03d5 Clean up codeboxes and headings in docs
The new docs site will have syntax highlighting, so this adds language tags
to code boxes that are currently missing them. I didn't add `promql` as a
language yet since the highlighter doesn't support it yet, plus a lot of
the PromQL codeboxes in our docs aren't strictly valid PromQL, they are
more like multiple expressions listed in the same code box on multiple
lines. So I'm leaving that for sometime later.

In the HTTP API page, I moved the curl examples from the JSON codeboxes to
their own ones above the JSON output. I considered putting an "Output:"
text between the curl + JSON output, but I think the way it currently looks
without it is probably fine.

I also fixed a number of headings which were at the wrong level relative to
their nesting in the document.

I also removed `go` as a language from the Go template language examples,
because the Go template language isn't Go at all.

I also adjusted the indent on one codebox to be more reasonable (2 spaces
instead of 8).

And then finally, my editor made a bunch of whitespace changes
automatically, like removing trailing spaces.

Signed-off-by: Julius Volz <julius.volz@gmail.com>

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-05-13 15:38:29 +02:00
Martin Danko
148968e399
docs: Fix metric_name_escaping_scheme config parameter
This is a fix for documentation update done in https://github.com/prometheus/prometheus/pull/16066, setting correct name for a configuration value.

Signed-off-by: Martin Danko <46035688+zepellin@users.noreply.github.com>
2025-05-07 12:41:49 +02:00
dongjiang
2bf6f4c9dc update fix configuration.md
Signed-off-by: dongjiang <dongjiang1989@126.com>
2025-05-06 20:09:42 +02:00
George Krajcsovits
2726a18ae3
Merge pull request #16452 from chardch/global-always-scrape-classic-hist
Add global config option for always_scrape_classic_histograms
2025-05-06 09:29:30 +02:00
chardch
a1c157aaef Add global config option for always_scrape_classic_histograms
Addresses https://github.com/prometheus/prometheus/issues/16371
This will help with migrating to native histograms with `convert_classic_histograms_to_nhcb` since users may still need to keep the classic histograms during a migration

Signed-off-by: chardch <otwordsne@gmail.com>
2025-05-05 10:14:04 -07:00
Graham Reed
b6aaea22fb
promtool: Optional fuzzy float64 comparison in rules unittests (#16395)
Make fuzzy compare opt-in via fuzzy_compare boolean in each unittest file.

Signed-off-by: Graham Reed <greed@hypervolt.co.uk>
2025-05-01 17:58:12 +10:00
Ayoub Mrini
0ce6022ef9
Merge pull request #16526 from n-peugnet/docs-clarify-time-options
promtool: clarify the docs of --{min,max}-time options
2025-04-30 20:46:26 +02:00
Nicolas Peugnet
4eca0942f2 Clarify the docs of promtool --{min,max}-time options
State explicitely what kind of timestamps are expected for the
--min-time and --max-time options of promtool tsdb commands.

This is especially important for the dump-openmetrics command as users
could otherwise  mistakenly think it would be in seconds, like the
OpenMetrics timestamps themselves.

Signed-off-by: Nicolas Peugnet <nicolas.peugnet@lip6.fr>
2025-04-30 11:23:00 +02:00
Jonas Lammler
08982b177f
Add label_selector to hetzner service discovery
Allows to filter the servers when sending the listing request to the API. This feature is only available when using the `role=hcloud`.

See https://docs.hetzner.cloud/#label-selector for details on how to use the label selector.

Signed-off-by: Jonas Lammler <jonas.lammler@hetzner-cloud.de>
2025-04-30 09:24:14 +02:00
Aman
26bddcf068
promql: histogram_stddev and histogram_stdvar should use arithmetic mean for custom buckets
Signed-off-by: amanycodes <amanycodes@gmail.com>
2025-04-24 14:48:58 +02:00
Arthur Silva Sens
9659e30dec
Add documentation for 'NoTranslation' mode (#16470)
* Add documentation for 'NoTranslation' mode

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update docs/configuration/configuration.md

Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
2025-04-23 14:15:18 +00:00
Fiona Liao
7ec63b1fa1
Add primitive support for ingesting OTLP delta metrics as-is (#16360)
* Add simple delta support

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Rename delta2cumulative part

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Whoops bad refactor

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add example yml

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Feature flag instead and histogram hint handling

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Delete otel_delta.yml - outdated

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Renaming to native delta support

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add more explanatory comments

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add more explanation to histograms

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Correct comment on d2c consumer

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add tests for counters and fix bug

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add histogram tests

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add docs

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Sort series to make test deterministic

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* More formatting

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Change flag name to ingestion

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Explain where rate calculation can go wrong

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add warning about duplicate timestamps

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Update docs/feature_flags.md

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Fix tests

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Remove unnecessary if

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add warning to d2c section

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Make unknown type error when getting temporality

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Correct type comment - not planning to add delta metric metadata type

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Remove unused param for empty type

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Rewrite temporality logic to be clearer

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Change spurious to unnecessary - better description

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

---------

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-04-23 09:58:02 -03:00
Michael Hoffmann
d6d9f97bac
promql: histogram_fraction for bucket histograms (#16095)
* promql: histogram_fraction for bucket histograms

This PR extends the histogram_fraction function to also work with classic bucket histograms. This is beneficial because it allows expressions like sum(increase(my_bucket{le="0.5"}[10m]))/sum(increase(my_total[10m])) to be written without knowing the actual values of the "le" label, easing the transition to native histograms later on.
It also feels natural since histogram_quantile also can deal with classic histograms.

Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>

* promql: histogram_fraction for bucket histograms

* Add documentation and reduce code duplication
* Fix a bug in linear interpolation between bucket boundaries
* Add more PromQL tests

Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>

* Update docs/querying/functions.md

Co-authored-by: Björn Rabenstein <github@rabenste.in>
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>

---------

Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
Co-authored-by: Björn Rabenstein <github@rabenste.in>
2025-04-23 00:28:31 +02:00
Julien
f4ca1368ff
Merge pull request #16249 from roidelapluie/arythmetics
PromQL: allow arithmetic operations in durations in PromQL parser
2025-04-22 10:17:41 +02:00
David Leadbeater
e647f7954f
promtool: Add feature flags for promql features (#16443)
These are supported in the main prometheus binary but the feature flags
weren't supported in promtool.

Fixes #16412.

Signed-off-by: David Leadbeater <dgl@dgl.cx>
2025-04-17 10:29:44 +01:00
beorn7
2763b6ba13 docs: Remove recording rule note for native histograms
We implemented proper type handling (gauge vs. counter histogram) a
while ago. The note about it is obsolete.

Signed-off-by: beorn7 <beorn@grafana.com>
2025-04-15 14:43:31 +02:00
George Krajcsovits
c15ae44455
Merge pull request #13613 from vvyushmanov/main
Documentation: Add description for OAuth2 password grant type setup
2025-04-15 13:29:20 +02:00