Commit graph

11560 commits

Author SHA1 Message Date
Julius Volz 199cfc1324 Fix wording from "jitterSeed" -> "offsetSeed" for server-wide scrape offsets
In digital communication, "jitter" usually refers to how much a signal deviates
from true periodicity, see https://en.wikipedia.org/wiki/Jitter. The way we are
using the "jitterSeed" in Prometheus does not affect the true periodicity at
all, but just introduces a constant phase shift (or offset) within the period.
So it would be more correct and less confusing to call the "jitterSeed" an
"offsetSeed" instead.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2023-07-04 13:38:31 +00:00
Justin Lei d0fea47a9c Remove samplesPerChunk from memSeries (#12390)
Signed-off-by: Justin Lei <justin.lei@grafana.com>
2023-07-04 13:38:31 +00:00
Bryan Boreham 31164a7373
Merge pull request #509 from grafana/remove-dup-github
Remove duplicated .github directory
2023-07-04 12:08:08 +01:00
Bryan Boreham 3a61decb3d
Merge pull request #510 from grafana/cherrypick-stringlabels
Cherrypick stringlabels optimisations
2023-07-04 11:38:15 +01:00
Bryan Boreham 1e16c60bae labels: improve Get method for stringlabels build (#12485)
Inline one call to `decodeString`, and skip decoding the value string
until we find a match for the name.
Do a quick check on the first character in each string,
and exit early if we've gone past - labels are sorted in order.

Also improve tests and benchmark:
* labels: test Get with varying lengths - it's not typical for Prometheus labels to all be the same length.
* extend benchmark with label not found

---------

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-07-03 20:34:35 +01:00
Bryan Boreham 19c9db3c07 labels: faster Compare function when using -tags stringlabels (#12451)
Instead of unpacking every individual string, we skip to the point
where there is a difference, going 8 bytes at a time where possible.

Add benchmark for Compare; extend tests too.

---------

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Co-authored-by: Oleg Zaytsev <mail@olegzaytsev.com>
2023-07-03 20:34:29 +01:00
Bryan Boreham 8a0c58dda5 Remove duplicated .github directory
Seems to have been an accident 8 months ago.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-06-30 17:15:44 +00:00
Charles Korn 5c270e23ea
Merge pull request #506 from grafana/charleskorn/streaming-timestamp
Don't recreate iterator for each series on each timestep when evaluating a query with `timestamp()`
2023-06-29 14:17:23 +10:00
Charles Korn ad25a5c65f
Add test to confirm timestamp() behaves correctly when evaluating a range query. 2023-06-29 13:34:26 +10:00
Charles Korn 30507ef298
Create per-series iterators only once per selector, rather than recreating it for each time step.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-06-28 15:41:19 +10:00
Charles Korn ab5d9e3be1
Don't create a new iterator for every time step.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-06-28 15:41:19 +10:00
Charles Korn f5bbe2ef9e
Simplify loop
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-06-28 15:41:17 +10:00
Charles Korn 90ac889e1f
Expand series set just once
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-06-28 15:41:15 +10:00
Charles Korn 17b1486964
Inline method
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-06-28 15:41:14 +10:00
Charles Korn 28097c9476
Extract timestamp special case to its own method.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-06-28 15:41:12 +10:00
Charles Korn 8bdcad30a4
Add benchmark for query using timestamp()
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-06-28 15:41:10 +10:00
zenador 8d6690e86a
Merge pull request #505 from grafana/zenador/sync-upstream-22-may-2023
Sync upstream 24 may 2023
2023-05-24 19:58:41 +08:00
Jeanette Tan dd172440e5 Merge remote-tracking branch 'mine/fix-default-samples-per-chunk' into zenador/sync-upstream-22-may-2023 2023-05-24 19:32:04 +08:00
Jeanette Tan 02e113d03f Use DefaultSamplesPerChunk in tsdb
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2023-05-24 16:44:53 +08:00
Jeanette Tan 9f1baaaa38 Fix errors from merge 2023-05-23 01:10:09 +08:00
Jeanette Tan 1be0816b46 Merge remote-tracking branch 'upstream/main' 2023-05-23 00:20:36 +08:00
Baskar Shanmugam 905a0bd63a
Added 'limit' query parameter support to /api/v1/status/tsdb endpoint (#12336)
* Added 'topN' query parameter support to /api/v1/status/tsdb endpoint

Signed-off-by: Baskar Shanmugam <baskar.shanmugam.career@gmail.com>

* Updated query parameter for tsdb status to 'limit'

Signed-off-by: Baskar Shanmugam <baskar.shanmugam.career@gmail.com>

* Corrected Stats() parameter name from topN to limit

Signed-off-by: Baskar Shanmugam <baskar.shanmugam.career@gmail.com>

* Fixed p.Stats CI failure

Signed-off-by: Baskar Shanmugam <baskar.shanmugam.career@gmail.com>

---------

Signed-off-by: Baskar Shanmugam <baskar.shanmugam.career@gmail.com>
2023-05-22 14:37:07 +02:00
Alan Protasio 8c5d4b4add
Opmize MatchNotEqual (#12377)
Signed-off-by: Alan Protasio <alanprot@gmail.com>
2023-05-21 10:41:30 +02:00
George Krajcsovits 92d6980360
Fix populateWithDelChunkSeriesIterator and gauge histograms (#12330)
Use AppendableGauge to detect corrupt chunk with gauge histograms.
Detect if first sample is a gauge but the chunk is not set up to contain
gauge histograms.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
2023-05-19 10:24:06 +02:00
Baskar Shanmugam f731a90a7f
Fix LabelValueStats in posting stats (#12342)
Problem:
LabelValueStats - This will provide a list of the label names and memory used in bytes.
It is calculated by adding the length of all values for a given label name.
But internally Prometheus stores the name and the value independently for each series.

Solution:
MemPostings struct maintains the values to seriesRef map which is used
to get the number of series which contains the label values.
Using that LabelValueStats is calculated as: seriesCnt * len(value
name)

Signed-off-by: Baskar Shanmugam <baskar.shanmugam.career@gmail.com>
2023-05-19 09:36:30 +02:00
Julien Pivotto e53478a08d
Merge pull request #12372 from roidelapluie/consul_path_prefix
Add support for consul path_prefix
2023-05-18 20:16:55 +02:00
Xiaochao Dong 80b7f73d26
Copy tombstone intervals to avoid race (#12245)
Signed-off-by: Xiaochao Dong (@damnever) <the.xcdong@gmail.com>
2023-05-17 15:15:12 +02:00
Julien Pivotto c66fdc19f9
Merge pull request #12373 from prometheus/dependabot/go_modules/github.com/hetznercloud/hcloud-go-1.45.1
build(deps): bump github.com/hetznercloud/hcloud-go from 1.43.0 to 1.45.1
2023-05-17 12:11:24 +02:00
Julien Pivotto 9613d66805
Merge pull request #12369 from roidelapluie/reb243
Merge release 2.43
2023-05-17 10:36:14 +02:00
Julien Pivotto 2657e3a6ac
Merge pull request #12307 from prometheus/dependabot/github_actions/bufbuild/buf-setup-action-1.17.0
build(deps): bump bufbuild/buf-setup-action from 1.16.0 to 1.17.0
2023-05-17 00:49:41 +02:00
dependabot[bot] f26760cf32
build(deps): bump github.com/hetznercloud/hcloud-go
Bumps [github.com/hetznercloud/hcloud-go](https://github.com/hetznercloud/hcloud-go) from 1.43.0 to 1.45.1.
- [Release notes](https://github.com/hetznercloud/hcloud-go/releases)
- [Changelog](https://github.com/hetznercloud/hcloud-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hetznercloud/hcloud-go/compare/v1.43.0...v1.45.1)

---
updated-dependencies:
- dependency-name: github.com/hetznercloud/hcloud-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-16 22:30:22 +00:00
Julien Pivotto 807c1fa146
Merge pull request #12315 from prometheus/dependabot/go_modules/documentation/examples/remote_storage/github.com/prometheus/client_golang-1.15.0
build(deps): bump github.com/prometheus/client_golang from 1.14.0 to 1.15.0 in /documentation/examples/remote_storage
2023-05-17 00:28:57 +02:00
Julien Pivotto 5eb88260da
Merge pull request #12311 from prometheus/dependabot/go_modules/github.com/hetznercloud/hcloud-go-1.43.0
build(deps): bump github.com/hetznercloud/hcloud-go from 1.42.0 to 1.43.0
2023-05-17 00:28:41 +02:00
Julien Pivotto 65c321a250
Merge pull request #12310 from prometheus/dependabot/go_modules/github.com/digitalocean/godo-1.99.0
build(deps): bump github.com/digitalocean/godo from 1.98.0 to 1.99.0
2023-05-17 00:28:32 +02:00
Julien Pivotto 0dc31ade41 Add support for consul path_prefix
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-05-17 00:14:58 +02:00
Julien Pivotto 1991bfb552 Merge remote-tracking branch 'origin/release-2.43'
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-05-16 22:29:52 +02:00
Julien Pivotto 41b3db198c
Merge pull request #12367 from AkshaySiwal/main
Updating signal for graceful shutdown in docs/getting_started.md
2023-05-16 22:25:26 +02:00
zenador 191bf9055b
Handle more arithmetic operators for native histograms (#12262)
Handle more arithmetic operators and aggregators for native histograms

This includes operators for multiplication (formerly known as scaling), division, and subtraction. Plus aggregations for average and the avg_over_time function.

Stdvar and stddev will (for now) ignore histograms properly (rather than counting them but adding a 0 for them).

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2023-05-16 21:15:20 +02:00
Björn Rabenstein 30e263cf96
Merge pull request #12357 from krajorama/fix-histogram-appendable-emptybucket
fix HistogramAppender.appendable segfault
2023-05-16 20:52:39 +02:00
Bryan Boreham a073e04a9b
Merge pull request #12366 from prometheus/release-2.44
Merge release 2.44 back to main
2023-05-16 18:06:29 +01:00
Callum Styan 0d2108ad79
[tsdb] re-implement WAL watcher to read via a "notification" channel (#11949)
* WIP implement WAL watcher reading via notifications over a channel from
the TSDB code

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

* Notify via head appenders Commit (finished all WAL logging) rather than
on each WAL Log call

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

* Fix misspelled Notify plus add a metric for dropped Write notifications

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

* Update tests to handle new notification pattern

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

* this test maybe needs more time on windows?

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

* does this test need more time on windows as well?

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

* read timeout is already a time.Duration

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

* remove mistakenly commited benchmark data files

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

* address some review feedback

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

* fix missed changes from previous commit

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

* Fix issues from wrapper function

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

* try fixing race condition in test by allowing tests to overwrite the
read ticker timeout instead of calling the Notify function

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

* fix linting

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

---------

Signed-off-by: Callum Styan <callumstyan@gmail.com>
2023-05-15 12:31:49 -07:00
Akshay Siwal 4c898fc4a1
Update getting_started.md
Updating signal for graceful shutdown.

Signed-off-by: Akshay Siwal <akshay.singh.siwal@gmail.com>
2023-05-15 13:18:30 +05:30
György Krajcsovits c6618729c9 Fix HistogramAppender.Appendable array out of bound error
The code did not handle spans with 0 length properly.

Spans with length zero are now skipped in the comparison.
Span index check not done against length-1, since length is a unit32,
thus subtracting 1 leads to 2^32, not -1.

Fixes and unit tests for both integer and float histograms added.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2023-05-14 17:38:52 +02:00
Bryan Boreham 1ac5131f69
Release 2.44.0 (#12364)
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-05-14 07:13:03 +01:00
Björn Rabenstein b727e69b76
Merge pull request #12350 from prometheus/beorn7/histogram
textparse/scrape: Add option to scrape both classic and native histograms
2023-05-13 02:16:11 +02:00
beorn7 9e500345f3 textparse/scrape: Add option to scrape both classic and native histograms
So far, if a target exposes a histogram with both classic and native
buckets, a native-histogram enabled Prometheus would ignore the
classic buckets. With the new scrape config option
`scrape_classic_histograms` set, both buckets will be ingested,
creating all the series of a classic histogram in parallel to the
native histogram series. For example, a histogram `foo` would create a
native histogram series `foo` and classic series called `foo_sum`,
`foo_count`, and `foo_bucket`.

This feature can be used in a migration strategy from classic to
native histograms, where it is desired to have a transition period
during which both native and classic histograms are present.

Note that two bugs in classic histogram parsing were found and fixed
as a byproduct of testing the new feature:

1. Series created from classic _gauge_ histograms didn't get the
   _sum/_count/_bucket prefix set.
2. Values of classic _float_ histograms weren't parsed properly.

Signed-off-by: beorn7 <beorn@grafana.com>
2023-05-13 01:32:25 +02:00
Frederic Branczyk 5c5fa5c319
Merge pull request #12338 from mickael-carl/mcarl/attach-node-labels
discovery/kubernetes: attach node labels when the endpoints TargetRef's kind are Node
2023-05-11 12:03:27 +02:00
Jesus Vazquez 1f1dac2cda
Merge pull request #12351 from alanprot/optimization/MatchNotRegexp
Implementing Regex optimization on the `MatchNotRegexp` matcher type
2023-05-11 11:55:17 +02:00
Bryan Boreham fa4f4e4f37
Merge pull request #12349 from rfratto/fix-wlog-path
wlog: use filepath for getting checkpoint number

'path' is intended for things like URLs that are forward-slash-only.
'filepath' is for file paths, as used here.
2023-05-11 10:43:47 +01:00
Mickael Carl 2f35619710 discovery/kubernetes: attach node labels when the endpoints TargetRef's kind are Node
Signed-off-by: Mickael Carl <mcarl@apple.com>
2023-05-11 10:11:56 +01:00