JuanJo Ciarlante
c94c5b64c3
feat: add limitk() and limit_ratio() operators ( #12503 )
...
* rebase 2024-07-01, picks previous renaming to `limitk()` and `limit_ratio()`
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: HAPPY NOW about its code -> reorg, create and use simpleRangeQuery() function, less lines and more readable ftW \o/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
5 months ago
Bryan Boreham
82a8c6abe2
[ENHANCEMENT] Optimize regexps with multiple prefixes ( #13843 )
...
For example `foo.*|bar.*|baz.*`. Instead of checking each one in turn,
we build a map of prefixes, then check the smaller set that could match
the string supplied.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
* Improve testing and readability
Address review comments on #13843
Signed-off-by: Marco Pracucci <marco@pracucci.com>
5 months ago
Carrie Edwards
ba948e94fb
Merge pull request #13699 from prometheus/cedwards/tsdb-test-helpers
...
Refactor tsdb tests to use test util functions to test different sample types
5 months ago
Carrie Edwards
ee909b340b
Fix test
...
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
5 months ago
Carrie Edwards
00499006c0
Testutil refactoring
...
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
5 months ago
Carrie Edwards
55f53330b2
Use storage.ExpandSamples instead of samplesFromIterator
...
Co-authored by: Fiona Liao <fiona.liao@grafana.com>:
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
5 months ago
Carrie Edwards
06550883c1
Clean up of tests and test utils
...
Co-authored by: Fiona Liao <fiona.liao@grafana.com>:
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
5 months ago
Carrie Edwards
cb76884352
Fix linting
...
Co-authored by: Fiona Liao <fiona.liao@grafana.com>:
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
5 months ago
Carrie Edwards
45a32a29ef
Update tsdb tests to use test utils.
...
Co-authored-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
5 months ago
Carrie Edwards
60917f628b
Add test utilities for testing different sample types.
...
Co-authored-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
5 months ago
Bryan Boreham
134e8dc7af
TSDB: Simplify OOO Select by copying the head chunk ( #14396 )
...
Instead of carrying around extra fields in `Meta` structs which let us
approximate what was in the chunk at the time, take a copy of the chunk.
This simplifies lots of code, and lets us correct a couple of tests which
were embedding the wrong answer.
We can also remove boundedIterator, which was only used to constrain
the OOO head chunk.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
5 months ago
Ganesh Vernekar
3d54bcc018
Merge pull request #14362 from charleskorn/charleskorn/sum-infinity
5 months ago
Oleg Zaytsev
726ed124e4
Replace `ListPostings.Seek`'s binary search call by the generic `slices.BinarySearch` ( #14393 )
...
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
5 months ago
Bartlomiej Plotka
9cf4b969dd
Merge pull request #14388 from prometheus/dependabot/go_modules/documentation/examples/remote_storage/github.com/prometheus/common-0.55.0
...
build(deps): bump github.com/prometheus/common from 0.54.0 to 0.55.0 in /documentation/examples/remote_storage
5 months ago
dependabot[bot]
fb1b3d6b1a
build(deps): bump actions/checkout from 4.1.6 to 4.1.7 in /scripts
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](a5ac7e51b4...692973e3d9
)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
dependabot[bot]
c53fdade42
build(deps): bump github.com/prometheus/common
...
Bumps [github.com/prometheus/common](https://github.com/prometheus/common ) from 0.54.0 to 0.55.0.
- [Release notes](https://github.com/prometheus/common/releases )
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md )
- [Commits](https://github.com/prometheus/common/compare/v0.54.0...v0.55.0 )
---
updated-dependencies:
- dependency-name: github.com/prometheus/common
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
dependabot[bot]
35811eda96
build(deps): bump bufbuild/buf-setup-action from 1.32.2 to 1.34.0
...
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action ) from 1.32.2 to 1.34.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases )
- [Commits](dde0b9351d...35c243d7f2
)
---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
dependabot[bot]
512b490ed5
build(deps): bump github/codeql-action from 3.25.8 to 3.25.11
...
Bumps [github/codeql-action](https://github.com/github/codeql-action ) from 3.25.8 to 3.25.11.
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](2e230e8fe0...b611370bb5
)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
dependabot[bot]
65f57ca341
build(deps-dev): bump @types/node from 20.14.2 to 20.14.9 in /web/ui
...
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node ) from 20.14.2 to 20.14.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases )
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node )
---
updated-dependencies:
- dependency-name: "@types/node"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
dependabot[bot]
f090ab1baf
build(deps): bump sass from 1.77.4 to 1.77.6 in /web/ui
...
Bumps [sass](https://github.com/sass/dart-sass ) from 1.77.4 to 1.77.6.
- [Release notes](https://github.com/sass/dart-sass/releases )
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md )
- [Commits](https://github.com/sass/dart-sass/compare/1.77.4...1.77.6 )
---
updated-dependencies:
- dependency-name: sass
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
Arve Knudsen
a39e7e287f
Merge pull request #14371 from aknuds1/arve/cleanup-otlp-histograms
...
OTLP: Document histogram conversion methods / clean up code a bit
5 months ago
Arve Knudsen
9595b174e5
otlp: Document regular and exponential histogram conversions
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
5 months ago
Jan Fajerski
d8a9d69f81
ci: Add job to report build_all status
...
This should enable proper status reporting of matrix jobs for release
branches. See also https://github.com/orgs/community/discussions/4324 .
The new job will succeed if all build_all jobs succeeded and fail if
there is a single failed or cancelled build job.
This only runs for PRs, not for release tags or the main branch, unlike
the build_all step.
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
5 months ago
Arve Knudsen
24b78bef32
otlp: Clean up exponential histogram code slightly
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
5 months ago
Bryan Boreham
32f4bf5f68
Merge pull request #14368 from pracucci/optimize-literal-prefix-string-matcher
...
FastRegexMatcher: small optimization for the literal prefix case
5 months ago
Marco Pracucci
ec31acaf02
FastRegexMatcher: small optimization for the literal prefix case
...
Signed-off-by: Marco Pracucci <marco@pracucci.com>
5 months ago
Paulo Dias
f4b1fcb73e
discovery: add support for gathering flavor name in Openstack discovery ( #14312 )
...
* feat: add support for gathering flavor name in Openstack discovery
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
* Update instance.go
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
Signed-off-by: Paulo Dias <44772900+paulojmdias@users.noreply.github.com>
* Update configuration.md
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
Signed-off-by: Paulo Dias <44772900+paulojmdias@users.noreply.github.com>
* fix: fix linting
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
* fix: fix instance type
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
* Update docs/configuration/configuration.md
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Paulo Dias <44772900+paulojmdias@users.noreply.github.com>
---------
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <44772900+paulojmdias@users.noreply.github.com>
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
5 months ago
Bryan Boreham
675d02cd0b
Merge pull request #14333 from bboreham/faster-dedupelabels
...
[PERF] Labels: faster encoding for -tags dedupelabels
5 months ago
Bartlomiej Plotka
4f2558de42
Merge pull request #14366 from rapphil/rapphil-fix-panic-ruler
...
Make rules Manager Update method no-op after Close
5 months ago
Raphael Silva
e0c9b2ee19
Fix linting errors
...
Signed-off-by: Raphael Silva <rapphil@gmail.com>
5 months ago
Raphael Silva
cd5a7b5020
Make rules Manager Update method no-op after Close
...
This has to be done because Close and Update methods are accessed concurrently.
Signed-off-by: Raphael Silva <rapphil@gmail.com>
5 months ago
Rick Rackow
9290d1308d
fix(docs/querying): explain `ceil` behaviour more explicitly with examples ( #11987 )
...
* fix(docs/querying): explain `ceil` behaviour more explicitly with examples
Signed-off-by: Rick Rackow <rick.rackow@gmail.com>
* fix(docs/querying): explain `floor` behaviour more explicitly with examples
Signed-off-by: Rick Rackow <rick.rackow@paymenttools.com>
---------
Signed-off-by: Rick Rackow <rick.rackow@gmail.com>
Signed-off-by: Rick Rackow <rick.rackow@paymenttools.com>
Co-authored-by: Rick Rackow <rick.rackow@paymenttools.com>
5 months ago
Charles Korn
fd6bdf5230
Fix issue where summation of +/- infinity returns NaN instead of infinity
...
Signed-off-by: Charles Korn <charles.korn@grafana.com>
5 months ago
Björn Rabenstein
2e58d46522
Merge pull request #13662 from prometheus/nhcb
...
Native histograms custom buckets storage
5 months ago
Björn Rabenstein
19da579799
Merge pull request #12821 from rexagod/12769
...
parser: support underscores
5 months ago
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>
5 months ago
Pranshu Srivastava
3c9e3ee552
parser: support underscores
...
Support underscores in numbers, namely, decimals, hexadecimals, and
exponentials.
Fixes #12769
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
5 months ago
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
5 months ago
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
5 months ago
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>
5 months ago
Bryan Boreham
f24ce00320
Merge pull request #13434 from bboreham/elide-queriers
...
storage: don't wrap single querier in merge-queriers
5 months ago
Arve Knudsen
1abeebacb8
Merge pull request #14340 from aknuds1/arve/fix-lint
...
Upgrade to golangci-lint v1.59.1, fix errors
5 months ago
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>
5 months ago
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>
5 months ago
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
5 months ago
Ben Ye
246b7c6a5c
TSDB: Change block populator to accept postings index function ( #14213 )
...
Signed-off-by: Ben Ye <benye@amazon.com>
5 months ago
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>
5 months ago
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>
5 months ago
Arve Knudsen
0395b04419
golangci-lint: Upgrade to v1.59.1
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
5 months ago
Arve Knudsen
d902116b41
Fix various linting errors
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
5 months ago