Commit graph

11585 commits

Author SHA1 Message Date
Bartol Deak 796842d8a8 Hide which stderr output
Signed-off-by: Bartol Deak <b@bdeak.net>
2023-07-04 15:01:01 +00:00
timmartin-stripe 5c1b02ec6e Add sentence explaining what happens when the for clause is omitted (#12457)
Just adding a statement here explaining that the default is an
immediate move to "active" without a pending state.

Signed-off-by: Tim Martin <tim@timmartin.me>
2023-07-04 15:01:01 +00:00
Jayapriya Pai 115f31392a docs: update prometheus-operator link
Signed-off-by: Jayapriya Pai <janantha@redhat.com>
2023-07-04 15:01:01 +00:00
Oleg Zaytsev 65d38b6771 mv labels_string.go labels_stringlabels.go (#12328)
This is a minor cosmetical change, but my IDE (and I guess many of them)
nests `labels_string.go` under `labels.go` because it assumes it's the
file generated by the `stringer` tool, which follows that naming
pattern.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2023-07-04 15:01:01 +00:00
Arthur Silva Sens 873411ffce Add feature flag to squash metadata from /api/v1/metadata (#12391)
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
2023-07-04 15:01:01 +00:00
sinkingpoint 8bfb886573 Remove trailing commas from Exemplar API docs
The trailing commas here make this example invalid JSON. Here we remove
them.

Signed-off-by: sinkingpoint <colin@quirl.co.nz>
2023-07-04 15:01:01 +00:00
Michael Hoffmann 7f9fe4cb5f feat: dont compile regex matcher if we know its a literal (#12434)
labels: dont compile regex matcher if we know its a literal

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>

Co-authored-by: Sharad <sharadgaur@gmail.com>
2023-07-04 15:00:51 +00:00
Leo Q 90f6c1faba add alert for sd refresh failure (#12410)
* add alert for sd refresh failure

Due to config error or sd service down, prometheus may fail to refresh sd resource, which may lead to scrape fail or irrelavant metrics.

Signed-off-by: Leo Q <LeoQuote@users.noreply.github.com>

* apply suggestions

Signed-off-by: Leo Q <LeoQuote@users.noreply.github.com>

---------

Signed-off-by: Leo Q <LeoQuote@users.noreply.github.com>
2023-07-04 13:39:01 +00:00
Julius Volz f5c5806f20 Rename remaining jitterSeed -> offsetSeed variables (#12414)
I had changed the naming from "jitter" to "offset" in:

cb045c0e4b

...but I forgot to add this file to the commit to complete the renaming,
doing that now.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2023-07-04 13:39:01 +00:00
rakshith210 27717faa1d Add Azure AD package for remote write (#11944)
* Add Azure AD package for remote write
* Made AzurePublic default and updated configuration.md
* Updated config structure and removed getToken at initialization
* Changed passing context from request

Signed-off-by: Rakshith Padmanabha <rapadman@microsoft.com>
Signed-off-by: rakshith210 <rakshith.me@gmail.com>
2023-07-04 13:39:01 +00:00
Nidhey Nitin Indurkar e970f70ced Feat: Get block by id directly on promtool analyze & get latest block if ID not provided (#12031)
* feat: analyze latest block or block by ID in CLI (promtool)

Signed-off-by: nidhey27 <nidhey.indurkar@infracloud.io>

* address remarks

Signed-off-by: nidhey60@gmail.com <nidhey.indurkar@infracloud.io>

* address latest review comments

Signed-off-by: nidhey60@gmail.com <nidhey.indurkar@infracloud.io>

---------

Signed-off-by: nidhey27 <nidhey.indurkar@infracloud.io>
Signed-off-by: nidhey60@gmail.com <nidhey.indurkar@infracloud.io>
2023-07-04 13:39:01 +00:00
Alan Protasio 45bf89a3c0 Improving Performance on the API Gzip Handler (#12363)
Using github.com/klauspost/compress package to replace the current Gzip Handler on the API.
We see significant improvements using this handler over the current one as shown in the benchmark added.

Also:
* move selection of compression from `newCompressedResponseWriter` to `*CompressionHandler.ServeHTTP`.
* renaming `compressedResponseWriter` since it now only does one kind of compression.

Signed-off-by: Alan Protasio <alanprot@gmail.com>
2023-07-04 13:39:01 +00:00
Alan Protasio e18ee99544 Opmizing Group Regex (#12375)
Signed-off-by: Alan Protasio <alanprot@gmail.com>
2023-07-04 13:39:01 +00:00
Arianna Vespri ce3a8da5ad Add limits to global config (#12126)
* Add limits to global config

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Move changes into Validate func

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Make comments consistent wrt 0 meaning no limit

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Document global limits

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

---------

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>
2023-07-04 13:38:31 +00:00
SuperQ a40f397d00 Update exporter-toolkit
Adds web config option `client_allowed_sans`. This enables Prometheus to
limit the Subject Alternate Name (SAN) allowed to connect.

Signed-off-by: SuperQ <superq@gmail.com>
2023-07-04 13:38:31 +00:00
Bryan Boreham cb952d3aa1 Alerts: more efficient relabel on Send
Re-use `labels.Builder` and use `relabel.ProcessBuilder` to skip a
conversion step.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-07-04 13:38:31 +00:00
Bryan Boreham 8395cdcdb0 Alerts: more efficient generation of target labels
Use a label builder instead of a slice when creating labels for the
target alertmanagers. This can be passed directly to
`relabel.ProcessBuilder`, skipping a copy.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-07-04 13:38:31 +00:00
Matthieu MOREL 98dfe2364d yamllint: don’t check keys and add file extension to config file
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-07-04 13:38:31 +00:00
cui fliter a6454ccbca fix problematic link (#12405)
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-07-04 13:38:31 +00:00
Julien Pivotto 06836bcd57 Update OpenTelemetry dependencies
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-07-04 13:38:31 +00:00
Julien Pivotto 90344ebe77 Mark 2.45 as LTS
As the 2.37 LTS is going EOL in July 2023, let's mark 2.45 as LTS. I
have synced with Jesus about this. He will bootstrap the release and
after a few week I will do the maintenance for the lifetime of the LTS.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-07-04 13:38:31 +00:00
Patryk Prus ad5d680a15 Render background in images to play nicely with dark mode
Signed-off-by: Patryk Prus <p@trykpr.us>
2023-07-04 13:38:31 +00:00
znley 6f6af5a59b fix: RLIM_INFINITY type is uint64 on loong64
Signed-off-by: znley <shanjiantao@loongson.cn>
2023-07-04 13:38:31 +00:00
Matthieu MOREL 584966f1c4 ci(lint): enable predeclared linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-07-04 13:38:31 +00:00
marcoderama 64b2a379db Update functions.md
Fix small typo

Signed-off-by: marcoderama <marcoderamagit@gmail.com>
2023-07-04 13:38:31 +00:00
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