Commit graph

13205 commits

Author SHA1 Message Date
Nicolás Pazos 6615d1de7c solve conflicts 2024-06-27 13:35:55 -03:00
Nicolás Pazos eff2058d41 conflicts 2024-06-27 13:34:10 -03:00
Bartlomiej Plotka 7f5ae0462d
MAINTAINERS.md: Added Nico and Alex as remote/storage owners. (#14352)
Would love to propose @npazosmendez and @alexgreenbank to help us own remote storage (especially write). 

Nico & Alex are not yet Prometheus maintainer, but I think that’s fine.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2024-06-27 15:56:40 +01:00
Björn Rabenstein cb7306155b
Merge pull request #14004 from liam-howe-maersk/implement-config-marshal
configuration: Implement IsZero for relabel.Regex to remove default regex
2024-06-27 12:13:14 +02:00
Bryan Boreham c5040c5ea9
Merge pull request #10490 from DrAuYueng/fix-docker-sd-service-missing
[ENHANCEMENT] Docker SD: add MatchFirstNetwork for containers with multiple networks

Fixes docker sd service misssing in shared mode and deduplicate targets by network
2024-06-26 12:33:50 +01:00
Charles Korn 2dd07fbb1b
notifier: optionally drain queued notifications before shutting down (#14290)
* Add draining of queued notifications to `notifier.Manager`

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

* Update docs

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

* Address PR feedback

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

* Add more logging

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

* Address offline feedback: remove timeout

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

* Ensure stopping takes priority over further processing, make tests more robust

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

* Make channel unbuffered

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

* Update docs

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

* Fix race in test

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

* Remove unnecessary context

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

* Make Stop safe to call multiple times

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

---------

Signed-off-by: Charles Korn <charles.korn@grafana.com>
2024-06-26 11:32:04 +01:00
Bartlomiej Plotka 4dbcdd19da
[PRW-2.0] (part 2) Removed automatic negotiation, updates for the latest spec semantics in remote pkg (#14329)
* [PRW-2.0] (part2) Moved to latest basic negotiation & spec semantics.

Spec: https://github.com/prometheus/docs/pull/2462

Supersedes https://github.com/prometheus/prometheus/pull/13968

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

# Conflicts:
#	config/config.go
#	docs/configuration/configuration.md
#	storage/remote/queue_manager_test.go
#	storage/remote/write.go
#	web/api/v1/api.go

* Addressed comments.

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

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
2024-06-26 11:20:01 +01:00
Bryan Boreham f24ce00320
Merge pull request #13434 from bboreham/elide-queriers
storage: don't wrap single querier in merge-queriers
2024-06-25 17:47:09 +01:00
Arve Knudsen 1abeebacb8
Merge pull request #14340 from aknuds1/arve/fix-lint
Upgrade to golangci-lint v1.59.1, fix errors
2024-06-25 18:01:25 +02:00
Daniel Mellado 1b5f65002a Bump go-retryablehttp to fix basic auth creds leak
This PR updates go-retryablehttp to version 0.7.7, even if it's used as
an indirect import. Versions previous to that can didn't sanitize urls,
discussed at HDCSEC-2024-12 [1]

[1] https://discuss.hashicorp.com/t/hcsec-2024-12-go-retryablehttp-can-leak-basic-auth-credentials-to-log-files/68027

Signed-off-by: Daniel Mellado <dmellado@redhat.com>
2024-06-25 17:34:44 +02:00
Jan-Otto Kröpke 99355443c7
remote write handler: reject samples with future timestamps (#14304)
* fix(remote_write): reject samples with future timestamps

* increase check to +10 minutes to allow for clock drift

---------

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
Co-authored-by: Bryan Boreham <bjboreham@gmail.com>
2024-06-25 12:25:39 +01:00
Bryan Boreham 348f7f8d0c
Merge pull request #14341 from charleskorn/charleskorn/cleanup-pending-read
Fix issue where pending OOO read can be left dangling if creating querier fails
2024-06-25 09:23:54 +01:00
Ben Ye 246b7c6a5c
TSDB: Change block populator to accept postings index function (#14213)
Signed-off-by: Ben Ye <benye@amazon.com>
2024-06-25 09:21:48 +01:00
Ben Ye 5585a3c7e5
tsdb: expose hook to customize block querier (#14114)
* expose hook for block querier

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

* update comment

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

* use defined type

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

---------

Signed-off-by: Ben Ye <benye@amazon.com>
2024-06-25 09:47:06 +02:00
Bartlomiej Plotka 2b348d43b7
[PRW-2.0] (chain1) New Remote Write 2.0 Config options for 2.0-rc.1 spec. (#14335)
NOTE: For simple review this change does not touch remote/ packages, only main and configs.

Spec: https://prometheus.io/docs/specs/remote_write_spec_2_0

Supersedes https://github.com/prometheus/prometheus/pull/13968

Signed-off-by: bwplotka <bwplotka@gmail.com>
2024-06-25 07:15:27 +01:00
Charles Korn 2c5e88748e
Fix issue where pending OOO read can be left dangling if creating querier fails
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2024-06-25 14:22:44 +10:00
Arve Knudsen 0395b04419 golangci-lint: Upgrade to v1.59.1
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-06-24 16:14:22 -07:00
Arve Knudsen d902116b41 Fix various linting errors
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-06-24 16:11:53 -07:00
Bryan Boreham 6030407d25
Merge branch 'main' into elide-queriers
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-06-24 11:17:33 +01:00
Bryan Boreham b6aba4ff14
Merge pull request #14074 from bboreham/kahan-sum-sum
[ENHANCEMENT] PromQL: use Kahan summation for sum()
2024-06-24 11:13:26 +01:00
Martin Chodur 00b110c65c
Fix data corruption in remote write if max_sample_age is applied (#14078)
* fix: try to reproduce the bug from https://github.com/prometheus/prometheus/issues/13979 in a test case

Signed-off-by: David Vavra <sevenood@gmail.com>

* fix: data corruption in remote write if max_sample_age is applied

Signed-off-by: David Vavra <sevenood@gmail.com>

* add benchmark for buildTimeSeries which does the filtering

Signed-off-by: Callum Styan <callumstyan@gmail.com>

---------

Signed-off-by: David Vavra <sevenood@gmail.com>
Signed-off-by: Callum Styan <callumstyan@gmail.com>
Co-authored-by: David Vavra <sevenood@gmail.com>
Co-authored-by: Callum Styan <callumstyan@gmail.com>
2024-06-21 14:19:58 -07:00
Bartlomiej Plotka 0c0883e3cb
[PRW 2.0] Updated spec proto (2.0-rc.1); deterministic v1 interop; to be sympathetic with implementation. (#14330)
* [PRW 2.0] Updated spec proto (2.0-rc.1); deterministic v1 interop; to be sympathetic with implementation.

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

* update custom marshalling

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

* Removed confusing comments.

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

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
2024-06-21 20:38:56 +01:00
unknown 0d25931049 rebase main and adjust the configuration
Signed-off-by: ouyang1204@gmail.com <ouyang1204@gmail.com>
2024-06-21 19:10:18 +08:00
Piotr d78253319d
queue_manager: add histogram info to error logs (#14326)
Signed-off-by: Piotr Gwizdala <17101802+thampiotr@users.noreply.github.com>
2024-06-20 16:45:13 -07:00
Łukasz Mierzwa dbd29df5df
Fix @goyacc invocation (#14324)
goyacc is installed using 'install-goyacc' and ends up in GOPATH/bin.
GOPATH isn't usually part of standard PATH, so when make tries to run goyacc it fails, unless PATH includes GOPATH/bin.
Other Go tools, like golangci-lint, are also installed via go install into GOPATH/bin but they run correctly because make invocations for them use FIRST_GOPATH viriable to use full path.
Call goyacc using FIRST_GOPATH/bin as well so it works without GOPATH being included in PATH.

Signed-off-by: Lukasz Mierzwa <lukasz@cloudflare.com>
2024-06-20 18:25:44 +01:00
akunszt 2aaf99dd0a
discovery: aws: expose Primary IPv6 addresses as label, partially fixes #7406 (#14156)
* discovery: aws: expose Primary IPv6 addresses as label

Add __meta_ec2_primary_ipv6_addresses label. This label contains the
Primary IPv6 address for every ENI attached to the EC2 instance. It is
ordered by the DeviceIndex and the missing elements (interface without
Primary IPv6 address) are kept in the list.

---------

Signed-off-by: Arpad Kunszt <akunszt@hiya.com>
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
2024-06-20 14:36:20 +01:00
Bartlomiej Plotka 36830f64d1
rw20: Update prw commentary after Callum spec review (#14136)
* rw20: Update prw commentary after Callum spec review

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

* Update types.proto

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

---------

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2024-06-20 09:01:59 +01:00
George Krajcsovits c25d6d8ac6
Merge pull request #14316 from pracucci/export-labelsToLabelsProto
Export remote.LabelsToLabelsProto() and remote.LabelProtosToLabels()
2024-06-20 08:53:17 +02:00
Marco Pracucci b6dc9c1817
Merge branch 'main' into export-labelsToLabelsProto 2024-06-20 07:35:48 +02:00
machine424 f9ca6c4ae6 chore: add an alert based on the metric prometheus_sd_kubernetes_failures_total
that was introcued in https://github.com/prometheus/prometheus/pull/13554

The same motivation for adding the metric applies: To avoid silent SD failures,
as existing logs may not be regularly checked and can be missed.

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2024-06-19 17:51:56 +02:00
Marco Pracucci 35564c0cb0
Export remote.LabelsToLabelsProto() and remote.LabelProtosToLabels()
Signed-off-by: Marco Pracucci <marco@pracucci.com>
2024-06-19 17:30:49 +02:00
Bryan Boreham 5c417684f8
Merge pull request #14296 from colega/fix-matcher-string-with-empty-label-name
Fix `Matcher.String()` with empty label name
2024-06-19 06:28:53 -04:00
Bryan Boreham 6685cbc234
Merge branch 'main' into fix-matcher-string-with-empty-label-name 2024-06-19 06:13:21 -04:00
Arve Knudsen f45b0fd9ef
Merge pull request #14311 from aknuds1/arve/loggercheck
golangci-lint: Enable loggercheck linter
2024-06-19 12:02:41 +02:00
Bryan Boreham 84602bbace
Merge branch 'main' into fix-matcher-string-with-empty-label-name 2024-06-19 05:56:25 -04:00
Bryan Boreham 5a1886d247
Merge branch 'main' into arve/loggercheck 2024-06-19 05:47:54 -04:00
Bartlomiej Plotka cdebf06ad9
[PRW2.0] Remove benchmark scripts (#13949)
See rationales on https://docs.google.com/document/d/1Bpf7mYjrHUhPHkie0qlnZFxzgqf_L32kM8ZOknSdJrU/edit

Signed-off-by: bwplotka <bwplotka@gmail.com>
2024-06-19 10:35:52 +01:00
George Krajcsovits 9a8b6c52ca
Merge pull request #14313 from prometheus/merge-2.53-to-main
Merge 2.53 to main
2024-06-19 10:23:02 +02:00
György Krajcsovits fcabffb999 Merge branch 'release-2.53' into merge-2.53-to-main 2024-06-19 10:06:57 +02:00
machine424 70beda092a fix(notifier): take alertmanagerSet.mtx before checking alertmanagerSet.ams in sendAll
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2024-06-19 09:43:52 +02:00
machine424 690de487e2 chore(notifier): Split 'Run()' into two goroutines: one to receive target updates and trigger reloads and the other one to send notifications.
This is done to prevent the latter operation from blocking/starving the former, as previously, the `tsets` channel was consumed by the same goroutine that consumes and feeds the buffered `n.more` channel, the `tsets` channel was less likely to be ready as it's unbuffered and only fed every `SDManager.updatert` seconds.

See https://github.com/prometheus/prometheus/issues/13676 and https://github.com/prometheus/prometheus/issues/8768

The synchronization with the sendLoop goroutine is managed through the n.mtx mutex.

This uses a similar approach than scrape manager's efbd6e41c5/scrape/manager.go (L115-L117)

The old TestHangingNotifier was replaced by the new one to more closely reflect reality.

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2024-06-19 09:43:52 +02:00
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
Arve Knudsen be975bf8d7 golangci-lint: Enable loggercheck linter
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-06-18 20:41:26 +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
George Krajcsovits 4c35b9250a
Merge pull request #14303 from prometheus/prepare-2.53.0-release
Prepare 2.53.0 release
2024-06-18 15:08:14 +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
George Krajcsovits 29d3e48267
Update CHANGELOG.md
Co-authored-by: Julien <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
2024-06-18 13:45:53 +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