2396 Commits

Author SHA1 Message Date
bwplotka
794bf774c2 Reapply "prw: use Unit and Type labels for metadata when feature flag is enabled (#17033)"
This reverts commit f5fab4757733746a708e7b80324b8929c1b84856.
2025-08-29 08:16:37 +01:00
bwplotka
f5fab47577 Revert "prw: use Unit and Type labels for metadata when feature flag is enabled (#17033)"
This reverts commit c808a71e18d4d1cc91e1d06859ebeae818465324.
2025-08-29 08:15:28 +01:00
Jonathan
c808a71e18
prw: use Unit and Type labels for metadata when feature flag is enabled (#17033)
* chore: send Unit and Type when feature flag is enabled

Signed-off-by: perebaj <perebaj@gmail.com>

* remove unused code and comments

Signed-off-by: perebaj <perebaj@gmail.com>

* remove unreal scenario

Signed-off-by: perebaj <perebaj@gmail.com>

* remove unused if

Signed-off-by: perebaj <perebaj@gmail.com>

* remove unused labels

Signed-off-by: perebaj <perebaj@gmail.com>

* linter

Signed-off-by: perebaj <perebaj@gmail.com>

* enable type and unit through remotewrite config

Signed-off-by: perebaj <perebaj@gmail.com>

* remove test comment and capture type and unit when flag is enabled

Signed-off-by: perebaj <perebaj@gmail.com>

* gofumpt

Signed-off-by: perebaj <perebaj@gmail.com>

* modelTypeToWriteV2Type

Signed-off-by: perebaj <perebaj@gmail.com>

* use NewMetadataFromLabels

Signed-off-by: perebaj <perebaj@gmail.com>

* capture feature flag from main

Signed-off-by: perebaj <perebaj@gmail.com>

* simplifying logic

Signed-off-by: perebaj <perebaj@gmail.com>

* remove unused function

Signed-off-by: perebaj <perebaj@gmail.com>

* formatting code

Signed-off-by: perebaj <perebaj@gmail.com>

* gofumpt

Signed-off-by: perebaj <perebaj@gmail.com>

* remove public var: EnableTypeAndUnitLabels

Signed-off-by: perebaj <perebaj@gmail.com>

* remove enableTypeAndUnitLabels from TestPopulateV2TimeSeries_typeAndUnitLabels

Signed-off-by: perebaj <perebaj@gmail.com>

* remove enableTypeAndUnitLabels from main

Signed-off-by: perebaj <perebaj@gmail.com>

* use schema helper to populate metadata

Signed-off-by: perebaj <perebaj@gmail.com>

* remove metadata since nil is the default value

Signed-off-by: perebaj <perebaj@gmail.com>

* add TestPopulateV2TimeSeries_UnexpectedMetadata

Signed-off-by: perebaj <perebaj@gmail.com>

* Update storage/remote/queue_manager_test.go

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

---------

Signed-off-by: perebaj <perebaj@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
2025-08-29 04:10:01 +00:00
beorn7
747c5ee2b1 Apply analyzer "modernize" to the whole codebase
See
https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize
for details.

This ran into a few issues (arguably bugs in the modernize tool),
which I will fix in the next commit, so that we have transparency what
was done automatically.

Beyond those hiccups, I believe all the changes applied are
legitimate. Even where there might be no tangible direct gain, I would
argue it's still better to use the "modern" way to avoid micro
discussions in tiny style PRs later.

Signed-off-by: beorn7 <beorn@grafana.com>
2025-08-27 14:48:41 +02:00
Justin Jung
0f98dcbc07
Engine: Allow error response code to be customized (#16257)
Currently the API always returns http code 422 for engine execution error, and

This PR allows the error code to be overriden, based on the ErrorType and the error itself.

Signed-off-by: Justin Jung <jungjust@amazon.com>
Signed-off-by: Justin Jung <justinjung04@gmail.com>
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
2025-08-19 16:43:47 +01:00
Arve Knudsen
0a40df33fb
Make metric/label name validation scheme explicit (#16928)
* Parameterize metric/label name validation scheme

Parameterized metric/label name validation scheme

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Julius Hinze <julius.hinze@grafana.com>
2025-08-18 08:09:00 +00:00
Bartlomiej Plotka
5df982538f
Merge pull request #16994 from mmorel-35/unused-parameters
chore: enable unused-receiver rule from revive
2025-08-06 10:46:28 +01:00
Matthieu MOREL
9f782164b4 chore: enable fatcontext linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-04 18:24:10 +02:00
Matthieu MOREL
cef219c31c chore: enable unused-receiver rule from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-04 09:43:33 +00:00
Julius Volz
2e709c6567
Merge pull request #16695 from sujalshah-bit/block_endpoint
api: Create `/status/tsdb/blocks` endpoint.
2025-07-31 18:15:49 +02:00
Arthur Silva Sens
2c04f2d7b1
PROM-39: Add type and unit labels to OTLP endpoint (#16630)
* PROM-39: Add type and unit labels to OTLP endpoint

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Extract label addition into helper function

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Wire feature flag and web handler configuration

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Use lowercase for units too

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Use otlptranslator.UnitNamer to build units

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Address copilot's comment

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Verify label presence before adding them

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Overwrite type/unit labels when already set

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* sed/addTypeAndUnitLabels/enableTypeAndUnitLabels/

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Reduce duplicated code

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-07-25 08:53:13 -03:00
Julius Volz
13b55ffc81
UI: More inclusive metadata handling for _count/_sum/_bucket suffixes (#16910)
Although these suffixes always need to be removed before querying metadata for
metrics that follow the Prometheus naming best practices, there can also be
metrics that don't follow these naming practices and have these suffixes
without being part of either a histogram or a summary metric.

Fixes https://github.com/prometheus/prometheus/issues/16907

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-07-24 13:54:58 +02:00
Julius Volz
1354bb90be Make query warning/info notice display configurable
Fixes https://github.com/prometheus/prometheus/issues/16888

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-07-21 13:03:46 +02:00
Bryan Boreham
36ec1e4fb0
Merge branch 'main' into merge-3.5-into-main
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-07-14 15:29:00 +01:00
Bryan Boreham
8be3a9560f Prepare release 3.5.0
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-07-14 12:38:42 +01:00
Bryan Boreham
eea203702c
Prepare release 3.5.0-rc.1 (#16845)
This RC reverts the feature "OTLP: Support promoting OTel scope attributes".

Add the line back into the CHANGELOG for 3.5.0-rc.0, since we are not changing that version.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-07-09 12:07:27 +01:00
Arve Knudsen
f561aa795d
OTLP receiver: Generate target_info samples between the earliest and latest samples per resource (#16737)
* OTLP receiver: Generate target_info samples between the earliest and latest samples per resource

Modify the OTLP receiver to generate target_info samples between the earliest
and latest samples per resource instead of only one for the latest timestamp.
The samples are spaced lookback delta/2 apart.

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-07-04 14:38:16 +00:00
sujal shah
4408a6bcaf api: Create /status/tsdb/blocks endpoint.
this endpoint serves blocks data to the client.

Signed-off-by: sujal shah <sujalshah28092004@gmail.com>
2025-07-04 03:13:54 +05:30
wmTJc9IK0Q
c481aaf762
codemirror-promql: Preserve source files in npm package (#16804)
* Preserve source files in codemirror-promql package

This allows for sourcemaps to work when the package is imported via ESM-native CDNs such as esm.sh

Signed-off-by: wmTJc9IK0Q <171362836+wmTJc9IK0Q@users.noreply.github.com>

* Preserve source files in lezer-promql package

Signed-off-by: wmTJc9IK0Q <171362836+wmTJc9IK0Q@users.noreply.github.com>

---------

Signed-off-by: wmTJc9IK0Q <171362836+wmTJc9IK0Q@users.noreply.github.com>
2025-07-02 15:31:02 +02:00
Bryan Boreham
31f0c7007e
Prepare release 3.5.0-rc.0 (#16778)
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2025-06-30 14:19:45 +01:00
gopherorg
b86d4ba312 chore: fix some function names in comment
Signed-off-by: gopherorg <gopherworld@icloud.com>
2025-06-27 15:34:53 +08:00
Jan-Otto Kröpke
5a1deb84cc
Merge branch 'release-3.4' into release-3.4-main
# Conflicts:
#	CHANGELOG.md
2025-06-26 22:54:24 +02:00
Jan-Otto Kröpke
b392caf256
Prepare release 3.4.2
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2025-06-26 22:48:39 +02:00
Julien Pivotto
7f2946ccdd mantine-ui: add query info warnings display to graph view
Followup of https://github.com/prometheus/prometheus/pull/16753

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-06-20 13:47:15 +02:00
Julien Pivotto
8dcb0ba24a mantine-ui: add query warnings display to graph view
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-06-19 12:17:25 +02:00
Björn Rabenstein
32b471ed47
Merge pull request #16417 from amanycodes/histogram-helper-test
ui-tests: Add Unit tests to Native histogram and its helpers.
2025-06-18 20:11:23 +02:00
Björn Rabenstein
4aee718013
Merge pull request #16722 from MichaHoffmann/mhoffmann/add-tmin-tmax-tlast-over-time-functions
promql: add ts_of_(min|max|last)_over_time
2025-06-12 19:40:18 +02:00
Michael Hoffmann
a5fa9431d8 promql: add ts_of_(max,min,last)_over_time functions
This commit adds the ts_of_(max,min,last)_over_time functions behind the experimental feature flag.

Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
2025-06-12 15:03:28 +00:00
Julius Volz
4eeeb6ee88
Fetch and display full query stats in hover tooltip in table query tab (#16723)
Fixes https://github.com/prometheus/prometheus/issues/5857

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-06-12 14:16:41 +00:00
Aman
f8508ccafa
mantine-ui: fix /alerts accordian theme colors (#16043)
* fix-alerts-accordion-theme

Signed-off-by: amanycodes <amanycodes@gmail.com>

* fixes

Signed-off-by: amanycodes <amanycodes@gmail.com>

* added changes to /rules page

Signed-off-by: amanycodes <amanycodes@gmail.com>

* more fixes

Signed-off-by: amanycodes <amanycodes@gmail.com>

---------

Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: Aman <95525722+amanycodes@users.noreply.github.com>
2025-06-12 08:23:04 +00:00
Björn Rabenstein
eb1272eda7
Merge pull request #16653 from jkroepke/release-3.4-main
Merge release-3.4 into main
2025-06-04 18:06:11 +02:00
Julius Volz
ef430074f3
Merge pull request #16567 from ryanwuer/optimize-target-pool-search-experience
UI: optimize pool searching in /targets page
2025-05-31 16:53:58 +02:00
Jan-Otto Kröpke
638dc8dbdc
Merge branch 'release-3.4' into release-3.4-main
# Conflicts:
#	.github/workflows/ci.yml
#	CHANGELOG.md
#	RELEASE.md
#	VERSION
#	cmd/prometheus/main_test.go
#	docs/configuration/configuration.md
#	web/ui/mantine-ui/package.json
#	web/ui/module/codemirror-promql/package.json
#	web/ui/module/lezer-promql/package.json
#	web/ui/package-lock.json
#	web/ui/package.json
2025-05-31 12:48:16 +02:00
Jan-Otto Kröpke
aea6503d9b
Release 3.4.1 (#16652) 2025-05-31 08:41:19 +02:00
tongjicoder
4fe20fa340 chore: fix some comments
Signed-off-by: tongjicoder <tongjicoder@icloud.com>
2025-05-27 23:14:41 +08:00
Julius Volz
6c930e8506
Merge pull request #16605 from prometheus/rules-page-filters
Add health & text filtering on the /rules page
2025-05-19 23:22:25 +02:00
Bartlomiej Plotka
8e6b008608
feature: type-and-unit-labels (PROM-39 implementation) (#16228)
* feature: type-and-unit-labels (extended MetricIdentity)

Experimental implementation of https://github.com/prometheus/proposals/pull/39

Previous (unmerged) experiments:
* https://github.com/prometheus/prometheus/compare/main...dashpole:prometheus:type_and_unit_labels
* https://github.com/prometheus/prometheus/pull/16025

Signed-off-by: bwplotka <bwplotka@gmail.com>

feature: type-and-unit-labels (extended MetricIdentity)

Experimental implementation of https://github.com/prometheus/proposals/pull/39

Previous (unmerged) experiments:
* https://github.com/prometheus/prometheus/compare/main...dashpole:prometheus:type_and_unit_labels
* https://github.com/prometheus/prometheus/pull/16025

Signed-off-by: bwplotka <bwplotka@gmail.com>

* Fix compilation errors

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

Lint

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

Revert change made to protobuf 'Accept' header

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

Fix compilation errors for 'dedupelabels' tag

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Rectored into schema.Metadata

Signed-off-by: bwplotka <bwplotka@gmail.com>

* texparse: Added tests for PromParse

Signed-off-by: bwplotka <bwplotka@gmail.com>

* add OM tests.

Signed-off-by: bwplotka <bwplotka@gmail.com>

* add proto tests

Signed-off-by: bwplotka <bwplotka@gmail.com>

* Addressed comments.

Signed-off-by: bwplotka <bwplotka@gmail.com>

* add schema label tests.

Signed-off-by: bwplotka <bwplotka@gmail.com>

* addressed comments.

Signed-off-by: bwplotka <bwplotka@gmail.com>

* fix tests.

Signed-off-by: bwplotka <bwplotka@gmail.com>

* add promql tests.

Signed-off-by: bwplotka <bwplotka@gmail.com>

* lint

Signed-off-by: bwplotka <bwplotka@gmail.com>

* Addressed comments.

Signed-off-by: bwplotka <bwplotka@gmail.com>

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-05-17 09:37:25 +00:00
Jan-Otto Kröpke
84a3acaf1b
Merge release-3.4 into main (#16609)
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
2025-05-17 10:04:22 +02:00
Jan-Otto Kröpke
93f7c78211
Release 3.4.0 (#16600) 2025-05-17 08:40:29 +02:00
Julius Volz
69ed0a5794 Add health & text filtering on the /rules page
Addresses part of https://github.com/prometheus/prometheus/issues/16515

For now, I'm adding very similar filtering to the /rules page as we have on
the /alerts page, with the difference being:

* The state filter filters by rule health (ok/warn/unknown) instead of
  alert state (firing/pending/inactive)
* We don't collect & show detailed stats on the different state counts as
  we do on the /alerts page

There is a lot of copied / very similar code between those two pages (and
also some others) around filtering and pagination, so maybe there is an
opportunity for more code sharing in the future here.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-05-16 17:50:46 +02:00
Julius Volz
5f1c6226e2 SD UI: Better total target count display when using keep_dropped_targets option
Fixes https://github.com/prometheus/prometheus/issues/16586

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-05-16 11:07:55 +02:00
Julius Volz
dbf5d01a62
Fix full-page re-rendering when opening status nav menu (#16590)
When opening the status pages menu while already viewing one of the
status pages, the whole page would be re-rendered because the menu target's
default action of following the current page's URL was not prevented. Also,
we don't need to use a NavLink component for the menu target when we are
not viewing a status page, because then the component won't need to be
highlighted anyways.

Discovered + fixed with the help of react-scan.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-05-12 12:17:18 +02:00
Julius Volz
5c06804df8
Optimize memoization and search debouncing on /targets page (#16589)
Moving the debouncing of the search field to the parent component and then
memoizing the ScrapePoolsList component prevents a lot of superfluous
re-renders of the entire scrape pools list that previously got triggered
immediately when you typed in the search box or even just collapsed a pool.
(While the computation of what data to show was already memoized in the
ScrapePoolList component, the component itself still had to re-render a lot
with the same data.)

Discovered this problem + verified fix using react-scan.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-05-12 10:39:58 +02:00
Ryan Wu
a810e59990 UI: optimize pool searching in /target page
Signed-off-by: Ryan Wu <rongjun0821@gmail.com>
2025-05-07 21:32:34 +08:00
Arve Knudsen
e7e3ab2824
Fix linting issues found by golangci-lint v2.0.2 (#16368)
* Fix linting issues found by golangci-lint v2.0.2

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-05-03 19:05:13 +02:00
Jan-Otto Kröpke
7a92230652
Prepare release 3.4.0-rc.0 (#16517)
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
2025-05-02 19:25:54 +02:00
Jan-Otto Kröpke
7789ef27c8
Upgraded npm dependencies pre 3.4.0-rc.0 (#16493) 2025-04-29 17:19:23 +02:00
amanycodes
ad8464249c removed comments
Signed-off-by: amanycodes <amanycodes@gmail.com>
2025-04-24 20:09:05 +05:30
amanycodes
25d2746e35 stable and unique key for /rules page and key fixes
Signed-off-by: amanycodes <amanycodes@gmail.com>
2025-04-24 20:09:03 +05:30
amanycodes
de5b5c56e2 fix-ci-errors
Signed-off-by: amanycodes <amanycodes@gmail.com>
2025-04-24 20:08:16 +05:30