Commit graph

10746 commits

Author SHA1 Message Date
Frederic Branczyk f007555be1
Merge pull request #11801 from ssbostan/main
update ServiceAccount for new kubernetes versions
2023-01-10 15:01:47 +01:00
Ganesh Vernekar 57bcbf1888
Merge pull request #11783 from codesome/gauge-histogram
tsdb: Add gauge histogram support
2023-01-10 19:06:08 +05:30
Ganesh Vernekar 3c2ea91a83
tsdb: Test gauge float histograms
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-10 18:35:37 +05:30
Ganesh Vernekar 609b12d719
tsdb: Support gauge float histogram with recoding of chunk
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-10 17:48:09 +05:30
Ganesh Vernekar 8ad0d2d5d7
tsdb: Find union of two sets of histogram spans
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-10 17:43:33 +05:30
Ganesh Vernekar d7f5129042
tsdb: Add logic to determine appendable gauge float histograms
This is to check if a gauge histogram can be appended to the given chunk.
If not, it tells what changes to make to the chunk and the histogram
if possible.

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-10 17:43:33 +05:30
Ganesh Vernekar a87e7e9e33
tsdb: Add counter reset hint to histograms and support in WAL
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-10 17:41:53 +05:30
Oleg Zaytsev de93a279a0
Shortcut postings for matchers when empty postings are selected (#11813)
* Add more benchmark cases
* Add shortcuts for empty postings

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2023-01-10 15:21:49 +05:30
Ganesh Vernekar fd89d7892c
Merge pull request #11809 from bboreham/dont-sort-postings-values
tsdb: sort values for Postings only when required
2023-01-10 15:02:21 +05:30
Ganesh Vernekar c94a41c4b2
Merge pull request #11785 from Fish-pro/erroris
Use errors.Is to check for a specific error
2023-01-10 14:56:14 +05:30
Sam Jewell f88a0a7d83
Update example rules file to be valid with the default scrape config (#11692)
* Update docs example rules for default config

The prometheus download includes a default config to scrape itself.
This self-scraping prometheus doesn't include any metric named as
`http_inprogress_requests`, but does include one named
`prometheus_http_requests_total`.
Updating this example rule in the docs to one which can be used
out-of-the-box with the default download would be a nice improvement.

Signed-off-by: Sam Jewell <sam.jewell@grafana.com>

* Update syntax as per @LeviHarrison's review

Co-authored-by: Levi Harrison <levisamuelharrison@gmail.com>
Signed-off-by: Sam Jewell <2903904+samjewell@users.noreply.github.com>

Signed-off-by: Sam Jewell <sam.jewell@grafana.com>
Signed-off-by: Sam Jewell <2903904+samjewell@users.noreply.github.com>
Co-authored-by: Levi Harrison <levisamuelharrison@gmail.com>
2023-01-09 19:36:07 -05:00
Julien Pivotto 48bccc50c8
Merge pull request #11831 from robbe-haesendonck/docs/fix-proxy-connect-header
docs: Changed occurences of proxy_connect_headers to proxy_connect_header
2023-01-09 14:19:26 +01:00
Robbe Haesendonck e802ddf435 docs: 📝 Changed occurences of proxy_connect_headers to proxy_connect_header
Since the struct defines proxy_connect_header instead of proxy_connect_headers, all relevant occurences of it were replaced with the correct configuration name as defined in the HTTPClientConfig struct.

Signed-off-by: Robbe Haesendonck <googleit@inuits.eu>
2023-01-09 14:11:00 +01:00
Levi Harrison 3b4cbf8da4
Inject readiness state through context (#11617)
Signed-off-by: Levi Harrison <git@leviharrison.dev>

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2023-01-09 00:04:00 +01:00
Levi Harrison 5a485e15ea
Merge pull request #11822 from krajorama/krajo
Fix comment
2023-01-08 11:06:53 -05:00
György Krajcsovits 97626c9583 Fix comment
Comment was not updated when code changed from labels to builder
in #11717

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2023-01-08 16:29:02 +01:00
Ganesh Vernekar 57cab58c53
Merge pull request #11774 from codesome/rules-ooo
rules: Consider ErrTooOldSample in expected errors
2023-01-06 14:56:14 +05:30
Björn Rabenstein c49a28bb97
Merge pull request #11782 from codesome/floatappendabletest
tsdb: Improve TestFloatHistogramChunkAppendable and TestHistogramChunkAppendable
2023-01-05 17:15:10 +01:00
Saeid Bostandoust da6c014039
update ServiceAccount for new kubernetes versions
Signed-off-by: Saeid Bostandoust <49065072+ssbostan@users.noreply.github.com>
2023-01-05 15:43:48 +00:00
Bryan Boreham e61348d9f3 tsdb/index: fast-track postings for label=""
We need to special-case ""="" too, which is used in some tests to mean "everything".

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-01-05 14:05:54 +00:00
Bryan Boreham cf92cd2688 tsdb: sort values for Postings only when required
In the head and in v1 postings on disk, it makes no difference whether
postings are sorted. Only for v2 does the code step through in order.
So, move the sorting to where it is required, and thus skip it entirely
in the head.

Label values in on-disk blocks are already sorted, but `slices.Sort` is
very fast on already-sorted data so we don't bother checking.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-01-05 14:05:54 +00:00
Bryan Boreham 80ac0d7c82 promql: add benchmark for match against blank string
Blank strings are not handled efficiently by tsdb.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-01-05 14:05:54 +00:00
Ganesh Vernekar f1a332c496
rules: Consider ErrTooOldSample in expected errors
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-05 14:49:30 +05:30
Ganesh Vernekar 7ed1ddb338
tsdb: Improve TestHistogramChunkAppendable and add new cases
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-05 14:44:24 +05:30
Ganesh Vernekar fa0f04bbc6
Merge pull request #11805 from bboreham/fix-benchmark-intersect
tsdb/index: fix BenchmarkIntersect to do work on each loop
2023-01-04 18:19:14 +05:30
Aleksey Smirnov 84c6f0e584
Init value for useState hook calls once (#11802)
Signed-off-by: Smirnov Aleksey <aleksey.smirnov@sbermarket.ru>

Signed-off-by: Smirnov Aleksey <aleksey.smirnov@sbermarket.ru>
Co-authored-by: Smirnov Aleksey <aleksey.smirnov@sbermarket.ru>
2023-01-03 22:09:00 +01:00
Bryan Boreham 3da2c99ffd tsdb/index: don't call ExpandPostings in a benchmark
This allocates memory for all the returned values, which skews the
result. We aren't trying to benchmark `ExpandPostings`, so just step
through all the values without storing them to consume them.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-01-03 15:26:29 +00:00
Bryan Boreham 4931983ca9 tsdb/index: make BenchmarkIntersect do work on each loop
Previously all the postings constructed were consumed on the first
iteration, so subsequent iterations did no work.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-01-03 15:25:38 +00:00
Björn Rabenstein 432ea873c3
Merge pull request #11778 from codesome/float-iso
Staleness handling for FloatHistogram
2023-01-03 13:31:12 +01:00
Levi Harrison 15492d7100
Merge pull request #11681 from dgrisonnet/fix-tokens
Fix error output of the Prometheus parser to display the right tokens
2023-01-02 16:04:20 -05:00
dependabot[bot] 2a9fb757a9
Bump github.com/hetznercloud/hcloud-go from 1.38.0 to 1.39.0 (#11800)
Bumps [github.com/hetznercloud/hcloud-go](https://github.com/hetznercloud/hcloud-go) from 1.38.0 to 1.39.0.
- [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.38.0...v1.39.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 15:59:47 -05:00
Saeid Bostandoust 3c468cd4e8
update ServiceAccount for new kubernetes versions
Signed-off-by: Saeid Bostandoust <49065072+ssbostan@users.noreply.github.com>
2023-01-02 14:17:11 +00:00
Damien Grisonnet 96b9d8cebb model/textparse: associate correct token to errors
In some cases, the Prometheus HTTP format parser was not returning the
right token in the error output which made debugging impossible.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-01-02 13:57:27 +01:00
Fish-pro 6ed71a229e Use errors.Is to check for a specific error
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
2022-12-29 23:23:07 +08:00
Ganesh Vernekar b42802af9a
tsdb: Improve TestFloatHistogramChunkAppendable and add new cases
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-12-28 21:07:47 +05:30
Marc Tudurí 49f775d8a0
histograms: Add missing float histograms tests for PromQL (#11780)
* test: TestSparseHistogramRate

* test: TestSparseHistogram_HistogramQuantile

* test: TestSparseHistogram_HistogramFraction

* test: TestSparseHistogram_HistogramFraction

* test: TestSparseHistogram_Sum_Count_AddOperator

* test: TestSparseHistogram_HistogramCountAndSum

* tests: fix TestSparseHistogram_HistogramCountAndSum

* linter

* refactor TestSparseHistogram_HistogramCountAndSum

* wrap TestSparseHistogram_HistogramCountAndSum

Signed-off-by: Marc Tuduri <marctc@protonmail.com>
2022-12-28 19:15:47 +05:30
Ganesh Vernekar c155c0e312
tsdb: Test staleness handling of FloatHistogram
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-12-28 14:48:56 +05:30
Ganesh Vernekar 2820e327db
tsdb: Add staleness handling for FloatHistogram
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-12-28 14:48:39 +05:30
Ganesh Vernekar e555469ba1
tsdb: Remove isHistogramSeries from memSeries
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-12-28 14:31:55 +05:30
Marc Tudurí 9474610baf
Support FloatHistogram in TSDB (#11522)
Extends Appender.AppendHistogram function to accept the FloatHistogram. TSDB supports appending, querying, WAL replay, for this new type of histogram.

Signed-off-by: Marc Tudurí <marctc@protonmail.com>
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2022-12-28 14:25:07 +05:30
Ganesh Vernekar ae72c752a1
Merge pull request #11766 from bboreham/agg-reuse-labelbuilder
Promql: reuse LabelBuilder in aggregations
2022-12-27 18:37:41 +05:30
Bryan Boreham 1b0a29701b promql: optimise aggregation with no labels
For a query like 'sum (foo)', we can quickly skip to the empty labels that its result needs.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2022-12-23 13:33:14 +00:00
Bryan Boreham aafef011b7 Promql: reuse LabelBuilder in aggregations
We have a LabelBuilder in EvalNodeHelper; use it instead of creating a new one at every step.

Need to take some care that different uses of enh.lb do not overlap.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2022-12-23 13:21:29 +00:00
Bryan Boreham 2c382f5e24 promql: extract function to initialize LabelBuilder
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2022-12-23 13:21:22 +00:00
Łukasz Mierzwa e1b7082008
Show individual scrape pools on /targets page (#11142)
* Add API endpoints for getting scrape pool names

This adds api/v1/scrape_pools endpoint that returns the list of *names* of all the scrape pools configured.
Having it allows to find out what scrape pools are defined without having to list and parse all targets.

The second change is adding scrapePool query parameter support in api/v1/targets endpoint, that allows to
filter returned targets by only finding ones for passed scrape pool name.

Both changes allow to query for a specific scrape pool data, rather than getting all the targets for all possible scrape pools.
The problem with api/v1/targets endpoint is that it returns huge amount of data if you configure a lot of scrape pools.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a scrape pool selector on /targets page

Current targets page lists all possible targets. This works great if you only have a few scrape pools configured,
but for systems with a lot of scrape pools and targets this slow things down a lot.
Not only does the /targets page load very slowly in such case (waiting for huge API response) but it also take
a long time to render, due to huge number of elements.
This change adds a dropdown selector so it's possible to select only intersting scrape pool to view.
There's also scrapePool query param that will open selected pool automatically.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2022-12-23 11:55:08 +01:00
Frederic Branczyk d7f0276d88
Merge pull request #11756 from mercedes-benz/kubernetes-sd-monitoring
Kubernetes SD: disable resync timer
2022-12-23 11:53:38 +01:00
Ganesh Vernekar e6f2577c5b
Merge pull request #11761 from bboreham/querier-reuse-iterator
tsdb: re-use iterator when stepping through chunks
2022-12-23 13:33:30 +05:30
Julien Pivotto 6fc5305ce9
Merge pull request #11709 from jlevesy/allow-agent-no-remote-write
feat(config): allow no remote write configs
2022-12-22 23:14:40 +01:00
Bryan Boreham 1848623c77 tsdb: re-use iterator when stepping through chunks
Saves memory allocations, hence reduces garbage-collection overheads.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2022-12-22 17:01:47 +00:00
Jens Erat 728fdc959e
Kubernetes SD: disable resync timer
While originally the resync period also forced refreshing from Kubernetes API server, this has been removed for some years now because watching the API server got more stable [1]. Today, this just results in all entities being sent to the service discovery again, which is valid from a general Prometheus perspective, but results in unnecessary CPU load and also breaks service discovery metrics. In especially, this makes monitoring "do we actually observe changes from Kubernetes API server" impossible (receiving constant updates from Kubernetes service discovery is a pretty valid assumption, for example nodes get frequent status updates, ...).

Signed-off-by: Jens Erat <jens.erat@mercedes-benz.com>
2022-12-22 13:26:03 +01:00