1160 Commits

Author SHA1 Message Date
Bryan Boreham
d94ee60883 perf(tsdb): don't fetch labels in TSDBIndex.GetChunkRefs (#20970)
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2026-02-25 15:21:21 -05:00
Bryan Boreham
6b58156938 perf(tsdb): return full slice to pool after use (#20969)
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2026-02-25 15:19:38 -05:00
Stas Spiridonov
ded0b08f9f chore: add latency metric for objstore client (#20948) 2026-02-24 16:33:10 +00:00
Ivan Kalita
9525e5327b fix(alloc): set a limit on preallocations (#20891)
Limits the preallocations of various maps and slices.

Thanks @Proximyst for finding and fixing.
2026-02-20 10:44:01 +01:00
Arve Knudsen
a94636578a chore: upgrade to prometheus@main (#20876)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-02-19 12:10:55 -05:00
Mariell Hoversholm
1cb060b018 fix: use TrimSuffix over Trim (#20830)
The intent here is to remove an extension of a file, namely .gz. This is currently
implemented with a strings.Trim, which will remove ALL occurrences of ., g, and z
from the start and end of the string. For example, that'd break egg.gz as it'd return just e.

This commit restores the intent of removing only the .gz suffix.

I haven't been able to find an exploitable path for this, luckily, so I'm only aiming
to restore the intent that seems to be originally held here.

(Detected with help of CodeQL)
2026-02-17 09:57:04 +00:00
Paul Rogers
48b17f6081 chore(deps): Remove references to github.com/prometheus/prometheus/tsdb/errors (#20794) 2026-02-13 08:46:04 -05:00
Mariell Hoversholm
f8d94cbb6a fix: Mask all credentials (#20766) 2026-02-11 12:35:36 +00:00
Jason Nochlin
5102ed0592 feat(bench): add simulated object storage latency to LogQL benchmarks (#20733)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-07 07:13:25 -07:00
yy
0574159216 chore: typos in comments (#20481) 2026-01-20 08:24:56 -05:00
Daniel-Davies
d940433736 [feat] Add config option to override Azure AD endpoint (#20267)
Co-authored-by: Trevor Whitney <trevorjwhitney@gmail.com>
2025-12-19 17:59:56 +00:00
Julien Pinsonneau
0c3dd8ce7e fix: compactor file descriptor leak (#20077) 2025-12-09 18:13:28 +05:30
renovate-sh-app[bot]
0aac50bffb fix(deps): update module github.com/prometheus/prometheus to v0.308.0 (main) (#20131)
Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: Paul Rogers <paul.rogers@grafana.com>
2025-12-05 12:16:56 -05:00
Christian Haudum
0046bfb3a4 fix: Do not override S3 region if already specified in configuration chain (#20127)
The region (and other settings) for the S3 configuration can be specified in various ways.
When the region was already set by LoadDefaultConfig it should not be set to InvalidAWSRegion.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
2025-12-05 10:48:14 +01:00
Christian Haudum
d3f9532b06 fix: Fix regression in S3 client configuration (#20110)
### Summary

This PR fixes a regression in how Loki's S3 configuration options are handled to create the S3 client which was introduced with the upgrade of the AWS SDK from v1 to v2 (#19205).

With the v1 SDK the `s3` field of the `aws` configuration block was parsed to extract credentials, region, host, and schema.

```
storage_config:
  aws:
    s3: s3://<accesskey>:<secret>@<endpoint_or_region>/<bucketnames>
```

After the upgrade, only credentials were extraced, leaving all other parts of the URL as default, which would require explicit overrides.

This was a breaking change and not documented in the upgrade notes. We want to keep backwards compatibility, even though the Thanos object client is going to supersed the custom S3/GCS/... clients.

ref: #19908

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
2025-12-04 16:55:51 +00:00
Ashwanth
54f9723af1 chore(xcap): adds exporter to summarise capture as a structured log line (#20099) 2025-12-04 13:34:55 +00:00
Ashwanth
484299df05 chore(xcap): Adds wrapper around bucket client to track operations (#20094) 2025-12-03 19:52:33 +05:30
renovate-sh-app[bot]
ea00c1556f fix(deps): update module github.com/redis/go-redis/v9 to v9.16.0 (main) (#19819)
Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: Paul Rogers <paul.rogers@grafana.com>
2025-11-12 10:36:16 -05:00
renovate-sh-app[bot]
898b6d2037 fix(deps): update module github.com/gocql/gocql to v2 (main) (#19794)
Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Signed-off-by: Paul Rogers <129207811+paul1r@users.noreply.github.com>
Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: Paul Rogers <paul.rogers@grafana.com>
Co-authored-by: Paul Rogers <129207811+paul1r@users.noreply.github.com>
2025-11-09 12:41:54 -05:00
Ed Welch
95925ee031 chore: improve querier stats (#19635) 2025-10-29 14:25:15 -04:00
Dylan Guedes
5325437d00 fix: Use default config when building s3 client (#19556) 2025-10-21 12:22:58 -03:00
Sandeep Sukhani
a17c033238 chore: compactor worker chunk client congestion control (#19493) 2025-10-14 19:31:33 +05:30
Christian Haudum
c06eb636e5 chore(engine): Add "compatibility node" to physical plan to adhere with naming of "colliding labels" in v1 engine (#19470)
### Summary

The v1 engine has a mechanism to rename labels in case they have the same name but different origin, such as labels, structured metadata, or parsed fields.

1. In case a log line has a structured metadata key with the same name as the label name of the stream, than the metadata key is suffixed with `_extracted`, such as `service_extracted`, if `service` exists in both `labels` and `metadata`.
2. In case a parser creates a parsed field with the same as the label name of the stream, then the parsed key is suffixed with `_extracted` in the same way as case 1. However, if the field name also collides with a structured metadata key, then the extracted structured metadata is replaced with the extracted parsed field.

This PR only implements the first case. As a follow up PR, the second case needs to be implemented as well. Additionally, the newly introduced "compatibility node" should also be made optional with a feature flag and/or per-request.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
2025-10-12 21:00:17 +02:00
Jackson Coelho
d3c54b09fe chore(build): update loki build image (#19473)
Co-authored-by: George Robinson <george.robinson@grafana.com>
2025-10-10 18:05:48 +02:00
Sandeep Sukhani
a935a63abb chore: add support for fetching chunks with sizing info from the index to optimize GetShards calls (#19221)
Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Co-authored-by: Christian Haudum <christian.haudum@gmail.com>
2025-10-09 08:10:18 +00:00
Jarkko Pöyry
815072fe27 chore(indexshipper): Close temp file after download (#19398)
When downloading a potentially compressed file, the file is first downloaded into a temp file and this temp file is then re-opened and processed. The re-opened *File is Close()d as expected but the initial temp *File is not.

This PR adds the missing Close().
2025-10-08 10:32:45 +02:00
Sophie Waldman
e35887bbf5 chore: Update AWS SDK to v2 (#19205)
Signed-off-by: Sophie Waldman <sophie.waldman@grafana.com>

The first version of the AWS SDK for Go reached end of support on 2025-07-31. This PR migrates us to V2 of the SDK which is still supported.

Fixes https://github.com/grafana/loki-private/issues/1426
2025-09-26 16:39:46 -04:00
Sophie Waldman
98b411a649 chore(linter): Fix issues flagged by updated golangci-lint version (#19206) 2025-09-15 16:58:01 -04:00
Sandeep Sukhani
3618279603 chore: optimize chunk rewrite while filtering out deleted data (#19140) 2025-09-10 18:52:53 +05:30
Sandeep Sukhani
0b2d0b070e chore: make index updates idempotent from horizontally scalable compactor (#19093) 2025-09-03 19:24:04 +05:30
Charles Korn
8509f1df90 chore(deps): upgrade dskit (#19089) 2025-09-02 10:04:49 +05:30
dannyc-grafana
ecdd613a0c chore: Autofix to make nosec comments also readable by semgrep (#18664) 2025-07-30 14:28:17 -04:00
Robert Fratto
517b59f087 chore: update github.com/thanos-io/objstore fork (#18620) 2025-07-28 13:36:31 -04:00
Robert Fratto
79646a4815 chore: clarify comments in labels.Labels.Range loop (#18503) 2025-07-18 17:25:47 +00:00
Robert Fratto
86c57c8616 chore: consistently use new labels.Labels API (#18490) 2025-07-18 13:15:40 -04:00
Sandeep Sukhani
ba3c67076a feat(compactor HS): add support for applying storage updates after finishing processing of deletion manifest (#18294) 2025-07-02 09:43:20 +05:30
Christian Haudum
66c483981b chore(blooms): Reduce memory footprint of download queue (#18242)
The download queue has a fixed size of 100k elements and is implemented using a channel. Since the channel has a fixed size, this will allocate `capacity * object size`, where the object is `downloadRequest[BlockRef, BlockDirectory]`.

This PR changes the channel from a channel of objects (`chan downloadRequest[T, R]`) to a channel of pointers (`chan *downloadRequest[T, R]`) which should significantly reduce the permanently allocated memory for the queue.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
2025-06-26 11:24:15 +02:00
Assel Meher
1954f67a50 fix: Handle WAL corruption properly on startup (#18175)
Signed-off-by: Assel Meher <asselmeher@gmail.com>
Co-authored-by: Paul Rogers <129207811+paul1r@users.noreply.github.com>
2025-06-23 17:30:14 +02:00
renovate[bot]
8b265ede15 fix(deps): update module github.com/prometheus/common to v0.64.0 (main) (#16750)
Signed-off-by: Paul Rogers <129207811+paul1r@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Paul Rogers <paul.rogers@grafana.com>
Co-authored-by: Paul Rogers <129207811+paul1r@users.noreply.github.com>
2025-06-13 12:01:18 -04:00
Christian Haudum
fc7c0189c0 fix: Fix nil pointer dereference in Volume method of the composite store (#18064)
If err is nil then calling the method Error() on it causes a nil pointer dereference.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
2025-06-11 13:26:26 +00:00
Charles Korn
545fb1597c refactor(stringlabels): Support stringlabels in logql/log package (#17838)
This is another step towards supporting Prometheus' stringlabels implementation in Loki. It adds support in the `logql/log` package.

Part of https://github.com/grafana/loki/issues/17122

The tests should now compile and pass with `-tags stringlabels`.

---
Co-authored-by: Karsten Jeschkies <karsten.jeschkies@grafana.com>
2025-06-04 06:39:25 +00:00
Oleg Zaytsev
c8a15f451c refactor: Use OTel tracing library (#17859)
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2025-06-02 12:44:13 -04:00
Oleg Zaytsev
37a5116a19 chore(spanlogger): force all usages to provide a logger (#17851)
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2025-05-29 09:28:51 -04:00
Sandeep Sukhani
267f4dc0ec feat(compactor HS): add job queue and deletion job builder (#17843) 2025-05-29 17:38:52 +05:30
Oleg Zaytsev
44b2c27eaa chore: update dskit to support OTel tracing (#17846)
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2025-05-28 15:31:04 -04:00
Sandeep Sukhani
47961f802d feat: Compactor deletion manifest builder (#17474) 2025-05-09 23:36:51 +05:30
Trevor Whitney
577d501839 refactor: extractors can return multiple samples (#17064)
Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>
2025-05-08 20:41:11 -06:00
Shantanu Alshi
4aa6e62f06 chore(detected_labels): Add multi-tenant support for detected labels (#17031) 2025-05-02 07:16:21 +00:00
Cong Ding
31253f4953 chore(deps): Upgrade willf/bloom for CVE-2023-0247 (#17492) 2025-04-29 16:00:19 -04:00
Ed Welch
3d8d822b6e chore: adds a simple noop object client (#17365) 2025-04-22 15:50:42 -04:00