Commit graph

10062 commits

Author SHA1 Message Date
Peter Štibraný 1e2d2fb2d8
Job queue (#247)
This PR reimplements chan chunkWriteJob with custom buffered queue that should use less memory, because it doesn't preallocate entire buffer for maximum queue size at once. Instead it allocates individual "segments" with smaller size.

As elements are added to the queue, they fill individual segments. When elements are removed from the queue (and segments), empty segments can be thrown away. This doesn't change memory usage of the queue when it's full, but should decrease its memory footprint when it's empty (queue will keep max 1 segment in such case).
2022-06-07 17:42:28 +02:00
Mauro Stettler 459f59935c
Reduce chunk write queue memory usage (#131)
* dont waste space on the chunkRefMap
* add time factor
* add comments
* better readability
* add instrumentation and more comments
* formatting
* uppercase comments
* Address review feedback. Renamed "free" to "shrink" everywhere, updated comments and threshold to 1000.
* double space

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
2022-06-02 13:48:30 +02:00
Oleg Zaytsev ceaa77f14d
Merge pull request #234 from grafana/56quarters/mimir-issue-1866
When removing start/end text op in regexp, don't break the contract.
2022-05-18 08:17:08 -07:00
Oleg Zaytsev c8bce5d8c5
When cleaning up the only element, make a nop.
We can't remove the only Sub from regexp, since the contract for some
operations says that there's at least one Sub, like OpStar or OpPlus.

In order to convert a single-sub element into a no-op, we change the
operation to OpEmptyString.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2022-05-17 17:49:19 +02:00
Nick Pillitteri 8120398f6c WIP: Demo for mimir issue 1866 2022-05-17 09:38:50 -04:00
Mauro Stettler 64e6c171c2
Merge pull request #216 from grafana/merge_upstream
add option to use the new chunk disk mapper from upstream
2022-04-25 11:27:15 -04:00
Mauro Stettler 55cbbafe38
update comment
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
2022-04-25 15:05:21 +00:00
Oleg Zaytsev 19bfb1e6e1
Merge pull request #221: Update prometheus to af0f6da5
Update prometheus to `af0f6da5`
2022-04-20 18:18:44 +02:00
Oleg Zaytsev 9d66af50a8
Fix TestMemSeries_append_atVariableRate
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2022-04-20 17:50:05 +02:00
Oleg Zaytsev ac87e2d4d6 Merge remote-tracking branch 'prometheus/main' into update-prometheus 2022-04-20 17:39:51 +02:00
Oleg Zaytsev af0f6da5cb
Fix chunk overflow appending samples at a variable rate (#10607)
* Add a test with variable samples rate append

This test overflows the chunk created in memseries, and the total amount
of samples in the (only) mmapped chunk is 29, instead of the 65565
appended ones.

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

* Cut new chunk when rate prediction was wrong

When appending samples at a slow rate, and then appending at a higher
rate, the prediction we made to cut a new chunk is no longer valid.
Sometimes this can even cause an overflow in the chunk, if more samples
than uint16 can hold are appended.

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

* Improve comment on 2*samplesPerChunk

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

* Assert that all chunks have less than 240 samples

Also, trigger new chunk at 240, not at more than 240

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2022-04-20 14:54:20 +02:00
Mauro Stettler 00f1b1556c
undo renaming
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
2022-04-19 20:16:20 +00:00
Mauro Stettler 2eef3e76b8
check return status of cutnewfile
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
2022-04-19 20:15:37 +00:00
Mauro Stettler 3fa636a799
fix unit test
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
2022-04-19 19:57:33 +00:00
Mauro Stettler 04114aa2e6
add old chunk disk mapper back
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
2022-04-19 19:21:22 +00:00
Mauro Stettler bd50b04fed
remove old chunk disk mapper initialization and replace it with the upstream one
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
2022-04-18 18:03:05 +00:00
Paschalis Tsilias 40c1efe8bc
tsdb/agent: Ignore duplicate exemplars (#10595)
* tsdb/agent: Ignore duplicate exemplars

Signed-off-by: Paschalis Tsilias <paschalist0@gmail.com>

* Make each exemplar unique in TestCommit

Signed-off-by: Paschalis Tsilias <paschalist0@gmail.com>

* Re-Trigger CI for Windows and UI-related steps

Signed-off-by: Paschalis Tsilias <paschalist0@gmail.com>

* Change test comment to properly re-trigger pipeline

Signed-off-by: Paschalis Tsilias <paschalist0@gmail.com>

* Defer Close() calls for test agent and segment reader

Signed-off-by: Paschalis Tsilias <paschalist0@gmail.com>
2022-04-18 11:41:04 -04:00
Paschalis Tsilias 4deb1a90d2 Amend Protobuf docstrings referring to model/ packages
Signed-off-by: Paschalis Tsilias <paschalist0@gmail.com>
2022-04-16 00:37:16 +02:00
Jesus Vazquez ee2f94b752
Merge pull request #209 from grafana/jvp/merge-prometheus-main
Merge prometheus/main
2022-04-15 12:40:51 +02:00
Jesus Vazquez a07d60a5dd Remove codeql analysis workflow 2022-04-15 12:16:42 +02:00
Jesus Vazquez 7106db9303 Merge remote-tracking branch 'upstream/main' into jvp/merge-prometheus-main 2022-04-15 12:09:46 +02:00
Julien Pivotto 685ce9964d
Merge pull request #10599 from prometheus/release-2.35
Merge back release 2.35
2022-04-15 00:10:06 +02:00
Julien Pivotto 624967fdbf
Add note about Prometheus as a library (#10594)
* Add note about Prometheus as a library

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-04-14 22:23:47 +02:00
Augustin Husson 5b80eaa3ca
cut v2.35.0-rc1 (#10596)
* cut v2.35.0-rc1

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-04-14 16:41:28 +02:00
Goutham Veeramachaneni ec3d02019e
Pass the correct context to staleness Appender (#10588)
OTel Collector prints the following error when a target disappears:

```
2022-04-13T14:20:24.932-0400	warn	scrape/scrape.go:1408	Stale append failed	{"kind": "receiver", "name": "prometheus", "scrape_pool": "beep-boop", "target": "http://localhost:9090/metrics", "error": "transaction aborted"}
```

This `transaction aborted` error is returned by the custom appender that is
used by the collector when the context of the appender is cancelled:
b7bf11174e/receiver/prometheusreceiver/internal/otlp_transaction.go (L81-L82)

We call `endOfRunStaleness` after `sl.stop()` which cancels `sl.ctx`.
The other `.Appender()` calls use `parentCtx` for the same reason.

This hasn't come up so far because Prometheus' Appender implementation just
ignores the context passed.

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
2022-04-14 10:03:07 -04:00
Julien Pivotto b4d0dcb6e8 Tracing/GRPC: Set TLS credentials only when insecure is false.
Fixes #10542

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-04-14 15:18:59 +02:00
Julien Pivotto db8c550570
Revoke storing target and metadata cache in context. (#10590)
Storing the scrape cache and the target (which also contains that cache)
is apparently causing hige memory increase. I think me might not control
the lifespan of the context enough, therefore old objects keep living in
memory for longer than needed.

Let's unblock the release and look for an alternative so that downstream
consumers can get access to that data.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-04-14 15:18:46 +02:00
Julien Pivotto 4d8b77546d
Changelog: add missing enhancement (#10593)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-04-14 15:05:26 +02:00
Jayapriya Pai 580e852f10 scrape: Update error message for label limits
Signed-off-by: Jayapriya Pai <janantha@redhat.com>
2022-04-14 11:43:17 +02:00
Robert Fratto 286dfc70b7
tsdb/agent: port grafana/agent#676 (#10587)
* tsdb/agent: port grafana/agent#676

grafana/agent#676 fixed an issue where a loading a WAL with multiple
segments may result in ref ID collision. The starting ref ID for new
series should be set to the highest ref ID across all series records
from all WAL segments.

This fixes an issue where the starting ref ID was incorrectly set to the
highest ref ID found in the newest segment, which may not have any ref
IDs at all if no series records have been appended to it yet.

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* tsdb/agent: update terminology (s/ref ID/nextRef)

Signed-off-by: Robert Fratto <robertfratto@gmail.com>
2022-04-14 10:27:06 +02:00
TomasKohout a1aa3721e8
uber.go/automaxprocs package upgrade for cgroups2 support (#10584)
Signed-off-by: Tomas Kohout <tomas.kohout1995@gmail.com>
2022-04-13 09:41:28 -04:00
Ganesh Vernekar f78acd1986
Merge pull request #199 from grafana/jvp/merge-prometheus-main
Merges prometheus/main into mimir-prometheus/main
2022-04-13 18:43:01 +05:30
Jesus Vazquez 51f26e0cba Necessary changes to make the merge work
This commit disables some unused workflows on our CI.

Also uses grafana/regexp instead of regexp which is blackisted.

Also updates head_test TestHeadReadWriterRepair increasing
ChunkWriteQueueSize to 1 so that the chunk disk mapper uses the async
queue. This seems to be default behaviour in upstream prometheus and
without this option our test fails.
2022-04-13 14:45:43 +02:00
Julien Pivotto a5e75f3551
changelog: Add missing enhancements (#10583)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2022-04-13 05:29:48 -05:00
Julien Pivotto dc8b673299
Build the UI when making UI tarball (#10578)
We run ui-install on ci but not ui-build. This PR resolves that.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2022-04-12 19:22:51 +01:00
Julien Pivotto 1186974715
Publish UI release artefact in our github releases (#10577)
This will make UI static files part of the release artefacts, for
consumption by downstream distributions.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2022-04-12 19:23:02 +02:00
Jesus Vazquez 48aa5cd096 Merge remote-tracking branch 'upstream/main' into jvp/merge-prometheus-main 2022-04-12 16:40:00 +02:00
Jesus Vazquez c02b13b7f4
Discard unknown chunk encodings (#196)
* Chunks replay skips chunks with unknown encodings

We've changed the logic of loadMmappedChunks to skip chunks that have
unknown encodings. To do so we've modified IterateAllChunks to accept an
extra encoding argument in the callback function.

Also added unit tests in the head and chunk disk mapper.

* Also add an unit test for the old chunk diskmapper

* s/createUnsupportedChunk/writeUnsupportedChunk/g
2022-04-12 10:35:10 +00:00
chavacava 0b41fd6e71
Fix data races in WAL replay (#10571)
Signed-off-by: chavacava <salvadorcavadini+github@gmail.com>
2022-04-12 16:00:20 +05:30
Jesus Vazquez 5db6963dea
Fix linting errors (#198) 2022-04-12 10:15:22 +00:00
Julien Pivotto 8abef6d661
Proper support for go modules. (#10486)
* Proper support for go modules.

This pull requests makes Prometheus go-mod compatible.

The general idea is to release the Prometheus libraries as v0.x
releases, next to the v2.x tags used by end users.

This is done by mirroring Prometheus 2.x tags with Prometheus 0.x tags.

When v2.X.0 is released, we would release v0.X.0.

Pre-go mod versions are retracted from go.mod. This is not nice but
should work.

Only v2.x tags will be built and released by CI. v0.x.x tags would just
be normal tags in the repo, not promoted as releases.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2022-04-12 11:00:54 +02:00
Alan Protasio ce6a643ee8
Changing TotalQueryableSamples from int to int64 (#10549)
* Changing TotalQueryableSamples from int to int64

Signed-off-by: Alan Protasio <approtas@amazon.com>
2022-04-12 01:22:25 +02:00
Ted Robertson 08de38b700 Api docs: fix link to time durations
Signed-off-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2022-04-11 14:12:21 +02:00
Augustin Husson 5b73e51826
cut v2.35.0-rc0 (#10543)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-04-08 14:19:26 +02:00
Luke Chen 6555cc68ca
Make the make build depends on npm_licenses task (#7843)
Signed-off-by: Luke Chen <showuon@gmail.com>
2022-04-08 13:47:59 +02:00
Julien Pivotto 344b272b3e
Fix assets tarball (#10548)
The tarball should be compressed and only use uncompressed assets. In
that way, uit can be used by downstream distros easily. they can either
download the assets and serve it as is or use the compress script to
have it in the binary.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2022-04-08 00:23:15 +02:00
dependabot[bot] 90e6db6d45
build(deps): bump @fortawesome/free-solid-svg-icons in /web/ui (#10557)
Bumps [@fortawesome/free-solid-svg-icons](https://github.com/FortAwesome/Font-Awesome) from 6.0.0 to 6.1.1.
- [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
- [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md)
- [Commits](https://github.com/FortAwesome/Font-Awesome/compare/6.0.0...6.1.1)

---
updated-dependencies:
- dependency-name: "@fortawesome/free-solid-svg-icons"
  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-04-07 15:55:26 +02:00
dependabot[bot] 892f6baaeb
build(deps-dev): bump sinon from 12.0.1 to 13.0.1 in /web/ui (#10553)
Bumps [sinon](https://github.com/sinonjs/sinon) from 12.0.1 to 13.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v12.0.1...v13.0.1)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 15:28:21 +02:00
dependabot[bot] bc3561b7d2
build(deps): bump @fortawesome/fontawesome-svg-core in /web/ui (#10552)
Bumps [@fortawesome/fontawesome-svg-core](https://github.com/FortAwesome/Font-Awesome) from 1.3.0 to 6.1.1.
- [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
- [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md)
- [Commits](https://github.com/FortAwesome/Font-Awesome/commits/6.1.1)

---
updated-dependencies:
- dependency-name: "@fortawesome/fontawesome-svg-core"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 14:59:12 +02:00
dependabot[bot] 84c72a5e88
build(deps): bump moment from 2.29.1 to 2.29.2 in /web/ui (#10533)
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  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-04-07 14:50:26 +02:00