Commit graph

11242 commits

Author SHA1 Message Date
Peter Štibraný 44904a663c
Rename "execution time" to "evaluation time". (#401)
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
2023-01-19 15:11:44 +00:00
Peter Štibraný 806e71e828
Option to align rule group's evaluation time to interval (#400)
* Allow rule groups evaluation timestamp to be aligned on the evaluation interval.

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
2023-01-19 14:51:26 +01:00
beorn7 57c18420ab histograms: General readability tweaks
- Adjust doc comments to go1.19 style.
- Break down some overly long lines.
- Minor doc comment tweaks and fixes.
- Some renaming.

Some rationales for the last point:

I have renamed “interjections” into “inserts”, mostly because it is
shorter, and the word shows up a lot by now (and the concept is
cryptic enough to not obfuscate it even more with abbreviations).

I have also tried to find more descriptive naming for the “compare
spans” functions.

Signed-off-by: beorn7 <beorn@grafana.com>
2023-01-19 13:26:42 +01:00
Julien Pivotto c0724f4e62 New test
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-01-19 11:56:04 +01:00
Julien Pivotto 2c408289f8 Add stabilizing to UI
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-01-19 11:33:54 +01:00
Julien Pivotto 8e500dbd39 Add rulefmt tests
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-01-19 10:44:35 +01:00
Julien Pivotto 5ad74e6e71 Add tests
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-01-19 10:36:01 +01:00
fayzal-g cfa4ea53cc Correctly update chunksRemoved and chunks metrics
Signed-off-by: fayzal-g <fayzal.ghantiwala@grafana.com>
2023-01-18 10:58:48 +00:00
Frederic Branczyk 9f91215bf6
Merge pull request #11844 from bawhetst/add-pod-container-id
discovery/kubernetes: add container ID as a meta label for pod targets
2023-01-17 19:19:22 +01:00
Ben Whetstone 52d5a7c60f Document the __meta_kubernetes_pod_container_id meta label
Signed-off-by: Ben Whetstone <ben.whetstone@sysdig.com>
2023-01-17 11:15:52 -05:00
George Krajcsovits fa6d2a8ede
Merge pull request #398 from grafana/krajo/merge-upstream-main
Update to prometheus/prometheus@e6f84d5

To get prometheus/prometheus#11856
2023-01-17 14:26:19 +01:00
Julien Pivotto c457dc48ae
Merge pull request #11745 from roidelapluie/promci
Switch to promci
2023-01-17 14:01:33 +01:00
György Krajcsovits cf4537a5f2 Merge remote-tracking branch 'upstream/main' into krajo/merge-upstream-main
At e6f84d5445
2023-01-17 13:42:29 +01:00
Ganesh Vernekar e6f84d5445
Merge pull request #11856 from codesome/mergecleanup
tsdb: Avoid unnecessary allocation from 11779
2023-01-17 17:31:37 +05:30
Ganesh Vernekar 6e560fe19b
tsdb: Avoid unnecessary allocation from 11779
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-17 16:53:49 +05:30
Bryan Boreham a1b10f0905
Merge pull request #11853 from bboreham/fixup-storage-test
package storage: fix up test not to access Labels internals
2023-01-17 09:55:10 +00:00
FG d44f63ec48
Merge pull request #395 from grafana/merge-jan-16-upstream
Merge Jan 16 from Upstream
2023-01-17 09:52:02 +00:00
Ganesh Vernekar 46a7a2c911
Merge pull request #11851 from jerry-shao/main
tsdb: Fixed typo in Histogram
2023-01-17 09:57:36 +05:30
Bryan Boreham faac4c066d package storage: fix up test not to access Labels internals
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-01-16 18:48:49 +00:00
Bryan Boreham b768247df8
Merge pull request #11760 from bboreham/discovery-log-setname
service discovery: add name to log messages
2023-01-16 17:57:47 +00:00
Bryan Boreham 75e5d600d9
Merge pull request #11748 from bboreham/safe-scrape
scrape: remove unsafe code
2023-01-16 17:57:12 +00:00
fayzal-g e320585436 Remove log 2023-01-16 17:47:03 +00:00
fayzal-g 026fcb2f86 Log failed query 2023-01-16 17:25:24 +00:00
fayzal-g d2ac103ba9 Remove comments 2023-01-16 15:49:49 +00:00
fayzal-g 7aef6e28fe Merge remote-tracking branch 'upstream/main' into merge-jan-16-upstream 2023-01-16 15:24:00 +00:00
Julien Pivotto a35e54cc56
Merge pull request #11786 from LeviHarrison/remove-nomad-datacenter-docs
Remove Nomad `datacenter` field in configuration docs
2023-01-16 14:42:40 +01:00
Mingjie Shao 78d3c4e823 tsdb: Fixed typo in Histogram
Signed-off-by: Mingjie Shao <com.jerryshao@jerryshao.com>
2023-01-16 18:13:45 +08:00
Ganesh Vernekar cb2be6e62f
Merge pull request #11779 from codesome/memseries-ooo
tsdb: Only initialise out-of-order fields when required
2023-01-16 10:58:05 +05:30
Jesus Vazquez 136956cca4
Attempt to append ooo sample at the end first (#11615)
This is an optimization on the existing append in OOOChunk.

What we've been doing so far is find the place inside the out-of-order
slice where the new sample should go in and then place it there and move
any samples to the right if necessary. This is OK but requires a binary
search every time the slice is bigger than 0.

The optimization is opinionated and suggests that although out-of-order
samples can be out-of-order amongst themselves they'll probably be in
order thus we can probably optimistically append at the end and if not
do the binary search.

OOOChunks are capped to 30 samples by default so this is a small
optimization but everything adds up, specially if you handle many active
timeseries with out-of-order samples.

Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
Signed-off-by: Jesus Vazquez <jesusvazquez@users.noreply.github.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-13 19:00:50 +05:30
Julien Pivotto ce55e5074d Add 'keep_firing_for' field to alerting rules
This commit adds a new 'keep_firing_for' field to Prometheus alerting
rules. The 'resolve_delay' field specifies the minimum amount of time
that an alert should remain firing, even if the expression does not
return any results.

This feature was discussed at a previous dev summit, and it was
determined that a feature like this would be useful in order to allow
the expression time to stabilize and prevent confusing resolved messages
from being propagated through Alertmanager.

This approach is simpler than having two PromQL queries, as was
sometimes discussed, and it should be easy to implement.

This commit does not include tests for the 'resolve_delay' field.  This
is intentional, as the purpose of this commit is to gather comments on
the proposed design of the 'resolve_delay' field before implementing
tests. Once the design of the 'resolve_delay' field has been finalized,
a follow-up commit will be submitted with tests."

See https://github.com/prometheus/prometheus/issues/11570

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-01-13 12:11:39 +01:00
Marc Tudurí 721f33dbb0
histograms: Add remote-write support for Float Histograms (#11817)
* adapt code.go and write_handler.go to support float histograms
* adapt watcher.go to support float histograms
* wip adapt queue_manager.go to support float histograms
* address comments for metrics in queue_manager.go
* set test cases for queue manager
* use same counts for histograms and float histograms
* refactor createHistograms tests
* fix float histograms ref in watcher_test.go
* address PR comments

Signed-off-by: Marc Tuduri <marctc@protonmail.com>
2023-01-13 16:39:20 +05:30
Ganesh Vernekar 72f20d949a
Merge pull request #11830 from codesome/histo-fed
Support native histograms in federation
2023-01-12 21:54:44 +05:30
Sebastian Rabenhorst c057318578
agent: native histogram support (#11842)
Signed-off-by: Sebastian Rabenhorst <sebastian.rabenhorst@shopify.com>
2023-01-12 11:13:44 -05:00
beorn7 d121db7a65
federate: Fix PeekBack usage
In most cases, there is no sample at `maxt`, so `PeekBack` has to be
used. So far, `PeekBack` did not return a float histogram, and we
disregarded even any returned normal histogram. This fixes both, and
also tweaks the unit test to discover the problem (by using an earlier
timestamp than "now" for the samples in the TSDB).

Signed-off-by: beorn7 <beorn@grafana.com>
2023-01-12 20:43:02 +05:30
Ganesh Vernekar b4e15899d1
docs: Update recording rule docs about native histograms
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-12 20:43:02 +05:30
Ganesh Vernekar 2e538be5d7
docs: Update federation docs for native histograms
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-12 20:43:02 +05:30
Ganesh Vernekar 7a88bc3581
Test federation with native histograms
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-12 20:43:02 +05:30
Ganesh Vernekar 33f880d123
Add native histogram support in federation
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-12 20:42:59 +05:30
Ganesh Vernekar 38fa151a7c
tsdb: Only initialise out-of-order fields when required
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-12 20:29:16 +05:30
Bryan Boreham 0bc8438f38 Rename WithCache functions as WithOptions
Where they now have 2 or more extra parameters.
2023-01-12 11:41:22 +00:00
Bryan Boreham 1aaabfee2d tsdb: make sharding function a parameter
Instead of relying on `labels.Hash()`, which may change, have the
caller pass in a shard function if required.

For most purposes `tsdb.Options.ShardFunc` is used, but the compactor
may be created independently so `NewLeveledCompactorWithChunkSize` also
takes a shard function parameter.

Regular Prometheus, which does not use block sharding, will have this
parameter as nil.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-01-12 11:41:22 +00:00
Bryan Boreham 2f58be840d service discovery: add config name to log messages
This makes it easier to connect a log message with the config it relates
to.

Each SD config has a name, either the scrape job name or something like
"config-0" for Alertmanager config.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-01-12 11:30:00 +00:00
Ganesh Vernekar d82ea2eb1c
Merge pull request #11838 from codesome/histo-rec
rules: Support native histograms
2023-01-12 12:35:15 +05:30
Ben Whetstone 32e9f6a39c Add container ID as a meta label for pod targets
Signed-off-by: Ben Whetstone <ben.whetstone@sysdig.com>
2023-01-11 11:44:36 -05:00
Björn Rabenstein ac96da3726
Merge pull request #11840 from prometheus/beorn7/histogram-gauge
tsdb: Add integer gauge histogram support
2023-01-11 15:10:51 +01:00
Ganesh Vernekar 98a0523e4a
rules: Test native histograms in recording rules
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-11 18:27:57 +05:30
beorn7 6dcd03dbf3 tsdb: Add integer gauge histogram support
This follows what #11783 has done for float gauge histograms.

Signed-off-by: beorn7 <beorn@grafana.com>
2023-01-11 13:28:43 +01:00
beorn7 3e5ad99c33 textparse: Minor doc comment improvement
Signed-off-by: beorn7 <beorn@grafana.com>
2023-01-11 00:30:55 +01:00
Björn Rabenstein 6948fb1eb6
Merge pull request #11839 from prometheus/beorn7/histogram-gauge
textparse: Set CounterResetHint
2023-01-10 19:29:45 +01:00
beorn7 3f977e89ab textparse: Add tests for float and gauge histograms
Signed-off-by: beorn7 <beorn@grafana.com>
2023-01-10 18:42:05 +01:00