16796 Commits

Author SHA1 Message Date
György Krajcsovits
475dfb5ea9
Drop commented out line
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-30 10:41:05 +01:00
György Krajcsovits
65b70bbe77
drop unused code
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-30 10:39:50 +01:00
György Krajcsovits
e6a0193a27
make testcases independent of order
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-30 09:30:05 +01:00
György Krajcsovits
4ef8186575
add inclusive delta test case
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-30 09:23:29 +01:00
György Krajcsovits
a0314d5539
Fix benchmark expectations on ST in interator
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-30 09:01:29 +01:00
György Krajcsovits
5d0f59d8fe
reduce footprint of the xoroptst chunk iterator object
It was 80 bytes with a lot of padding compared to the 56 bytes of the
original xor chunk iterator. Made it 64 bytes, tightly packed.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-26 11:07:52 +01:00
György Krajcsovits
e55f09f460
fix iterator benchmark for chunks not supporting ST
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-26 10:27:24 +01:00
György Krajcsovits
ca530d7f85
fix issue with seeking to last sample again
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-22 18:08:41 +01:00
György Krajcsovits
091379dc44
make new format usable in head
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-22 14:17:51 +01:00
György Krajcsovits
8c14b3c99c
optimize code path and layout
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-22 14:03:53 +01:00
György Krajcsovits
4b8fb76d95
feat(tsdb/chunkenc): add float chunk format with start timestamp support
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-22 08:57:38 +01:00
Bartlomiej Plotka
04a3ef75f2
chore: remove testutil.T which is no longer needed since Go 1.13 (#17903)
testutil.T was needed before https://go.dev/doc/go1.13#testingpkgtesting

Now it's inconsistent and confusing, so let's kill it.

Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-01-21 13:02:58 +00:00
Bartlomiej Plotka
664b255699
Merge pull request #17867 from prometheus/bwplotka/a2-scrape-1
refactor(appenderV2)[PART5a]: add AppendableV2 support to scrape loop + tests
2026-01-21 08:21:56 +00:00
zenador
e3b6eee437
promql: info function: fix series without identifying labels not being returned (#17898)
* promql: info function: fix series without identifying labels not being returned

---------

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2026-01-20 16:53:27 +01:00
Bartlomiej Plotka
c021f316ba
Merge pull request #17897 from roidelapluie/roidelapluie/gowork
Align go.work version with go.mod files
2026-01-20 12:53:41 +00:00
Julien Pivotto
6b3867e8d4 Align go.work version with go.mod files
Update go.work from go 1.24.9 to go 1.24.0 to match the version
specified in all go.mod files across the project

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-20 13:15:50 +01:00
Bryan Boreham
d83e11926d
Merge pull request #17795 from chuanye-gao/fix/ready-stopping-header-test
web: fix /-/ready stopping header and add tests
2026-01-20 11:59:22 +00:00
Bartlomiej Plotka
bc55334845
Merge pull request #17881 from bboreham/scrape-benchmark
[TESTS] Scraping: Reset appender in BenchmarkScrapeLoopAppend
2026-01-20 11:59:15 +00:00
Julien
2193782b1d
Merge pull request #17826 from roidelapluie/roidelapluie/goworkversion
scripts: use git ls-files and check go.work files in version check
2026-01-20 12:50:26 +01:00
Julien
d63e418d78
Merge pull request #17896 from roidelapluie/roidelapluie/fixdistroless
Fix ARG scoping in Dockerfile.distroless
2026-01-20 12:47:34 +01:00
Bryan Boreham
853572c1bf
Merge pull request #17830 from hritz220/util/strutil-enhance-test-coverage
util: enhance test coverage for strutil package
2026-01-20 11:43:41 +00:00
Julien Pivotto
3733a14b87 Fix ARG scoping in Dockerfile.distroless
ARG declarations before FROM are only available within the FROM
instruction and go out of scope afterward. Re-declare ARCH and OS
after FROM so they're available for the COPY instructions.

This fixes the build failure where ${OS}-${ARCH} resolved to empty
strings, causing "not found" errors for .build/-/prometheus.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-20 12:21:01 +01:00
wangyazhou
629bd3c5d5
Fix logger syntax for timingsLogger (#17870)
Fix logger syntax for timingsLogger

Signed-off-by: wangyazhou <564631192@qq.com>
2026-01-20 12:15:42 +01:00
yy
0e77dcfdb9
fix: typo in error message (#17878)
Signed-off-by: Yohei Yamamoto <yhymmt123@gmail.com>
2026-01-20 12:14:02 +01:00
Julien
3c532e14de
Merge pull request #17893 from roidelapluie/roidelapluie/distrolessarch
Fix multi-arch support for distroless Docker image
2026-01-20 11:07:05 +01:00
Siavash Safi
a89c665f47
feat(notifier): independent alertmanager sendloops (#16355)
* notifier: unit test for dropping throughput on stuck AM

Ref: https://github.com/prometheus/prometheus/issues/7676

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: Siavash Safi <siavash@cloudflare.com>

* chore(notifier): remove year from copyrights

Signed-off-by: Siavash Safi <siavash@cloudflare.com>

* feat(notifier): independent alertmanager sendloops

Independent Alertmanager sendloops avoid issues with queue overflowing
when one or more Alertmanager instances are unavailable which could
result in lost alert notifications.
The sendloops are managed per AlertmanagerSet which are dynamically
added/removed with service discovery or configuration reload.

The following metrics now include an extra dimention for alertmanager label:
- prometheus_notifications_dropped_total
- prometheus_notifications_queue_capacity
- prometheus_notifications_queue_length

This change also includes the test from #14099

Closes #7676

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
Signed-off-by: Siavash Safi <siavash@cloudflare.com>

---------

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: Siavash Safi <siavash@cloudflare.com>
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-01-20 10:33:07 +01:00
Ben Kochie
1a0c56993c
Use standard library errors in otlptranslator (#17894)
Remove direct use of `go.uber.org/multierr` in favor of standard
library `errors` package.

Signed-off-by: SuperQ <superq@gmail.com>
2026-01-20 10:13:40 +01:00
Julius Volz
1d3d98ed16
Merge pull request #17644 from prometheus/binop-fill-modifier
PromQL: Add `fill*()` binop modifiers to provide default values for missing series
2026-01-19 20:05:52 +01:00
Julien Pivotto
01637b47b0 Fix multi-arch support for distroless Docker image
The distroless Dockerfile was using a hardcoded SHA256 digest that
referenced only the amd64 image, preventing builds for other
architectures. This caused the main-distroless tag to only publish
amd64 images while the regular main tag had all 5 architectures.

Changes:
- Use architecture-specific image tags (nonroot-${DISTROLESS_ARCH})
  instead of SHA256 digest to enable multi-arch manifest resolution
- Add DISTROLESS_ARCH build arg to handle architecture name mapping
  (armv7 -> arm) between Prometheus and distroless conventions
- Move ARG declarations before FROM to support variable substitution

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-19 15:58:37 +01:00
Julien
716003851d
Merge pull request #17876 from roidelapluie/roidelapluie/distroless
Add distroless Docker image variant
2026-01-19 15:09:59 +01:00
Julien Pivotto
1105c825cf Add distroless Docker image variant
Introduces distroless image using UID/GID 65532 instead of nobody,
and removes VOLUME declaration. Busybox image remains default with
unchanged tags for backwards compatibility.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-19 14:39:59 +01:00
Arve Knudsen
572f247b4d
tsdb: add auto-cleanup to newTestHead and remove redundant cleanup calls (#17890)
Add automatic cleanup to newTestHeadWithOptions so that heads created
with newTestHead are automatically closed when the test ends. This
simplifies test code by removing the need for manual cleanup in most
cases.

Changes:
- Add t.Cleanup in newTestHeadWithOptions immediately after creating
  the head, using _ = h.Close() to handle double-close gracefully
- Remove redundant t.Cleanup, defer, and explicit Close calls from
  tests that use newTestHead
- Add cleanup for heads created with NewHead directly in restart
  patterns (e.g., restartHeadAndVerifySeriesCounts, startHead)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-01-19 12:57:05 +01:00
Arve Knudsen
dd85d7ca97
tsdb: fix memory leaks in buffer pools (#17879)
* tsdb: fix memory leaks in buffer pools

Clear reference fields when returning buffers to pools to avoid
retaining data after the buffer is reused.

Affected pools:
- refSeriesPool: clear Labels
- histogramsPool: clear H pointer
- floatHistogramsPool: clear FH pointer
- metadataPool: clear Unit and Help strings

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

* Clear slices

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

* Clear metadata buffer

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

* Remove tests

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

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-01-19 11:14:31 +00:00
Bryan Boreham
2dec6da3d1 [TESTS] Scraping: Reset appender in BenchmarkScrapeLoopAppend
Otherwise performance is dominated by adding to a slice that gets longer
and longer as the benchmark progresses.

I chose to Rollback rather than Commit because that should do less work.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2026-01-17 16:37:21 +00:00
Julius Volz
90dbdcd5dc Fix a missing space/newline in the binop docs
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-01-16 20:11:58 +01:00
Julius Volz
05440ffc3b Add a few fill modifier tests with keyword-like metric names
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-01-16 20:11:38 +01:00
Bartlomiej Plotka
c4b0da94db
Merge pull request #17835 from prometheus/bwplotka/a2-storage-support
feat(storage)[PART4b]: add AppenderV2 to the rest of storage.Storage implementations + mock exemplar fix
2026-01-16 13:04:14 +00:00
Julien
c7f92054fc
Merge pull request #17871 from roidelapluie/roidelapluie/fix-fuzzing-issues
fuzzing: fix artifact path and experimental parser flags
2026-01-16 12:54:31 +01:00
Julien Pivotto
66bb47ade6 fuzzing: fix artifact path and experimental parser flags
Fix two issues in fuzzing infrastructure:
- Correct artifact upload path from promql/testdata/fuzz to util/fuzzing/testdata/fuzz to match where Go stores crash artifacts
- Fix GetCorpusForFuzzParseExpr to preserve original parser flag values instead of always resetting them to false, which was disabling experimental features before actual fuzzing ran

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-16 12:07:16 +01:00
bwplotka
f61a83bcd6 fix: appenderV2 mock exemplar appendErr injection before appending it
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-01-16 10:47:00 +00:00
Arve Knudsen
4afa76d083
OTLP: label caching for OTLP-to-Prometheus conversion to reduce allocations and improve latency (#17860)
* otlptranslator: add label caching for OTLP-to-Prometheus conversion

Add per-request caching to reduce redundant computation and allocations
during OTLP metric conversion:

1. Per-request label sanitization cache: Cache sanitized label names
   within a request to avoid repeated string allocations for commonly
   repeated labels like __name__, job, instance.

2. Resource-level label caching: Precompute and cache job, instance,
   promoted resource attributes, and external labels once per
   ResourceMetrics boundary instead of for each datapoint.

3. Scope-level label caching: Precompute and cache scope metadata labels
   (otel_scope_name, otel_scope_version, etc.) once per ScopeMetrics
   boundary.

4. LabelNamer instance caching: Reuse the LabelNamer struct across
   datapoints within the same resource context.

These optimizations significantly reduce allocations and improve latency
for OTLP ingestion workloads with many datapoints per resource/scope.

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2026-01-16 10:30:05 +00:00
Julius Volz
ded3a8c309
UI: Fix broken Y axis after graph page reload (#17869)
* UI: Fix broken Y axis after graph page reload

The new `y_axis_min` setting was always encoded into the URL, even if its value
was `null` (in which case it would be set to an empty string parameter). On the
decoding side, this wasn't taken into account correctly, and we tried to parse
the empty string as a float, causing completely broken graphs showing nothing
after reloading the graph page with such URL parameters.

I'm doing two things now:

* For the future, only encode the Y axis min into the URL if it's set at all,
  similar as we do for the `end_input` and `moment_input` fields.
* On the decoding side, accommodate people (at least for now) who already saved
  some links with the empty `y_axis_min` parameter by treating an empty string
  as `null` instead of a number.

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Add URL state encoding/decoding tests

Signed-off-by: Julius Volz <julius.volz@gmail.com>

---------

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-01-16 09:50:39 +00:00
George Krajcsovits
ef350b2b54
Merge pull request #17840 from prometheus/krajo/st-in-chunks
feat(tsdb): new Append parameter and AtST interface for chunks
2026-01-16 10:32:53 +01:00
bwplotka
1d3c6210f3 add extra fanout test
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-01-15 14:13:58 +00:00
Julius Volz
d3b6e61487 Put binop fill modifiers behind a feature flag
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-01-15 11:18:48 +01:00
Arve Knudsen
a85a8998c9
otlptranslator: fix BenchmarkPrometheusConverter_FromMetrics (#17866)
The benchmark was passing appendMetadata=false to NewCombinedAppender,
which caused UpdateMetadata to never be called on the underlying
noOpAppender. This resulted in app.metadata always being 0, failing
the assertion that metadata count should be positive.

Fix by enabling metadata appending in the benchmark.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-01-15 09:33:16 +01:00
Julius Hinze
e49d11c88d
tsdb: fix rare case of OOO exemplar insertion pointing to the exemplar being deleted (#17865)
Signed-off-by: Julius Hinze <julius.hinze@grafana.com>
2026-01-15 08:49:37 +01:00
Julius Volz
d6aa6a3fc7 Add new fill modifiers to features test data
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-01-15 07:56:23 +01:00
Julius Volz
4c97952210 Document new fill binop modifiers
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-01-15 07:56:23 +01:00
Julius Volz
ce26370eeb Add PromLens binop matching explain view tests
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-01-15 07:56:23 +01:00