Commit graph

14147 commits

Author SHA1 Message Date
Arve Knudsen f6e37c5cdb
Merge pull request #14459 from prometheus/dependabot/npm_and_yarn/web/ui/ts-jest-29.2.1
build(deps-dev): bump ts-jest from 29.1.4 to 29.2.1 in /web/ui
2024-07-14 18:11:16 +02:00
Arve Knudsen 506729480e golangci-lint: Don't use deprecated config params
Replace deprecated golangci-lint configuration parameters with current
equivalents:

* `run.skip-files` => `issues.exclude-files`
* `run.skip-dirs` => `issues.exclude-dirs`

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-07-14 14:10:45 +02:00
Arve Knudsen fbc9eddfaf Refactor engine creation in tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-07-14 13:58:51 +02:00
Arve Knudsen fec6adadcd Merge remote-tracking branch 'prometheus/main' into arve/close-engine 2024-07-14 13:19:11 +02:00
Bryan Boreham d116bf7b9f
Merge pull request #14109 from harry671003/pass_limit_to_querier
storage: pass limit param as hint in querier
2024-07-12 10:27:52 +01:00
Bartlomiej Plotka 0c87643abd
[PRW 2.0] write_handler: Support for rc.2 spec & improved error handling for v2. (#14427)
* [PRW 2.0] write_handler: Support for rc.2 spec & improved error handling for v2.

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

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

* Addressed Callum comments.

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

* Added missing lock on flush.

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

* Fixed lint.

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

* Added tests.

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

* Addressed Callum's comments & updated re spec.

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

* Update storage/remote/write_handler_test.go

Co-authored-by: Callum Styan <callumstyan@gmail.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: Callum Styan <callumstyan@gmail.com>
2024-07-12 08:11:38 +01:00
咸鱼暄 bab098a4c1 change all lists to bullets
Signed-off-by: 咸鱼暄 <30610597+smd1121@users.noreply.github.com>
2024-07-11 17:05:23 +02:00
咸鱼暄 ad03ede602 fix markdown list
Signed-off-by: 咸鱼暄 <30610597+smd1121@users.noreply.github.com>
2024-07-11 17:05:23 +02:00
machine424 caa71fb3c7 chore(storage/remote): collect maxTimestamp when value is 0 as well.
This change enables the PrometheusRemoteWriteBehind alert’s expression to be evaluated
even when the remote endpoint has never been reached. As a result, PrometheusRemoteWriteBehind
will fire to easily detect configuration mistakes (such as incorrect endpoint URLs) or
unrecoverable connectivity issues.

See https://github.com/prometheus/prometheus/issues/14350 for details.

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2024-07-11 16:43:58 +02:00
Filip Petkovski cb8b6d7504
Allow built-in tests to be customized
The RunBuiltinTests function accepts a concrete type which makes
it hard to exclude certain tests from the suite. It would be great
if we could skip tests which might not be critical in order to unblock
updates.

By accepting an interface instead, we can inject a custom implementation
which would skips select test cases.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
2024-07-11 14:19:09 +02:00
Julius Volz af7a010558 Fix agent-mode menu items, path prefix calculation, and homepage redirects
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2024-07-10 22:41:47 +02:00
beorn7 cff0429b1a promql: make avg_over_time faster and more precise
Same idea as for the avg aggregator before: Most of the time, there is
no overflow, so we don't have to revert to the more expensive and less
precise incremental calculation of the mean value.

Signed-off-by: beorn7 <beorn@grafana.com>
2024-07-10 19:20:24 +02:00
beorn7 3a908d8e08 promql: Improve Kahan usage in avg_over_time
The calculation of the mean value in avg_over_time is performed in an
incremental fashion. This introduces additional numerical errors that
even Kahan summation cannot compensate, but at least we can use the
Kahan-corrected mean value when we use the intermediate mean value in
the calculation.

Signed-off-by: beorn7 <beorn@grafana.com>
2024-07-10 19:20:24 +02:00
beorn7 c46074f4dd promql: make avg aggregation more precise and less expensive
The basic idea here is that the previous code was always doing
incremental calculation of the mean value, which is more costly and
can be less precise. It protects against overflows, but in most cases,
an overflow doesn't happen anyway.

The other idea applied here is to expand on #14074, where Kahan
summation was applied to sum().

With this commit, the average is calculated in a conventional way
(adding everything up and divide in the end) as long as the sum isn't
overflowing float64. This is combined with Kahan summation so that the
avg aggregation, in most cases, is really equivalent to the sum
aggregation with a following division (which is the user's expectation
as avg is supposed to be syntactic sugar for sum with a following
divison).

If the sum hits ±Inf, the calculation reverts to incremental
calculation of the mean value. Kahan summation is also applied here,
although it cannot fully compensate for the numerical errors
introduced by the incremental mean calculation. (The tests added in
this commit would fail if incremental mean calculation was always
used.)

Signed-off-by: beorn7 <beorn@grafana.com>
2024-07-10 19:20:24 +02:00
Björn Rabenstein 58963f7b2e
Merge pull request #9138 from darshanime/duration_number_duality
Making durations and number literals the same
2024-07-10 18:06:06 +02:00
dependabot[bot] dca82e0805
build(deps-dev): bump ts-jest from 29.1.4 to 29.2.1 in /web/ui
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.1.4 to 29.2.1.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.1.4...v29.2.1)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-10 15:35:15 +00:00
dependabot[bot] dd48eab981
build(deps): bump @codemirror/autocomplete in /web/ui
Bumps [@codemirror/autocomplete](https://github.com/codemirror/autocomplete) from 6.16.2 to 6.17.0.
- [Changelog](https://github.com/codemirror/autocomplete/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/autocomplete/compare/6.16.2...6.17.0)

---
updated-dependencies:
- dependency-name: "@codemirror/autocomplete"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-10 15:35:14 +00:00
Bryan Boreham 9d744deea3
Merge pull request #14455 from bboreham/merge-2.53.1
Merge 2.53.1 into main
2024-07-10 16:34:01 +01:00
beorn7 706e19912b adjust version number in documentation
Signed-off-by: beorn7 <beorn@grafana.com>
2024-07-10 16:59:33 +02:00
darshanime 1a1b09fc3d Add a note about the new syntax
Signed-off-by: darshanime <deathbullet@gmail.com>
2024-07-10 15:50:23 +02:00
darshanime bd4ea118e9 Allow durations for number rule
Signed-off-by: darshanime <deathbullet@gmail.com>
2024-07-10 15:50:22 +02:00
darshanime cfad8ff3b2 Deprecate duration token
Signed-off-by: darshanime <deathbullet@gmail.com>
2024-07-10 15:49:58 +02:00
darshanime 8c8860d2d6 Allow number literals as duration
Signed-off-by: darshanime <deathbullet@gmail.com>
2024-07-10 15:49:30 +02:00
Saswata Mukherjee 398f42de5f
Add label-matcher support to Rules API (#10194)
* Add label-matcher support to Rules API

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Yijie Qin <qinyijie@amazon.com>

* Implement suggestions

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Yijie Qin <qinyijie@amazon.com>

* Match any matcherSet instead of all

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Yijie Qin <qinyijie@amazon.com>

* Don't treat labels.Labels as slice

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Yijie Qin <qinyijie@amazon.com>

* Remove non-templated check and fix tests

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Yijie Qin <qinyijie@amazon.com>

* Update docs

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Yijie Qin <qinyijie@amazon.com>

* fix comments

Signed-off-by: Yijie Qin <qinyijie@amazon.com>

* fix comment

Signed-off-by: Yijie Qin <qinyijie@amazon.com>

* Add comment for matching logic, fix tests after rebase

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>

---------

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
Co-authored-by: Yijie Qin <qinyijie@amazon.com>
2024-07-10 13:18:29 +01:00
Julius Volz c21a18a8dd
Minor style improvements for native histograms in table view (#14448)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2024-07-10 13:16:15 +02:00
Björn Rabenstein b1c106a9ce
Merge pull request #14454 from fpetkovski/fix-binop-hist-stats
Fix decoding buckets for native histograms in binops
2024-07-10 13:07:45 +02:00
Björn Rabenstein 8b5805bbb4
Merge pull request #14445 from jan--f/3.0-main-sync-24-07-09
3.0 main sync 24-07-09
2024-07-10 12:56:45 +02:00
Bryan Boreham 646e1e847d Merge branch 'release-2.53' into merge-2.53.1 2024-07-10 11:17:53 +01:00
Bryan Boreham 14cfec3f60
Prepare release 2.53.1 (#14452)
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-10 11:14:07 +01:00
Filip Petkovski acb6c1ae4b
Fix decoding buckets for native histograms in binops
The optimizer which detects cases where histogram buckets can be skipped
does not take into account binary expressions. This can lead to buckets
not being decoded if a metric is used with both histogram_fraction/quantile and
histogram_sum/count in the same expression.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
2024-07-10 11:55:29 +02:00
Bryan Boreham 7b595d67b4
2.54: Propose Bryan Boreham as release shepherd (#14453)
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-10 10:42:26 +01:00
Bryan Boreham 7083ae8267
[release 2.53] Revert 13583 to stop dropping samples in remote-write catch-up (#14446)
* Revert "fix bug that would cause us to endlessly fall behind (#13583)"
This reverts commit 0c71230784.
(leaving the new test in place)

* TSDB: enhance TestRun_AvoidNotifyWhenBehind
With code suggested by @cstyan in #14439.

* WAL watcher: add back log line showing current segment

---------

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-10 10:00:31 +01:00
Björn Rabenstein d002fad00c
Merge pull request #14424 from aknuds1/arve/fix-comments
Fix a couple of comments
2024-07-10 00:56:32 +02:00
Manik Rana 373f09796d
feat (ui): Add Native Histogram rendering to new UI (#14431)
* feat: scaffold new ui native histogram

Signed-off-by: Manik Rana <manikrana54@gmail.com>

* feat: add native histogram rendering

Signed-off-by: Manik Rana <manikrana54@gmail.com>

* feat: add tooltip

Signed-off-by: Manik Rana <manikrana54@gmail.com>

* fix:revert package-lock changes

Signed-off-by: Manik Rana <manikrana54@gmail.com>

* chore: fix tab spacing

Signed-off-by: Manik Rana <manikrana54@gmail.com>

* fix: apply suggestions and fixes

Signed-off-by: Manik Rana <manikrana54@gmail.com>

* chore: lint

Signed-off-by: Manik Rana <manikrana54@gmail.com>

---------

Signed-off-by: Manik Rana <manikrana54@gmail.com>
2024-07-09 22:51:37 +02:00
Jan Fajerski c0d67fd845 Merge branch 'main' into 3.0-main-sync-24-07-09 2024-07-09 16:51:07 +02:00
Bartlomiej Plotka 5646c315bd
Merge pull request #14416 from prometheus/prw2.0-nhcb
writev2: Add basic support for nhcb.
2024-07-09 08:54:49 +02:00
B1F030 e5c69685b5 Fix web.cors.origin in command-line/prometheus.md
Signed-off-by: B1F030 <b1fzhang@gmail.com>
2024-07-08 11:30:36 +08:00
Manik Rana 8849b7dcad
chore: remove console logs (#14430)
Signed-off-by: Manik Rana <manikrana54@gmail.com>
2024-07-07 12:27:13 +02:00
Björn Rabenstein 06f0f2ef3b
Merge pull request #14429 from prometheus/document-info-annotations
Document info-level annotations in query response
2024-07-07 00:24:34 +02:00
Julius Volz 0f0b3d82e1 Document info-level annotations in query response
Fixes https://github.com/prometheus/prometheus/issues/14135

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2024-07-06 23:51:00 +02:00
zenador 480fefd089
Split warnings and info annotations in API response (#14327)
* split warnings and info annotations in API response

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>

* update according to code review

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>

* minimal UI change: show infos in different colour

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>

* Update web/ui/react-app/src/pages/graph/Panel.tsx

Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: zenador <zenador@users.noreply.github.com>

---------

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: zenador <zenador@users.noreply.github.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-06 11:05:00 +02:00
Arve Knudsen e410a215fb Fix a couple of comments
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-07-05 15:25:42 +02:00
Bryan Boreham 89608c69a7
Merge pull request #14328 from bboreham/more-dedupelabels
TSDB and scraping: improvements to dedupelabels
2024-07-05 11:46:31 +01:00
Bryan Boreham 4d7532f60b tsdb: reset symbol table for exemplars periodically
To avoid keeping the memory alive forever.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-05 10:19:07 +01:00
Bryan Boreham 5281a6bc1b TSDB: rebuild labels symbol-table on each compaction
Log begin/end for timing, plus some stats.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-05 10:19:07 +01:00
Bryan Boreham e6356e64bd Scraping: drop series cache when resizing symbol table
Clear caches by restarting scraping loops: each loop assumes it has
exclusive ownership of its cache, so we can't come in from another
goroutine and change it.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-05 10:16:22 +01:00
Bryan Boreham 74b1f3daa6 Refactor: scraping: extract method restartLoops
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-05 10:16:22 +01:00
Bryan Boreham b42b5fbd74 Scraping: check symbol-table on sync
Previously they were only checked on a change of config.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-05 10:16:22 +01:00
Bryan Boreham 7ca31c66be Scraping: add metric for symbol table size
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-05 10:16:22 +01:00
Bryan Boreham 709c5d6fc3
TSDB: Lock around access to labels in head under -tags dedupelabels (#14322)
* TSDB: Document what needs locking in memSeries

* TSDB: Lock around access to series labels

So we can modify them to reset the symbol-table.

* TSDB: Make label locking conditional on build tag

---------

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-07-05 10:11:32 +01:00