Commit Graph

14600 Commits (a7264eb0d455f39981f8eee8c736c958d30a5fef)

Author SHA1 Message Date
Björn Rabenstein a7264eb0d4
Merge pull request #15475 from prometheus/beorn7/promql
promql: Add NaN tests for avg and avg_over_time
2024-11-27 19:41:39 +01:00
Joshua Hesketh 8e3301eb44
Export quantile functions (#15190)
Export quantile functions

For use in Mimir's query engine, it would be helpful if these
functions were exported.

Co-authored-by: Björn Rabenstein <github@rabenste.in>
Signed-off-by: Joshua Hesketh <josh@hesketh.net.au>

---------

Signed-off-by: Joshua Hesketh <josh@nitrotech.org>
Signed-off-by: Joshua Hesketh <josh@hesketh.net.au>
Co-authored-by: Björn Rabenstein <github@rabenste.in>
2024-11-27 13:20:23 +01:00
beorn7 a44c449155 promql: Add NaN tests for avg and avg_over_time
Signed-off-by: beorn7 <beorn@grafana.com>
2024-11-27 13:08:34 +01:00
Oleg Zaytsev 9ad93ba8df
Optimize l=~".+" matcher (#15474)
Since dot is matching newline now, `l=~".+"` is "any non empty label
value", and #14144 added a specific method in the index for that so we
don't need to run the matcher on each one of the label values.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-11-27 12:33:20 +01:00
Ganesh Vernekar 4dacd7572a
Merge pull request #15455 from bboreham/compact-cache-symbols
[PERF] TSDB: Cache all symbols for compaction
2024-11-26 16:47:21 -05:00
Bartlomiej Plotka 5e124cf4f2
Merge pull request #15468 from chrismgrayftsinc/fix-typo
Fix typo
2024-11-26 11:34:33 -07:00
Neeraj Gartia 38bb6ece25
[BUGFIX] PromQL: Fix behaviour of some aggregations with histograms (#15432)
promql: fix some aggregations for histograms

This PR fixes the behaviour of `topk`,`bottomk`, `limitk` and `limit_ratio` with histograms. The fixed behaviour are as follows:
- For `topk` and `bottomk` histograms are ignored and add info annotations added.
- For `limitk` and `limit_ratio` histograms are included in the results(if applicable).

Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
2024-11-26 19:12:36 +01:00
Bryan Boreham ca3119bd24 TSDB: eliminate one yolostring
When the only use of a []byte->string conversion is as a map key, Go
doesn't allocate.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-11-26 17:21:55 +00:00
Bryan Boreham e98c19c1ce [PERF] TSDB: Cache all symbols for compaction
Trade a bit more memory for a lot less CPU spent looking up symbols.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-11-26 17:21:55 +00:00
Bryan Boreham 634afbc130
Merge pull request #15456 from bboreham/remove-rw-intern
[PERF] RW: Remove interning hook
2024-11-26 17:20:56 +00:00
Chris Gray c8f0e9d9c9
Fix typo
Signed-off-by: Chris Gray <chris.gray@aem.eco>
2024-11-26 09:05:39 -08:00
Björn Rabenstein b9dd95f499
Merge pull request #15428 from prometheus/beorn7/metrics
notifier: fix increment of metric prometheus_notifications_errors_total
2024-11-26 17:38:59 +01:00
Bryan Boreham fd4797d756 [PERF] RW: Remove interning hook
It does nothing for standard Prometheus builds with -tags stringlabels,
but the check to see if labels are being replaced has a cost.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-11-26 16:37:57 +00:00
Arve Knudsen 6f1f0aa678
Revert "chore(deps): bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0 (#15300)" (#15466)
This reverts commit e243ed66b9.
2024-11-26 16:12:15 +00:00
Bartlomiej Plotka 619e7aaf95
Merge pull request #15453 from prometheus/nhcb-scrape-optimize2
nhcb: scrape optimize string manipulation
2024-11-26 09:02:43 -07:00
Oleg Zaytsev 9aa6e041d3
MemPostings: allocate ListPostings once in PFALV (#15465)
Same as #15427 but for the new method added in #14144

Instead of allocating each ListPostings one by one, allocate them all in
one go.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-11-26 16:03:45 +01:00
beorn7 e01c5cefac notifier: fix increment of metric prometheus_notifications_errors_total
Previously, prometheus_notifications_errors_total was incremented by
one whenever a batch of alerts was affected by an error during sending
to a specific alertmanager. However, the corresponding metric
prometheus_notifications_sent_total, counting all alerts that were
sent (including those where the sent ended in error), is incremented
by the batch size, i.e. the number of alerts.

Therefore, the ratio used in the mixin for the
PrometheusErrorSendingAlertsToSomeAlertmanagers alert is inconsistent.

This commit changes the increment of
prometheus_notifications_errors_total to the number of alerts that
were sent in the attempt that ended in an error. It also adjusts the
metrics help string accordingly and makes the wording in the alert in
the mixin more precise.

Signed-off-by: beorn7 <beorn@grafana.com>
2024-11-26 15:50:02 +01:00
Julius Volz 975d5d7357
Merge pull request #15459 from prometheus/dependabot/npm_and_yarn/web/ui/rollup-4.27.4
chore(deps-dev): bump rollup from 4.21.2 to 4.27.4 in /web/ui
2024-11-26 14:07:57 +01:00
György Krajcsovits eb9ce70c3e Set hasCount after setting count to be consistent
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-11-26 13:56:22 +01:00
DC d535d501d1
[DOCS] Improve description of WAL record format (#14936)
Signed-off-by: DC <413331538@qq.com>
2024-11-26 11:48:17 +00:00
Konrad c3cc25f552
document scraping change introduced in 2.52.0 (#15148)
* CHANGELOG - scraping change introduced in 2.52.0

Change introduced in #12933; old behavior partially recoved in #14685

Signed-off-by: Konrad <zuo.zp8@gmail.com>
2024-11-26 11:15:01 +00:00
Bartlomiej Plotka 11d9da1e48
Merge pull request #15260 from tcolgate/quoteexemplarkeys
bugfix: allow quoted exemplar keys in openmetrics text format
2024-11-26 02:52:17 -07:00
dependabot[bot] c08edd3ff3
chore(deps-dev): bump rollup from 2.79.1 to 2.79.2 in /web/ui/react-app (#15461)
Bumps [rollup](https://github.com/rollup/rollup) from 2.79.1 to 2.79.2.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.79.1...v2.79.2)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 08:00:25 +01:00
dependabot[bot] 8e7e7a0406
chore(deps): bump micromatch from 4.0.5 to 4.0.8 in /web/ui/react-app (#15462)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 06:37:30 +00:00
dependabot[bot] 1bd16db101
chore(deps): bump body-parser and express in /web/ui/react-app (#15460)
Bumps [body-parser](https://github.com/expressjs/body-parser) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `body-parser` from 1.20.2 to 1.20.3
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3)

Updates `express` from 4.19.2 to 4.21.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.1)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 07:26:06 +01:00
dependabot[bot] 1939123b5b
chore(deps): bump braces from 3.0.2 to 3.0.3 in /web/ui/react-app (#15457)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 07:25:28 +01:00
dependabot[bot] a778a58bdf
chore(deps-dev): bump rollup from 4.21.2 to 4.27.4 in /web/ui
Bumps [rollup](https://github.com/rollup/rollup) from 4.21.2 to 4.27.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.21.2...v4.27.4)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-26 05:20:09 +00:00
Bryan Boreham dd0252a774
Merge pull request #15380 from bboreham/improve-loadwbl
[BUGFIX] TSDB: Apply fixes from loadWAL to loadWBL
2024-11-25 17:31:49 +00:00
Bryan Boreham 7996a13fdd
Merge pull request #15403 from bboreham/fix-rw-benchmark-startup
[TESTS] Remote-Write: Fix BenchmarkStartup
2024-11-25 17:31:24 +00:00
György Krajcsovits a48d05912d nhcb: optimize, do not recalculate suffixes multiple times
Reduce string manipulation by just cutting off the histogram suffixes from
the series name label once.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-11-25 15:37:38 +01:00
György Krajcsovits 41f051e9a4 Small improvement in handling cases without count
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-11-25 15:02:17 +01:00
Ben Ye 872e2db2a9
Implement json encoder/decoder for regexp (#15383)
* implement json encoder/decoder for regexp

---------

Signed-off-by: Ben Ye <benye@amazon.com>
2024-11-24 18:46:24 +00:00
Bryan Boreham dd1d707e1c
Merge pull request #15371 from bboreham/main-naming
[REFACTOR] Small improvement to top-level naming
2024-11-24 17:55:10 +00:00
dependabot[bot] e243ed66b9
chore(deps): bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0 (#15300)
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  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>
2024-11-24 18:40:58 +01:00
dependabot[bot] fc5b7dc5d6
chore(deps): bump the k8s-io group with 3 updates (#15283)
Bumps the k8s-io group with 3 updates: [k8s.io/api](https://github.com/kubernetes/api), [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) and [k8s.io/client-go](https://github.com/kubernetes/client-go).


Updates `k8s.io/api` from 0.31.1 to 0.31.2
- [Commits](https://github.com/kubernetes/api/compare/v0.31.1...v0.31.2)

Updates `k8s.io/apimachinery` from 0.31.1 to 0.31.2
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.31.1...v0.31.2)

Updates `k8s.io/client-go` from 0.31.1 to 0.31.2
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.31.1...v0.31.2)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-io
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-io
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-io
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-24 17:39:51 +01:00
Ben Ye 40c3ba9fd4
fix promtool analyze block shows metric name with 0 cardinality (#15438)
Signed-off-by: Ben Ye <benye@amazon.com>
2024-11-24 17:30:20 +01:00
Raphael Philipe Mendes da Silva e664c16b31
api: fix typo in list rules API response (#15400)
* Fix typo in list rules API response

---------

Signed-off-by: Raphael Silva <rapphil@gmail.com>
2024-11-24 17:28:21 +01:00
Simon Pasquier 63d87a60a8
docs: fix typo (#15436)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2024-11-24 17:13:19 +01:00
Neeraj Gartia abfc3145a2
apply DRY on clamp (#15441)
Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
2024-11-24 17:08:59 +01:00
Arve Knudsen c2e28f21ba
rules.NewGroup: Fix when no logger is passed (#15356)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-11-21 16:53:06 +01:00
Björn Rabenstein 125a90899c
promqltest: Complete the tests for info annotations (#15429)
promqltest: Complete the tests for info annotations

So far, we did not test for the _absence_ of an info annotation
(because many tests triggered info annotations, which we haven't taken
into account so far).

The test for info annotations was also missed for range queries.

This completes the tests for info annotations (and refactors the many
`if` statements into a somewhat more compact `switch` statement).

It fixes most tests to not emit an info annotation anymore. Or it
changes the `eval` to `eval_info` where we actually want to test for
the info annotation.

It also fixes a few spelling errors in comments.

---------

Signed-off-by: beorn7 <beorn@grafana.com>
Signed-off-by: Björn Rabenstein <github@rabenste.in>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-11-21 14:20:38 +01:00
Oleg Zaytsev cc390aab64
MemPostings: allocate ListPostings once in PFLM (#15427)
Instead of allocating ListPostings pointers one by one, allocate a slice
and take pointers from that. It's faster, and also generates less
garbage (NewListPostings is one of the top offenders in number of
allocations).

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2024-11-20 17:52:20 +01:00
Arve Knudsen 89bbb885e5
Upgrade to golangci-lint v1.62.0 (#15424)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-11-20 17:22:20 +01:00
Fiona Liao d7c8177f56
docs: update README with v3 tagging update (#15361)
docs: update README with v3 tagging update

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

---------

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
2024-11-20 16:46:11 +01:00
Björn Rabenstein ca600cfaff
Merge pull request #15407 from tjhop/chore/slog-handler-compile-check
chore(deduper): add compile check that slog.Handler interface is satisfied
2024-11-20 15:25:04 +01:00
Björn Rabenstein e8003cb347
Merge pull request #15417 from huochexizhan/main
chore: fix some function names in comment
2024-11-20 14:36:47 +01:00
Bryan Boreham 3c22b35a03
Merge pull request #15339 from colega/export-go-sync-mutex-wait-total-seconds-total-metric
Export 'go_sync_mutex_wait_total_seconds_total' metric
2024-11-20 13:34:37 +00:00
Neeraj Gartia a6fb16fcb4
PromQL: Convert more native histogram tests to promql-test framework (#15419)
This converts `TestNativeHistogram_SubOperator` to the promql testing framework. It also removes `TestNativeHistogram_Sum_Count_Add_AvgOperator`, which got converted earlier.

Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
2024-11-20 11:41:36 +01:00
Björn Rabenstein 4ef1170868
Merge pull request #15422 from NeerajGartia21/promql-corrections
[BUGFIX] PromQL: Fix `count_values` for histograms
2024-11-20 11:27:32 +01:00
Arve Knudsen 9c02c26418
OTLP receiver: Convert also metric metadata (#15416)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-11-20 11:13:03 +01:00