Commit graph

13026 commits

Author SHA1 Message Date
machine424 94d28cd6cf chore(notifier): add a reproducer for https://github.com/prometheus/prometheus/issues/13676
to show "targets groups update" starvation when the notifications queue is full and an Alertmanager
is down.

The existing `TestHangingNotifier` that was added in https://github.com/prometheus/prometheus/pull/10948 doesn't really reflect the reality as the SD changes are manually fed into `syncCh` in a continuous way, whereas in reality, updates are only resent every `updatert`.

The test added here sets up an SD manager and links it to the notifier. The SD changes will be triggered by that manager as it's done in reality.

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

Co-authored-by: Ethan Hunter <ehunter@hudson-trading.com>
2024-06-19 09:43:52 +02:00
anarcat 545d31f184
docs: clarify backup requirements for storage (#14297)
* clarify backup requirements for storage

After reading this (again) recently, I was under the impression that our backup strategy ("just throw Bacula at it") was just not good enough and that our backups were inconsistent. I filed [an issue internally][41627] about this because of that concern.

But reading a conversation with @SuperQ on IRC, I came under the impression that only the WAL files would be lost. This is an attempt at documenting this more clearly.

[41627]: https://gitlab.torproject.org/tpo/tpa/team/-/issues/41627
---------

Signed-off-by: anarcat <anarcat@users.noreply.github.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2024-06-19 07:46:13 +02:00
Björn Rabenstein b6ef745016
Merge pull request #14305 from charleskorn/charleskorn/convert-range-query-tests
promql: Convert more test cases to test scripting language
2024-06-18 17:27:55 +02:00
Björn Rabenstein d968408f51
Merge branch 'main' into charleskorn/convert-range-query-tests 2024-06-18 17:11:57 +02:00
Rens Groothuijsen 1c3f322f78
docs: mention implicitly watched directories in documentation (#14019)
* docs: mention implicitly watched directories in documentation

Signed-off-by: Rens Groothuijsen <l.groothuijsen@alumni.maastrichtuniversity.nl>

* Add mention of atomic file renaming

Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
Signed-off-by: Rens Groothuijsen <l.groothuijsen@alumni.maastrichtuniversity.nl>

---------

Signed-off-by: Rens Groothuijsen <l.groothuijsen@alumni.maastrichtuniversity.nl>
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
Co-authored-by: Björn Rabenstein <beorn@grafana.com>
2024-06-18 13:51:47 +02:00
Oleg Zaytsev fd1a89b7c8
Pass affected labels to MemPostings.Delete() (#14307)
* Pass affected labels to MemPostings.Delete

As suggested by @bboreham, we can track the labels of the deleted series
and avoid iterating through all the label/value combinations.

This looks much faster on the MemPostings.Delete call. We don't have a
benchmark on stripeSeries.gc() where we'll pay the price of iterating
the labels of each one of the deleted series.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-06-18 10:28:56 +00:00
Oleg Zaytsev 4f78cc809c
Refactor toNormalisedLower: shorter and slightly faster. (#14299)
Refactor toNormalisedLower: shorter and slightly faster

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-06-18 09:57:37 +00:00
Julien 6572b1fe63
Merge pull request #14306 from pracucci/export-tolabelmatchers
Export remote.ToLabelMatchers()
2024-06-18 11:23:08 +02:00
Marco Pracucci 0fbf4a2529
Export remote.ToLabelMatchers()
Signed-off-by: Marco Pracucci <marco@pracucci.com>
2024-06-17 10:40:45 +02:00
Charles Korn aeec30f082
Convert TestTimestampFunction_StepsMoreOftenThanSamples
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2024-06-17 16:56:56 +10:00
Charles Korn 987fa5c6a2
Convert range query test cases to test scripting language
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2024-06-17 16:43:01 +10:00
George Krajcsovits 5efc8dd27b
Merge pull request #14302 from yeya24/fix-check-ctx-cancel-count
fix check context cancellation not incrementing count
2024-06-17 08:36:56 +02:00
Ben Ye 0e6fca8e76 add unit test
Signed-off-by: Ben Ye <benye@amazon.com>
2024-06-16 12:09:42 -07:00
Ben Ye e7db2e30a4 fix check context cancellation not incrementing count
Signed-off-by: Ben Ye <benye@amazon.com>
2024-06-15 11:43:26 -07:00
Oleg Zaytsev 4c1e71fa0b
Reduce the flakiness of TestAsyncRuleEvaluation (#14300)
* Reduce the flakiness of TestAsyncRuleEvaluation

This tests sleeps for 15 millisecond per rule group, and then comprares
the entire execution time to be smaller than a multiple of that delay.

The ruleCount is 6, so it assumes that the test will come to the
assertions in less than 90ms.

Meanwhile, the Github's Windows runner:
- ...Huh, oh? What? How much time? milliwhat? Sorry I don't speak that.

TL;DR, this increases the delay to 250 millisecond. This won't prevent
the test from being flaky, but will reduce the flakiness by several
orders of magnitude and hopefully won't be an issue anymore.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

* Make tests parallel

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

---------

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-06-14 15:02:46 +02:00
Ben Ye 5a218708f1
tsdb: Extend compactor interface to allow compactions to create multiple output blocks (#14143)
* add hook to allow head compaction to create multiple output blocks

Signed-off-by: Ben Ye <benye@amazon.com>

* change Compact interface; remove BlockPopulator changes

Signed-off-by: Ben Ye <benye@amazon.com>

* rebase main

Signed-off-by: Ben Ye <benye@amazon.com>

* fix lint

Signed-off-by: Ben Ye <benye@amazon.com>

* fix unit test

Signed-off-by: Ben Ye <benye@amazon.com>

* address feedbacks; add unit test

Signed-off-by: Ben Ye <benye@amazon.com>

* Apply suggestions from code review

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Update tsdb/compact_test.go

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

---------

Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2024-06-12 17:31:25 -04:00
Sebastian Rabenhorst 05380aa0ac
agent db: make rejecting ooo samples configurable (#14094)
feat: Make OOO ingestion time window configurable for Prometheus Agent.

Signed-off-by: Sebastian Rabenhorst <sebastian.rabenhorst@shopify.com>
2024-06-12 11:07:42 -03:00
Oleg Zaytsev 64a9abb8be
Change LabelValuesFor() to accept index.Postings (#14280)
The only call we have to LabelValuesFor() has an index.Postings, and we
expand it to pass to this method, which will iterate over the values.

That's a waste of resources: we can iterate on the index.Postings
directly.

If there's any downstream implementation that has a slice of series,
they can always do an index.ListPostings from them: doing that is
cheaper than expanding an abstract index.Postings.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-06-11 15:36:46 +02:00
Ben Kochie 7f0caf7229
Merge pull request #14285 from prometheus/superq/tune_gogc
Tune default GOGC
2024-06-11 11:14:50 +02:00
Julien b31aaa6f8a
Merge pull request #14282 from parnavh/fix-broken-link
fix: broken link on github mobile
2024-06-11 10:12:42 +02:00
SuperQ ea2b39a31e
Tune default GOGC
Adjust the default GOGC value to 75. This is less of a memory savings,
but has less impact on CPU use.

Signed-off-by: SuperQ <superq@gmail.com>
2024-06-11 03:44:06 +02:00
Ranveer Avhad 39902ba694
[BUGFIX] FastRegexpMatcher: do Unicode normalization as part of case-insensitive comparison (#14170)
* Converted string to standarized form
* Added golang.org/x/text in Go dependencies
* Added test cases for FastRegexMatcher
* Added benchmark for toNormalizedLower

Signed-off-by: RA <ranveeravhad777@gmail.com>
2024-06-10 18:31:41 -04:00
Bryan Boreham 64c5cc5134
Merge pull request #14209 from bboreham/api-error-url
[ENHANCEMENT] HTTP API: Add url to errors logged while sending response
2024-06-11 01:09:11 +03:00
Bryan Boreham c5d923aa7c
Merge pull request #14279 from colega/fix-label-names-for-not-found
headIndexReader.LabelNamesFor: skip not found series
2024-06-11 01:06:19 +03:00
Sergey 5a5a6f08ef
chore: use HumanizeDuration from prometheus/common (#14202)
* chore: use HumanizeDuration from prometheus/common

Signed-off-by: Sergey <freak12techno@gmail.com>

* chore: fixed linting

Signed-off-by: Sergey <freak12techno@gmail.com>

* chore: review fixes

---------

Signed-off-by: Sergey <freak12techno@gmail.com>
2024-06-10 20:40:11 +02:00
Rens Groothuijsen 19fd5212c3
docs: clarify default Docker command line parameters (#14194)
* docs: clarify default Docker command line parameters

Signed-off-by: Rens Groothuijsen <l.groothuijsen@alumni.maastrichtuniversity.nl>

* docs: move Docker command line parameters section and refer to Dockerfile

Signed-off-by: Rens Groothuijsen <l.groothuijsen@alumni.maastrichtuniversity.nl>

* Add link to Dockerfile in documentation

Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
Signed-off-by: Rens Groothuijsen <l.groothuijsen@alumni.maastrichtuniversity.nl>

---------

Signed-off-by: Rens Groothuijsen <l.groothuijsen@alumni.maastrichtuniversity.nl>
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
2024-06-10 20:16:02 +02:00
Oleg Zaytsev 10a3c7220b
MemPostings.PostingsForLabelMatching(): don't hold the mutex while matching (#14286)
* MemPostings.PostingsForLabelMatching: let mutex go

This changes the `MemPostings.PostingsForLabelMatching` implementation
to stop holding the read mutex while matching the label values.

We've seen that this method can be slow when the matcher is expensive,
that's why we even added a context expiration check.

However, there are critical process that might be waiting on this mutex:
writes (adding new series) and compaction (deleting the
garbage-collected ones), so we should avoid holding it for a long period
of time.

Given that we've copied the values to a slice anyway, there's no need to
hold the lock while matching.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-06-10 14:24:17 +02:00
Oleg Zaytsev 2dc177d8af
MemPostings.Delete(): reduce locking/unlocking (#13286)
* MemPostings: reduce locking/unlocking

MemPostings.Delete is called from Head.gc(), i.e. it gets the IDs of the
series that have churned.

I'd assume that many label values aren't affected by that churn at all,
so it doesn't make sense to touch the lock while checking them.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-06-10 14:23:22 +02:00
Björn Rabenstein 08621bebe9
Merge pull request #14269 from prometheus/beorn7/histogram-test
promql: Add tests for histogram counter reset only in bucket
2024-06-08 16:59:47 +02:00
parnavh c92a5773b2 fix: broken link on github mobile
Signed-off-by: parnavh <parnav100sach@gmail.com>
2024-06-08 20:23:46 +05:30
Oleg Zaytsev d0d361da53
headIndexReader.LabelNamesFor: skip not found series
It's quite common during the compaction cycle to hold series IDs for
series that aren't in the TSDB head anymore.

We shouldn't fail if that happens, as the caller has no way to figure
out which one of the IDs doesn't exist.

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

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-06-07 16:09:53 +02:00
Marco Pracucci edd558884b
Fix Group.Equals() to take in account the new queryOffset too (#14273)
Signed-off-by: Marco Pracucci <marco@pracucci.com>
2024-06-06 18:47:36 +01:00
Ben Kochie 51e303d450
Merge pull request #14244 from prometheus/dependabot/npm_and_yarn/web/ui/http-proxy-middleware-3.0.0
build(deps): bump http-proxy-middleware from 2.0.6 to 3.0.0 in /web/ui
2024-06-06 19:15:58 +02:00
Ben Kochie be0d51278c
Merge pull request #14270 from prometheus/dependabot/npm_and_yarn/web/ui/types/sinon-17.0.3
build(deps-dev): bump @types/sinon from 10.0.20 to 17.0.3 in /web/ui
2024-06-06 19:12:15 +02:00
Ben Kochie 3ca40003e3
Merge pull request #14272 from prometheus/dependabot/npm_and_yarn/web/ui/eslint-config-prettier-9.1.0
build(deps-dev): bump eslint-config-prettier from 8.10.0 to 9.1.0 in /web/ui
2024-06-06 19:11:38 +02:00
Ben Kochie 77f782026c
Merge pull request #14271 from prometheus/dependabot/npm_and_yarn/web/ui/codemirror/commands-6.6.0
build(deps): bump @codemirror/commands from 6.3.2 to 6.6.0 in /web/ui
2024-06-06 19:11:07 +02:00
Bryan Boreham 6fb738af51
Merge pull request #14173 from pracucci/fastregexmatcher-optimize-contains
Improve contains check done by FastRegexMatcher
2024-06-06 19:59:23 +03:00
dependabot[bot] 3db2d8ef2e
build(deps-dev): bump eslint-config-prettier in /web/ui
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.10.0 to 9.1.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.10.0...v9.1.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-06 16:38:43 +00:00
dependabot[bot] f58f539c53
build(deps): bump @codemirror/commands from 6.3.2 to 6.6.0 in /web/ui
Bumps [@codemirror/commands](https://github.com/codemirror/commands) from 6.3.2 to 6.6.0.
- [Changelog](https://github.com/codemirror/commands/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/commands/compare/6.3.2...6.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-06 16:37:28 +00:00
dependabot[bot] 9bfc47f1f7
build(deps-dev): bump @types/sinon from 10.0.20 to 17.0.3 in /web/ui
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 10.0.20 to 17.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

---
updated-dependencies:
- dependency-name: "@types/sinon"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-06 16:37:10 +00:00
Ben Kochie 687b9c2d62
Merge pull request #14262 from prometheus/dependabot/npm_and_yarn/web/ui/types/node-20.14.2
build(deps-dev): bump @types/node from 20.10.4 to 20.14.2 in /web/ui
2024-06-06 17:59:45 +02:00
Charles Korn 1f988f77ff
promql: extend test scripting language to support asserting on expected error message (#14038)
Add ability to assert that a query fails with a particular error message

This also adds documentation for the test scripting language in general,
including the new feature.

Signed-off-by: Charles Korn <charles.korn@grafana.com>

---------

Signed-off-by: Charles Korn <charles.korn@grafana.com>
2024-06-06 17:56:25 +02:00
beorn7 c7fdfe8004 promql: Add tests for histogram counter reset only in bucket
This also exercises the "fast path" (only decoding count and sum),
i.e. where the counter reset isn't visible at all in the decoded data.

Signed-off-by: beorn7 <beorn@grafana.com>
2024-06-06 17:47:38 +02:00
Filip Petkovski 6e68046c25
Implement histogram statistics decoder (#14097)
Implement histogram statistics decoder

This commit speeds up histogram_count and histogram_sum
functions on native histograms. The idea is to have separate decoders which can be
used by the engine to only read count/sum values from histogram objects. This should help
with reducing allocations when decoding histograms, as well as with speeding up aggregations
like sum since they will be done on floats and not on histogram objects.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>

---------

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2024-06-06 17:17:13 +02:00
dependabot[bot] 0661b9076f
build(deps): bump http-proxy-middleware from 2.0.6 to 3.0.0 in /web/ui
Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 3.0.0.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v3.0.0)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-06 13:58:59 +00:00
Ben Kochie ee0527e0c6
Merge pull request #14260 from prometheus/dependabot/npm_and_yarn/web/ui/types/jquery-3.5.30
build(deps-dev): bump @types/jquery from 3.5.29 to 3.5.30 in /web/ui
2024-06-06 15:57:29 +02:00
Ben Kochie 89ab04b3ef
Merge pull request #14265 from prometheus/dependabot/npm_and_yarn/web/ui/downshift-9.0.6
build(deps): bump downshift from 7.6.2 to 9.0.6 in /web/ui
2024-06-06 15:56:52 +02:00
Ben Kochie 5f12cf5bbd
Merge pull request #14257 from prometheus/dependabot/npm_and_yarn/web/ui/moment-timezone-0.5.45
build(deps): bump moment-timezone from 0.5.43 to 0.5.45 in /web/ui
2024-06-06 15:56:08 +02:00
Ben Kochie afd26e5019
Merge pull request #14264 from prometheus/dependabot/npm_and_yarn/web/ui/lezer/generator-1.7.0
build(deps-dev): bump @lezer/generator from 1.5.1 to 1.7.0 in /web/ui
2024-06-06 15:55:51 +02:00
Ben Kochie fed911e8e0
Merge pull request #14233 from prometheus/dependabot/npm_and_yarn/web/ui/fortawesome/free-solid-svg-icons-6.5.2
build(deps): bump @fortawesome/free-solid-svg-icons from 6.5.1 to 6.5.2 in /web/ui
2024-06-06 15:55:10 +02:00