Bump VERSION to 3.13.0-rc.1 and add the 3.13.0-rc.1 CHANGELOG section.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The mantine-ui Vite build now generates a third-party-licenses.txt via
rollup-plugin-license, collecting the notices of every npm package bundled
into the UI. The file is embedded in the binary and served at
/assets/third-party-licenses.txt.
This replaces the npm_licenses.tar.bz2 archive, which was built by sweeping
node_modules for license* files and shipped as a separate file in release
tarballs and Docker images.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
The local codemirror-promql is consumed via pnpm's link: protocol and
carries its own node_modules, so its @codemirror/* and @lezer/* imports
resolve to a separate copy from react-app. That loads two instances of
@codemirror/state and breaks instanceof checks at runtime.
Add react-app-rewired with a config-overrides.js that aliases these
packages to react-app's single copy and drops CRA's ModuleScopePlugin
so the aliases take effect.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
react-app is not part of the pnpm workspace, so it pulled
@prometheus-io/codemirror-promql from the npm registry by exact version.
During a release, `make ui-bump-version` rewrote that pin to the new,
not-yet-published version, so the subsequent `pnpm install` failed with
ERR_PNPM_NO_MATCHING_VERSION.
Use pnpm's "link:" protocol to consume the locally built workspace package
instead. There is no version to publish or rewrite, react-app always builds
against the in-tree codemirror-promql, and its lockfile stays isolated (which
is why react-app was separated from the workspace in the first place).
build_ui.sh --all already builds the modules before react-app, so dist/ is
present at build time; `make ui-build` passes. Drop the dependency-rewriting
sed from ui_release.sh's bumpVersion accordingly.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Run `make update-npm-deps` to bump UI dependencies to their latest minor
versions (mantine 9.3.1, codemirror, typescript-eslint, rollup, prettier,
sass, sanitize-html and others).
The minor bump pulled in @codemirror/view 6.43.1 for the workspace's direct
dependencies while sibling @codemirror/* packages still resolved 6.43.0,
leaving two copies in the tree and breaking the TypeScript build (CodeMirror
requires a single @codemirror/view instance). Run `pnpm dedupe` in web/ui and
web/ui/react-app to collapse it to a single 6.43.1, which also removes other
duplicated subtrees. `make ui-build` passes.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Run 'make update-all-go-deps' with the go1.25.0 toolchain to keep the
module compatible with the declared go 1.25.0 version.
Dependencies requiring a newer Go toolchain (k8s.io/*, google.golang.org/api,
github.com/pb33f/libopenapi*) were intentionally not upgraded.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Run `make update-all-go-deps` with the Go toolchain pinned to 1.25.0
(`GOTOOLCHAIN=go1.25.0`) so the `go` directive stays at 1.25.0 and the
project keeps building with any Go 1.25.x. Dependency updates that would
raise their own minimum Go past 1.25.0 (Kubernetes v0.36.x, Consul
api >= v1.34, bufbuild/buf v1.70, google.golang.org/api v0.284) are left at
their current versions and can be picked up once the project moves to Go 1.26.
github.com/prometheus/common is updated to v0.68.1, which removed the
expfmt.WithUnit() encoder option (the unit is now written automatically when
set). Drop the now-removed option from the scrape manager test; it was a
no-op there because the test metric does not set a unit.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This is a followup to our previous commit where we made convert_classic_histograms_to_nhcb
configurable at discovery time. We add the other native histogram labels
too here.
Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
promql: Add metric and stats to track total samples read per query
[FEATURE] PromQL: Expose per-query `samplesRead` (and `samplesReadPerStep` with `stats=all` and the `promql-per-step-stats` feature flag) in the query stats response, and add the `prometheus_engine_query_samples_read_total` engine counter. `samplesRead` reflects storage I/O distinct from `totalQueryableSamples`, which counts samples loaded into the evaluator (and so over-counts when a sample is reused across multiple range-vector windows).
[BUGFIX] PromQL: A range query whose `end` was not aligned to `step` caused subqueries inside it to evaluate past the parent's last actual step, inflating `peakSamples` in the query stats and against the `query.max-samples` limit, and wasting storage I/O reading samples that were never used in the result.
[BUGFIX] PromQL: A range query containing an at-modifier-unsafe function over a range-vector with an `@` modifier (e.g. `predict_linear(metric[60s] @ T, X)`) silently under-counted `totalQueryableSamples` for steps after step 0.
Replace the deprecated SHA-1 hash used to generate rule group pagination
tokens in getRuleGroupNextToken with SHA-256. The token is opaque and
compared server-side only, so this does not change the API contract. Add
a unit test covering the token format and determinism.
Fixes#18841
Signed-off-by: Yash Anil <yashanil98@gmail.com>
Switch the UI workspace from npm to pnpm. Declare jest as a direct
devDependency in lezer-promql (pnpm's strict isolation requires every
binary to be an explicit dependency), fix the moduleNameMapper path in
codemirror-promql's jest config to reflect pnpm's per-package
node_modules layout, and add a localStorage mock to mantine-ui's test
setup so module-level Redux slice initializers work under Node.js v22+,
which pre-defines localStorage as undefined on globalThis.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Adding this as a meta label makes it possible to dynamically configure
this setting through discovery labels.
This helps in usecases like K8S where we could enable this with a pod
annotation.
Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
* chore: fix typos in comments
Fix three minor typos in source comments:
- scrape: mimicks -> mimics
- tsdb: descibes -> describes
- ui/codemirror-promql: theses -> these
Signed-off-by: RoySerbi <roy676564@gmail.com>
* ci: retrigger CI to clear known 32-bit flake
Empty commit to retrigger CI. The previous run failed only on
'Go tests for 32-bit x86' due to the known intermittent flake in
TestRemoteWrite_PerQueueMetricsAfterRelabeling (see #17356), which
is unrelated to this comment-only PR.
Signed-off-by: RoySerbi <roy676564@gmail.com>
---------
Signed-off-by: RoySerbi <roy676564@gmail.com>
Add a per-query samples-read counter that distinguishes storage I/O
from the existing TotalSamples count. TotalSamples reports samples
loaded into the evaluator and so over-counts when a sample is reused
across multiple range-vector windows; samplesRead reflects what the
storage layer actually had to read.
For range-vector functions in range queries, samplesRead applies
delta semantics: step 0 counts the full window, later steps count
only the points not already present in the previous step's window.
For other query shapes samplesRead equals TotalSamples.
Expose the new counter:
- as `samplesRead` and `samplesReadPerStep` in /api/v1/query{,_range}
stats responses (the per-step variant only with stats=all and the
per-step stats feature flag enabled);
- as the `prometheus_engine_query_samples_read_total` Prometheus
counter, reporting the cumulative samples-read across all queries;
- in the OpenAPI schemas.
Also update the per-step stats feature flag and querying API
documentation, and add unit tests covering instant queries, range
queries, range-vector functions, and subqueries.
Signed-off-by: Dan Cech <dcech@grafana.com>
Set ignore-scripts=true, allow-git=none, and min-release-age=3 to
harden npm installs against lifecycle script abuse, git-sourced
dependencies, and recently published packages.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
* web/api: reject 0 for limit and batch_size in search endpoints
Treat 0 as invalid for limit and batch_size query parameters; clients
must supply a positive integer or omit the parameter to use the server
default of 100. Update OpenAPI descriptions accordingly.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
* Update web/api/v1/openapi.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Julien <291750+roidelapluie@users.noreply.github.com>
---------
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Julien <291750+roidelapluie@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Implement least(a, b) and greatest(a, b) as scalar-returning PromQL
functions backed by math.Min and math.Max respectively.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Rename the `min()` and `max()` duration expression functions to
`least()` and `greatest()` to avoid conflicts with the existing
PromQL aggregate functions `min` and `max`.
Update documentation and tests accordingly.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>