Commit graph

10286 commits

Author SHA1 Message Date
Dimitar Dimitrov 6b33c90efe
Add option to always restore the state of rules when loading 2022-09-09 22:01:11 +02:00
Ganesh Vernekar 4aa6d561a1
Run OOO compaction after restart if there is OOO data from WBL (#320)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-08-22 18:26:43 +05:30
Jesus Vazquez 54196bb7c4
Remove useless err check (#319)
Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>

Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
2022-08-19 12:52:03 +05:30
Peter Štibraný bec3143c6c
Remove unused tsdb.Options.NewChunkDiskMapper field. (#318)
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
2022-08-18 09:04:13 +00:00
Peter Štibraný acd4a8a69d
Remove old chunk mapper. (#311)
* Remove old chunk mapper.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>

* Revert to code from upstream.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>

* Fix OOO test failures

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

* Fix sorting in TestOOOHeadChunkReader_LabelValues

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

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-08-18 08:38:17 +00:00
Jesus Vazquez e9456018fa
Merge pull request #314 from grafana/jvp/fix-ooo-head-postingsformatchers-and-labelvalues
Fix OOO Head LabelValues and PostingsForMatchers
2022-08-11 16:23:28 +02:00
Jesus Vazquez 6bff0d9113 Add suggestions to labelValues test
Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
2022-08-11 16:08:49 +02:00
Oleg Zaytsev c40ecf4bae
Merge pull request #313 from grafana/load-ooo-time-window-once-per-appender
Load OutOfOrderTimeWindow only once per appender
2022-08-11 11:09:32 +02:00
Oleg Zaytsev b87c54de14 Load OutOfOrderTimeWindow only once per appender
We're loading the time window once per each Append() call, plus once in
the Commit(). While not extremely expensive, atomic operations are also
not cheap.

Additionally, it makes sense to keep the window consistent for a single
append.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2022-08-11 10:46:12 +02:00
Oleg Zaytsev 0dbfff0bc5
Merge pull request #316 from grafana/jvp/remove-redundant-lint-job
Remove redundant CI Lint job
2022-08-11 10:45:54 +02:00
Jesus Vazquez 14ec85d4d2 Fix LabelValues test 2022-08-11 10:29:06 +02:00
Jesus Vazquez 3473058073 Start writing OOOHeadIndexReader LabelValues test
Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
2022-08-10 23:38:02 +02:00
Jesus Vazquez 7368402054 Fix OOO Head LabelValues and PostingsForMatchers
OOOHeadIndexReader was using the headIndexReader PostingsForMatchers()
and LabelValues() implementation which lead to a very subtle bug that
led to wrong query results.

headIndexReader LabelValues() implementation checks if the query
timerange overlaps with the head maxt and mint and if it doesnt it
returns an empty list of values. Since this code was also used by the
ooo head it led to wrong results that we were not able to see in tests
because our queries where always from MinInt64 to MaxInt64. This commit
also adds a new test that performs multiple time range queries to make
sure this never happens again.

Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
2022-08-10 23:14:19 +02:00
Jesus Vazquez 628f66d19a Remove redundant CI Lint job 2022-08-10 22:32:19 +02:00
Ganesh Vernekar 01b03b7f85
Prevent panic with ApplyConfig (#312)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-08-09 19:25:17 +05:30
Ganesh Vernekar 9fe7d3a478
Update minOOOTime after truncating Head (#309)
* Update minOOOTime after truncating Head

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

* Fix lint

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

* Add a unit test

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-08-02 19:43:50 +05:30
Jesus Vazquez f537910769
Merge pull request #302 from grafana/codesome/nowarn
Do not warn on finding overlapping blocks, debug instead
2022-08-02 15:52:23 +02:00
Ganesh Vernekar 0ca37c62db
Make overlapping block log into a debug
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-08-02 12:44:12 +05:30
Ganesh Vernekar 4b2198d7ec
Do not double count in OOO histogram (#300)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-07-22 13:47:51 +05:30
Ganesh Vernekar 2836e5513f
Add support to query unmerged, unsorted chunks (#299)
* Add support to query unmerged, unsorted chunks

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

* Fix unrelated lint issue

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-07-20 15:57:02 +05:30
Ganesh Vernekar 00b379c3a5
Include out of order samples in BenchmarkQueries (#286)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-07-14 18:01:39 +05:30
Ganesh Vernekar ff0dc75758
Replay WBL even if OOO Time Window is 0 (#296)
* Replay WBL even if OOO Time Window is 0

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

* Apply feedback

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-07-14 08:28:03 +00:00
Peter Štibraný 21f2680b45
Merge pull request #287 from grafana/update-upstream-prometheus
Update upstream prometheus
2022-07-13 12:20:38 +02:00
Peter Štibraný ae49ab5ea8 Merge remote-tracking branch 'upstream/main' into update-upstream-prometheus 2022-07-13 10:18:09 +02:00
Ganesh Vernekar a632c73352
Simplify how OutOfOrderTimeWindow works (#285)
* Simplify how OutOfOrderTimeWindow works

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

* Update test

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-07-08 18:53:23 +05:30
Harkishen Singh 44fcf876ca
Adds support for prettifying PromQL expression (#10544)
* Implement Pretty() function for AST nodes.

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

This commit adds .Pretty() for all nodes of PromQL AST.
Each .Pretty() prettifies the node it belongs to, and under
no circustance, the parent or child node is touch/prettified.

Read more in the "Approach" part in `prettier.go`

* Refactor functions between printer.go & prettier.go

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

This commit removes redundancy between printer.go and prettier.go
by taking out the common code into separate private functions.

* Add more unit tests for Prettier.

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

* Add support for spliting function calls with 1 arg & unary expressions.

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

This commit does 2 things:
1. It adds support to split function calls that have 1 arg and exceeds the max_characters_per_line
to multiple lines.
2. Splits Unary expressions that exceed the max_characters_per_line. This is done by formatting the child node
and then removing the prefix indent, which is already applied before the unary operator.
2022-07-07 18:13:36 +05:30
Julien Pivotto 27559e7b4f
Merge pull request #10985 from prometheus/release-2.37
Merge back release 2.37
2022-07-05 16:05:30 +02:00
Julien Pivotto 2479fb42f0
Improve notifier queue test to reduce flakiness (#10984)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-07-05 15:27:26 +02:00
Richard Hartmann 7bb6e7dadd
Merge pull request #10707 from hdost/docs/2106-vector-matching
docs: Add subsections for vector matching
2022-07-05 15:24:47 +02:00
Julien Pivotto 7479cd95b0
Fix UI release script and bump UI release (#10981)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-07-05 15:12:59 +02:00
Julien Pivotto 335562dbfe
Cut v2.37.0-rc.0 (#10971)
* Cut v2.37.0-rc.0

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-07-05 13:10:55 +02:00
dependabot[bot] f389711943
build(deps): bump github.com/aws/aws-sdk-go from 1.44.45 to 1.44.47 (#10960)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.45 to 1.44.47.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.45...v1.44.47)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-05 09:49:52 +02:00
Ganesh Vernekar c6f3d4ab33
Remove temporary patch for out-of-order (#283)
* Remove temporary patch for out-of-order

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

* Remove ooo_wbl patch and fix tests

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-07-04 13:35:18 +00:00
dependabot[bot] 26117fc885
build(deps): bump bufbuild/buf-setup-action from 1.5.0 to 1.6.0 (#10958)
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.5.0...v1.6.0)

---
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>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-04 10:59:51 +02:00
Matthieu MOREL d56d0a9d52
(storage): move from github.com/pkg/errors to 'errors' and 'fmt' (#10946)
Signed-off-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>

Co-authored-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
2022-07-01 18:59:50 +02:00
Julien Pivotto 13bd4fd3c8
Fix promtool check config not erroring properly on failures (#10952)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-07-01 14:38:49 +02:00
Julien Pivotto 90583c8906
TestScrapeLoopCache: Display content of the appender (#10937)
This should help identifying windows tests flakiness.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-07-01 14:28:56 +02:00
Julien Pivotto 02f3297719
Split notifier select in 2 to ensure newer targets are used. (#10948)
* Split notifier select in 2 to ensure newer targets are used.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-07-01 14:23:23 +02:00
Julien Pivotto 4aa693da99
Update go dependencies (#10938)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-06-30 22:10:19 +02:00
Leonardo Zamariola 3326df42bb
Removing global state modification on unit tests (fix #10033 #10034) (#10935)
* Removing global state modification on unit tests (fix #10033 #10034)

The config.DefaultRemoteReadConfig and config.DefaultRemoteWriteConfig
instances hold global state. Unit tests were changing their url.URL reference
globally causing false positives when tests were ran through package.
Two helper functions were created to copy those global values instead of changing
them in place to fix null point when running unit tests by method instead of
by package.

Signed-off-by: Leonardo Zamariola <leonardo.zamariola@gmail.com>

* Fixing pull request suggestions

Copying by value from default config

Signed-off-by: Leonardo Zamariola <leonardo.zamariola@gmail.com>
2022-06-30 10:20:16 -06:00
Julien Pivotto 875c4aa12e
Merge pull request #10915 from attachmentgenie/nomad_sd
feat(nomad): add nomad service discovery
2022-06-30 15:26:20 +02:00
Jesus Vazquez 6cfe44d7fd
WaitUntilIdle optimize idling time (#10878)
Relates to @bboreham optimization in https://github.com/prometheus/prometheus/pull/10859

Bryan did reduce the sleep time improving the deltas on the benchmark by
quite a lot. However I've been working on a similar implementation for
out of order and I noticed that we actually get into this method
thousands of times.

@ywwg had the brilliant idea of not always sleeping before the select
but actually make it a case in the select so we only sleep if we need
to.

The benchmark deltas are amazing

```
❯ benchstat old_implementation.txt new_implementation_using_time_after.txt
name                                                                                                     old time/op  new time/op  delta
LoadWAL/batches=10,seriesPerBatch=100,samplesPerSeries=7200,exemplarsPerSeries=0,mmappedChunkT=0-8        521ms ±25%   253ms ± 6%  -51.47%  (p=0.008 n=5+5)
LoadWAL/batches=10,seriesPerBatch=100,samplesPerSeries=7200,exemplarsPerSeries=36,mmappedChunkT=0-8       773ms ± 3%   369ms ±31%  -52.23%  (p=0.008 n=5+5)
LoadWAL/batches=10,seriesPerBatch=100,samplesPerSeries=7200,exemplarsPerSeries=72,mmappedChunkT=0-8       592ms ±28%   297ms ±28%  -49.80%  (p=0.008 n=5+5)
LoadWAL/batches=10,seriesPerBatch=100,samplesPerSeries=7200,exemplarsPerSeries=360,mmappedChunkT=0-8      547ms ± 2%  999ms ±187%     ~     (p=0.690 n=5+5)
LoadWAL/batches=10,seriesPerBatch=10000,samplesPerSeries=50,exemplarsPerSeries=0,mmappedChunkT=0-8        11.3s ± 4%    1.3s ±44%  -88.48%  (p=0.008 n=5+5)
LoadWAL/batches=10,seriesPerBatch=10000,samplesPerSeries=50,exemplarsPerSeries=2,mmappedChunkT=0-8        11.1s ± 1%    1.2s ±20%  -89.08%  (p=0.008 n=5+5)
LoadWAL/batches=10,seriesPerBatch=1000,samplesPerSeries=480,exemplarsPerSeries=0,mmappedChunkT=0-8        1.24s ± 3%   0.18s ± 7%  -85.76%  (p=0.008 n=5+5)
LoadWAL/batches=10,seriesPerBatch=1000,samplesPerSeries=480,exemplarsPerSeries=2,mmappedChunkT=0-8        1.24s ± 2%   0.18s ± 5%  -85.24%  (p=0.008 n=5+5)
LoadWAL/batches=10,seriesPerBatch=1000,samplesPerSeries=480,exemplarsPerSeries=5,mmappedChunkT=0-8        1.23s ± 5%   0.27s ±33%  -77.73%  (p=0.008 n=5+5)
LoadWAL/batches=10,seriesPerBatch=1000,samplesPerSeries=480,exemplarsPerSeries=24,mmappedChunkT=0-8       1.28s ± 1%   0.36s ± 7%  -71.51%  (p=0.008 n=5+5)
LoadWAL/batches=100,seriesPerBatch=1000,samplesPerSeries=480,exemplarsPerSeries=0,mmappedChunkT=3800-8    12.1s ± 1%    3.1s ± 6%  -74.33%  (p=0.008 n=5+5)
LoadWAL/batches=100,seriesPerBatch=1000,samplesPerSeries=480,exemplarsPerSeries=2,mmappedChunkT=3800-8    12.1s ± 1%    3.4s ± 4%  -71.94%  (p=0.008 n=5+5)
LoadWAL/batches=100,seriesPerBatch=1000,samplesPerSeries=480,exemplarsPerSeries=5,mmappedChunkT=3800-8    12.1s ± 1%    3.8s ±17%  -68.35%  (p=0.008 n=5+5)
LoadWAL/batches=100,seriesPerBatch=1000,samplesPerSeries=480,exemplarsPerSeries=24,mmappedChunkT=3800-8   12.4s ± 1%    4.0s ±18%  -67.71%  (p=0.008 n=5+5)
```

Benchmarked on Linux
```
goos: linux
goarch: amd64
pkg: github.com/prometheus/prometheus/tsdb
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
```

Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
2022-06-30 15:00:04 +02:00
renzheng.wang db2614102f
add description for __meta_kubernetes_endpoints_label_* and __meta_kubernetes_endpoints_labelpresent_* (#10911)
* add description for __meta_kubernetes_endpoints_label_* and __meta_kubernetes_endpoints_labelpresent_*

Signed-off-by: renzheng.wang <wangrzneu@gmail.com>
2022-06-30 18:22:53 +05:30
Julien Pivotto 466f053a6e nomad: Use failuresCount counter
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-06-30 14:19:58 +02:00
Julien Pivotto d9347bf128 nomad: Fix documentation and comments.
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-06-30 14:19:55 +02:00
Bram Vogelaar 4456dcc26e feat(nomad): add nomad service discovery
Signed-off-by: Bram Vogelaar <bram@attachmentgenie.com>
2022-06-30 14:17:08 +02:00
Augustin Husson 7b006e804c
enable ui module publication (#10876)
* enable ui module publication

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* use main changelog of Prometheus to reflect the changes of the packages

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* ignore changelog and license in the libs

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* replace perses references

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-06-30 12:10:10 +02:00
A. Gavin 8f16cc99ec
docs: clarify supported tls cipher suites (#10903)
Signed-off-by: Alex Gavin <a_gavin@icloud.com>
2022-06-30 11:34:49 +02:00
Julien Pivotto c637705403
Merge pull request #10893 from prymitive/unwrap_errors
Implement Unwrap() on errors returned from rulefmt
2022-06-30 11:30:21 +02:00
Julien Pivotto bacd776356
Merge pull request #10907 from damnever/fix/panic
Fix panic if series is not found when deleting series
2022-06-30 11:23:08 +02:00