Commit Graph

14987 Commits

Author SHA1 Message Date
Bryan Boreham
6ba25ba93f tsdb tests: avoid 'defer' till end of function
'defer' only runs at the end of the function, so explicitly close the
querier after we finish with it. Also check it didn't error.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-01-27 19:59:43 +00:00
Bryan Boreham
2f615a200d tsdb tests: restrict some 'defer' operations
'defer' only runs at the end of the function, so introduce some more
functions / move the start, so that 'defer' can run at the end of the
logical block.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-01-27 19:59:43 +00:00
Bryan Boreham
f4fbe47254 tsdb tests: avoid capture-by-reference in goroutines
Only one version of the variable is captured; this is a source of race conditions.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-01-27 19:59:43 +00:00
Jan Fajerski
54cf0d6879
Merge pull request #15472 from tjhop/ref/jsonfilelogger-slog-handler
ref: JSONFileLogger slog handler, add scrape.FailureLogger interface
2025-01-27 20:17:46 +01:00
Bartlomiej Plotka
6ede900506
Merge pull request #15851 from prometheus/upgradeclient
Upgrade client_golang to 1.21.0-rc.0 (and common to 0.62.0 with model.NameValidationScheme breaking change)
2025-01-27 16:52:03 +01:00
Bartlomiej Plotka
2830cbacb0
Merge pull request #15866 from arturmelanchyk/op-mem-alloc
promtool: optimize labels slice allocation
2025-01-27 11:00:56 +01:00
bwplotka
36cf85fc1e Addressed comments.
Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-01-27 09:54:13 +00:00
Björn Rabenstein
2915b19773
Merge pull request #15859 from prometheus/krajo/abs-test
test(promql): abs function on native histograms
2025-01-25 00:33:37 +01:00
Bartlomiej Plotka
bd0d9e7a0a
Update model/rulefmt/rulefmt.go
Co-authored-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2025-01-24 15:49:10 +00:00
Artur Melanchyk
30112f6ed7
promtool: optimize labels slice allocation
Signed-off-by: Artur Melanchyk <arturmelanchyk@imail.name>
2025-01-24 14:31:59 +01:00
György Krajcsovits
9097f8f4e7 test(promql): some functions silently ignore native histograms
Functions that silently ignore native histograms, not covered by existing
tests: abs(), ceil(), clamp(), clamp_min(), clamp_max(), floor(), round().

Ref: https://github.com/prometheus/prometheus/pull/15845

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-01-24 11:16:20 +01:00
Björn Rabenstein
8846e42528
Merge pull request #15849 from linasm/use-histogram-stats-decoder-for-histogram_avg
promql: use histogram stats decoder for histogram_avg
2025-01-23 15:03:01 +01:00
Julius Volz
81484701a2
Merge pull request #15854 from prometheus/beorn7/doc2
docs: Improve documentation of promql-delayed-name-removal flag
2025-01-23 13:04:18 +01:00
bwplotka
80d702afdc Fixed rulefmt UTF-8 expectations.
Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-01-23 09:23:58 +00:00
bwplotka
7263dfe50e Fixed relabelling; allowing UTF-8 in targetLabel.
Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-01-23 08:53:59 +00:00
Linas Medziunas
940016e002 promql: use histogram stats decoder for histogram_avg
Signed-off-by: Linas Medziunas <linas.medziunas@gmail.com>
2025-01-23 08:49:47 +02:00
Joshua Hesketh
665d1ba0cc
Ensure metric name is present on histogram_quantile annotations (#15828)
Ensure metric name is present on histogram_quantile annotations

Previously the series __name__ label was dropped before the annotation
was emitted causing the annotation message to have a blank value.

This fix also allows delayed name removal for classic histograms.

This also adds a test for malformed le label

This annotation could be split into two to be clearer for the user
(one for missing, and one for malformed). This is outside of the scope
of this change.

Fixes: #15411

---------

Signed-off-by: Joshua Hesketh <josh@nitrotech.org>
Signed-off-by: Björn Rabenstein <github@rabenste.in>
Co-authored-by: Björn Rabenstein <github@rabenste.in>
2025-01-22 14:35:43 +01:00
beorn7
2033713757 docs: Improve documentation of promql-delayed-name-removal flag
This fixes a formatting problem (`__name__`) was rendered in boldface
without the underscores in the headline).

Furthermore, it explains the possible issues with the feature flag
(change of behavior of certain "weird" queries, problems when
disecting a query manually or in PromLens).

Signed-off-by: beorn7 <beorn@grafana.com>
2025-01-22 14:08:01 +01:00
bwplotka
de00608036 Upgrade client_golang to 1.21.0-rc.0
This tests 1.21.0-rc.0 as per https://github.com/prometheus/client_golang/blob/main/RELEASE.md

We could merge it too as an early adopter.

Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-01-21 18:09:51 +00:00
Paulo Dias
e8fab32ca2
discovery: move openstack floating ips function from deprecated Compute API /os-floating-ips to Network API /floatingips (#14367) 2025-01-21 11:40:15 +01:00
Dimitar Dimitrov
2a8ae586f4
ruler: stop all rule groups asynchronously on shutdown (#15804)
* ruler: stop all rule groups asynchronously on shutdown

During shutdown of the rules manager some rule groups have already stopped and are missing evaluations while we're waiting for other groups to finish their evaluation.

When there are many groups (in the thousands), the whole shutdown process can take up to 10 minutes, during which we get miss evaluations.

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Use wrappers in stop(); rename awaitStopped()

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Add comment

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

---------

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
2025-01-20 21:26:58 +01:00
Julius Volz
32d306854b
Merge pull request #15807 from leonnicolas/hide-empty-rules-persitence
Make "hide empty rules" persistent
2025-01-20 15:26:13 +01:00
Mikel Olasagasti Uranga
9258e40589
parser: fix non-constant format string call (#15835)
Go 1.24 enhanced vet's printf analyzer to report calls of the form
fmt.Printf(s), where s is a non-constant format string, with no other
arguments. This change makes parser tests to fail.

Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
2025-01-18 13:21:51 +01:00
piguagua
a82f2b8168
chore: fix function name and struct name in comment (#15827)
Signed-off-by: piguagua <piguagua@aliyun.com>
2025-01-17 21:26:08 +01:00
dependabot[bot]
2f42bf2376
chore(deps): bump react-dom and @types/react-dom in /web/ui (#15661)
* chore(deps): bump react, react-dom and @types/react in /web/ui

Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react), [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react). These dependencies needed to be updated together.

Updates `react` from 18.3.1 to 19.0.0
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.0.0/packages/react)

Updates `react-dom` from 18.3.1 to 19.0.0
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.0.0/packages/react-dom)

Updates `@types/react` from 18.3.5 to 19.0.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: react
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: react-dom
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* chore(deps): bump react-dom and @types/react-dom in /web/ui

Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) and [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom). These dependencies needed to be updated together.

Updates `react-dom` from 18.3.1 to 19.0.0
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.0.0/packages/react-dom)

Updates `@types/react-dom` from 18.3.0 to 19.0.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

---
updated-dependencies:
- dependency-name: react-dom
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: "@types/react-dom"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix up

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-01-17 18:57:39 +00:00
dependabot[bot]
5e2b75ee5e
chore(deps-dev): bump @typescript-eslint/parser from 6.21.0 to 8.20.0 in /web/ui (#15821)
* chore(deps-dev): bump @typescript-eslint/parser in /web/ui

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.21.0 to 8.20.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.20.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix lint errors/warnings

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-01-17 18:16:30 +00:00
dependabot[bot]
c47465c0c5
chore(deps): bump nanoid from 3.3.7 to 3.3.8 in /web/ui (#15844)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 17:24:26 +00:00
Owen Williams
f405c78e4a
docs: clarify PromQL interval changes (#15824)
docs: Clarify PromQL interval changes

---------

Signed-off-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Owen Williams <owen-github@ywwg.com>
Co-authored-by: Björn Rabenstein <beorn@grafana.com>
2025-01-17 18:00:30 +01:00
dependabot[bot]
5bf7c3718b
chore(deps): bump github.com/hashicorp/consul/api from 1.30.0 to 1.31.0 (#15766)
Bumps [github.com/hashicorp/consul/api](https://github.com/hashicorp/consul) from 1.30.0 to 1.31.0.
- [Release notes](https://github.com/hashicorp/consul/releases)
- [Changelog](https://github.com/hashicorp/consul/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/consul/compare/api/v1.30.0...api/v1.31.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/consul/api
  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>
2025-01-17 16:59:06 +00:00
dependabot[bot]
9e14669c49
chore(deps): bump golang.org/x/net (#15841)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.32.0 to 0.33.0.
- [Commits](https://github.com/golang/net/compare/v0.32.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 16:57:29 +00:00
dependabot[bot]
3a5bf37d4b
chore(deps): bump github.com/envoyproxy/go-control-plane (#15773)
Bumps [github.com/envoyproxy/go-control-plane](https://github.com/envoyproxy/go-control-plane) from 0.13.1 to 0.13.2.
- [Release notes](https://github.com/envoyproxy/go-control-plane/releases)
- [Changelog](https://github.com/envoyproxy/go-control-plane/blob/main/CHANGELOG.md)
- [Commits](https://github.com/envoyproxy/go-control-plane/compare/v0.13.1...v0.13.2)

---
updated-dependencies:
- dependency-name: github.com/envoyproxy/go-control-plane
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 16:51:12 +00:00
dependabot[bot]
a75760c3d2
chore(deps-dev): bump webpack from 5.91.0 to 5.97.1 in /web/ui/react-app (#15843)
Bumps [webpack](https://github.com/webpack/webpack) from 5.91.0 to 5.97.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.91.0...v5.97.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 16:34:27 +00:00
dependabot[bot]
6f1669e017
chore(deps): bump golang.org/x/crypto (#15840)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.30.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 16:29:16 +00:00
dependabot[bot]
2a17b99ee2
chore(deps): bump nanoid from 3.3.7 to 3.3.8 in /web/ui/react-app (#15842)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 16:25:23 +00:00
Fiona Liao
f46b984dd1
Add additional incompatible nhcb schemas tests for functions and comparison operators (#15813)
promql: Add additional incompatible nhcb schemas tests for functions and comparison operators

* Add agg_over_time tests for nhcb with incompatible schemas
* Add more function and comparison operator tests

---------

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
2025-01-17 17:17:11 +01:00
Bartlomiej Plotka
39d7242cfe
Merge pull request #15669 from rajagopalanand/restore-for-state
rules: Add an option to restore new rule groups added to existing rule manager
2025-01-17 15:37:07 +01:00
Bartlomiej Plotka
0962d08f59
Merge pull request #15837 from prometheus/meta-report
scrape: Add metadata for automatic metrics for WAL (not for API)
2025-01-17 10:28:20 +01:00
Bartlomiej Plotka
6a8afa60b5
Merge pull request #15823 from yeya24/slow-down-ctx-check
Less frequent context check for series API
2025-01-17 10:27:08 +01:00
Bartlomiej Plotka
6f1ad64e27
Update scrape/scrape.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2025-01-17 09:09:28 +00:00
bwplotka
3119567d5b scrape: Add metadata for automatic metrics.
Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-01-16 19:49:12 +00:00
Bartlomiej Plotka
a3c7f72ad0
Merge pull request #15541 from machine424/wellwellwell
fix(remote): rename some remote read related metrics for better clarity and consistency
2025-01-16 15:25:45 +01:00
Bartlomiej Plotka
de2dfe00f4
Merge pull request #15832 from prometheus/metadatafix
scrape: Fix metadata in WAL not working for histograms and summaries.
2025-01-16 15:06:40 +01:00
bwplotka
af928a1ba4 Addressed Krajo's comment.
Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-01-16 13:15:56 +00:00
Bartlomiej Plotka
d52e689a20
Merge pull request #15829 from prometheus/krajo/fix-metadata-enqueueing
fix(remotewrite2): do not send uninitialized garbage if no metadata
2025-01-16 09:14:48 +01:00
George Krajcsovits
5ed0edd3ab
Update storage/remote/queue_manager.go
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
2025-01-16 08:12:33 +01:00
bwplotka
9385f31147 scrape: Fix metadata in WAL not working for histograms and summaries.
The was a bug (due to confusion?) on the local metadata cache that is cached
by metric family not the series metric name. The fix is to NOT use that local cache
at all (it's still needed for current metadata API implementation, added TODO
on how we can get rid of it).

I went ahead and also rename Metric field in metadata structs to MetricFamily to make
clear it's not always __name__.

Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-01-15 20:12:38 +00:00
György Krajcsovits
482a7fd890 fix(remotewrite2): do not send uninitialized garbage if there's no metadata
Found during testing for
https://github.com/grafana/mimir/issues/9072

Debug printout showed:
KRAJO: seriesName=cortex_request_duration_seconds_bucket,
metricFamily=cortex_request_duration_seconds_bucket,
type=GAUGE,
help=cortex_bucket_index_load_duration_seconds_sum,
unit=

which is nonsense.

I can imagine more cases where this is the case and makes actual sense.
Some targets might miss metadata and if there's a pipeline that loses it.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-01-15 12:42:52 +01:00
Bartlomiej Plotka
38f8000341
Merge pull request #15706 from GiedriusS/ignore_unknown_fields
promtool: add --ignore-unknown-fields
2025-01-15 11:49:37 +01:00
Giedrius Statkevičius
92218ecb9b promtool: add --ignore-unknown-fields
Add --ignore-unknown-fields that ignores unknown fields in rule group
files. There are lots of tools in the ecosystem that "like" to extend
the rule group file structure but they are currently unreadable by
promtool if there's anything extra. The purpose of this flag is so that
we could use the "vanilla" promtool instead of rolling our own.

Some examples of tools/code:

https://github.com/grafana/mimir/blob/main/pkg/mimirtool/rules/rwrulefmt/rulefmt.go
8898eb3cc5/pkg/rules/rules.go (L18-L25)

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
2025-01-15 11:34:28 +02:00
Arve Knudsen
5df6ea3042
promtool: Support linting of scrape interval (#15719)
* PromTool: Support Scrape Interval Lint Checking

---------

Signed-off-by: zhaowang <zhaowang@apac.freewheel.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: zhaowang <zhaowang@apac.freewheel.com>
2025-01-15 08:45:05 +01:00