Skip to content

Commit c3e7f48

Browse files
authored
Merge branch 'main' into fix/default-data-location-7748
2 parents 37dfdb0 + a87863c commit c3e7f48

File tree

171 files changed

+8002
-2633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+8002
-2633
lines changed

.github/workflows/logql-correctness.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@ name: LogQL correctness tests
22
on:
33
schedule:
44
- cron: "30 2 * * 1-5" # Mon-Fri at 2.30am UTC
5+
pull_request:
6+
paths:
7+
- "pkg/engine/**"
8+
- "pkg/dataobj/**"
59
workflow_dispatch:
610
inputs:
711
ref:
8-
description: 'Git ref to run correctness tests on'
12+
description: "Git ref to run correctness tests on"
913
required: false
10-
default: 'main'
11-
type: 'string'
14+
default: "main"
15+
type: "string"
1216
failfast:
13-
description: 'Fail fast on first test failure'
17+
description: "Fail fast on first test failure"
1418
required: false
1519
default: true
16-
type: 'boolean'
20+
type: "boolean"
1721
permissions: {}
1822
jobs:
1923
generate-testdata:
@@ -25,7 +29,7 @@ jobs:
2529
id: checkout
2630
uses: actions/checkout@v4
2731
with:
28-
ref: ${{ inputs.ref || 'main' }}
32+
ref: ${{ inputs.ref }}
2933

3034
- name: Setup Go
3135
uses: actions/setup-go@v4

docs/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,18 @@ Note that in Hugo the structure of the documentation is based on the folder stru
4141

4242
## Shared content
4343

44-
**NOTE:** As of Loki/GEL 3.0, there will be shared files between the Loki docs and the GEL docs. The Grafana Enterprise Logs documentation will pull in content from the Loki repo when publishing the GEL docs. Files that are shared between the two doc sets will contain a comment indicating that the content is shared.
44+
**NOTE:** As of Loki/GEL 3.0, there are shared files between the Loki docs and the GEL docs. The Grafana Enterprise Logs documentation will pull in content from the Loki repo when publishing the GEL docs. Files that are shared between the two doc sets will contain a comment indicating that the content is shared.
4545

4646
For more information about shared content, see the [reuse content](https://grafana.com/docs/writers-toolkit/write/reuse-content/) section of the Writers' Toolkit.
4747

4848
For more information about building and testing documentation, see the [build and review](https://grafana.com/docs/writers-toolkit/review/) section of the Writers' Toolkit.
4949

50+
### Lambda-Promtail documentation
51+
52+
As of June 2025, the code for the Lambda-promtail client has moved from the Loki repository to a separate [lambda-promtail repository](https://github.com/grafana/lambda-promtail).
53+
54+
As of October 2025, the documentation for the Lambda-promtail client has also moved to the lambda-promtail repository. You can find it under [docs/sources](https://github.com/grafana/lambda-promtail/tree/main/docs/sources).
55+
5056
## Testing documentation
5157

5258
Loki uses the static site generator [Hugo](https://gohugo.io/) to generate the documentation. The Loki repository uses a continuous integration (CI) action to sync documentation to the [Grafana website](https://grafana.com/docs/loki/latest). The CI is triggered on every merge to main in the `docs` subfolder.

docs/sources/alert/_index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,16 @@ The [Cortex rules action](https://github.com/grafana/cortex-rules-action) introd
304304
uses: grafana/cortex-rules-action@master
305305
env:
306306
ACTION: check
307-
RULES_DIR: <source_dir_of_rules> # Example: logs/recording_rules/,logs/alerts/
307+
RULES_DIR: <SOURCE_DIR_OF_RULES> # Example: logs/recording_rules/,logs/alerts/
308308
BACKEND: loki
309309
310310
- name: Deploy rules to Loki staging
311311
uses: grafana/cortex-rules-action@master
312312
env:
313-
CORTEX_ADDRESS: <loki_ingress_addr>
313+
CORTEX_ADDRESS: <LOKI_INGRESS_ADDR>
314314
CORTEX_TENANT_ID: fake
315315
ACTION: sync
316-
RULES_DIR: <source_dir_of_rules> # Example: logs/recording_rules/,logs/alerts/
316+
RULES_DIR: <SOURCE_DIR_OF_RULES> # Example: logs/recording_rules/,logs/alerts/
317317
BACKEND: loki
318318
```
319319

@@ -327,7 +327,7 @@ A full sharding-enabled Ruler example is:
327327

328328
```yaml
329329
ruler:
330-
alertmanager_url: <alertmanager_endpoint>
330+
alertmanager_url: <ALERTMANAGER_ENDPOINT>
331331
enable_alertmanager_v2: true # true by default since Loki 3.2.0
332332
enable_api: true
333333
enable_sharding: true
@@ -339,7 +339,7 @@ ruler:
339339
rule_path: /tmp/rules
340340
storage:
341341
gcs:
342-
bucket_name: <loki-rules-bucket>
342+
bucket_name: <LOKI_RULES_BUCKET>
343343
```
344344

345345
## Ruler storage

docs/sources/community/maintaining/release/patch-vulnerabilities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Before start patching vulnerabilities, know what are you patching. It can be one
4343
1. Check if [dependabot already patched the dependency](https://github.com/grafana/loki/pulls?q=is%3Apr+label%3Adependencies+is%3Aclosed) or [have a PR opened to patch](https://github.com/grafana/loki/pulls?q=is%3Apr+is%3Aopen+label%3Adependencies) . If not, manually upgrade the package on the `main` branch as follows.
4444

4545
```shell
46-
go get -u -v <package-path>@<patched-version>
46+
go get -u -v <PACKAGE_PATH>@<PATCHED_VERSION>
4747
go mod tidy
4848
go mod vendor
4949
```

docs/sources/get-started/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ aliases:
1414
Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus.
1515
It's designed to be very cost-effective and easy to operate.
1616
It doesn't index the contents of the logs, but rather a set of labels for each log stream.
17+
Note that the entire content of the log line is searchable, using labels just makes searching more efficient by narrowing the number of logs retrieved during querying.
1718

1819
Because all Loki implementations are unique, the installation process is different for every customer.
1920
But there are some steps in the process that are common to every installation.

docs/sources/get-started/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Loki architecture
3-
menutitle: Architecture
3+
menuTitle: Architecture
44
description: Describes the Grafana Loki architecture.
55
weight: 400
66
aliases:

docs/sources/get-started/components.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Loki components
3-
menutitle: Components
3+
menuTitle: Components
44
description: Describes the various components that make up Grafana Loki.
55
weight: 500
66
aliases:
@@ -12,7 +12,7 @@ aliases:
1212

1313
Loki is a modular system that contains many components that can either be run together (in "single binary" mode with target `all`),
1414
in logical groups (in "simple scalable deployment" mode with targets `read`, `write`, `backend`), or individually (in "microservice" mode).
15-
For more information see [Deployment modes](../deployment-modes/).
15+
For more information see [Deployment modes](https://grafana.com/docs/loki/<LOKI_VERSION>/get-started/deployment-modes/).
1616

1717
| Component | _individual_ | `all` | `read` | `write` | `backend` |
1818
|----------------------------------------------------|--------------| - | - | - | - |
@@ -24,13 +24,13 @@ For more information see [Deployment modes](../deployment-modes/).
2424
| [Index Gateway](#index-gateway) | x | | | | x |
2525
| [Compactor](#compactor) | x | x | | | x |
2626
| [Ruler](#ruler) | x | x | | | x |
27+
| [Pattern ingester](#pattern-ingester) | x | x | | x | |
2728
| [Bloom Planner (Experimental)](#bloom-planner) | x | | | | x |
2829
| [Bloom Builder (Experimental)](#bloom-builder) | x | | | | x |
2930
| [Bloom Gateway (Experimental)](#bloom-gateway) | x | | | | x |
3031

3132
This page describes the responsibilities of each of these components.
3233

33-
3434
## Distributor
3535

3636
The **distributor** service is responsible for handling incoming push requests from
@@ -118,7 +118,6 @@ quorum consistency on reads and writes. This means that the distributor will wai
118118
for a positive response of at least one half plus one of the ingesters to send
119119
the sample to before responding to the client that initiated the send.
120120

121-
122121
## Ingester
123122

124123
The **ingester** service is responsible for persisting data and shipping it to long-term
@@ -133,7 +132,7 @@ the hash ring. Each ingester has a state of either `PENDING`, `JOINING`,
133132
another ingester that is `LEAVING`. This only applies for legacy deployment modes.
134133

135134
{{< admonition type="note" >}}
136-
Handoff is a deprecated behavior mainly used in stateless deployments of ingesters, which is discouraged. Instead, it's recommended using a stateful deployment model together with the [write ahead log](../../operations/storage/wal/).
135+
Handoff is a deprecated behavior mainly used in stateless deployments of ingesters, which is discouraged. Instead, it's recommended using a stateful deployment model together with the [write ahead log](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/storage/wal/).
137136
{{< /admonition >}}
138137

139138
1. `JOINING` is an Ingester's state when it is currently inserting its tokens
@@ -179,7 +178,7 @@ Loki is configured to [accept out-of-order writes](https://grafana.com/docs/loki
179178

180179
When not configured to accept out-of-order writes, the ingester validates that ingested log lines are in order. When an
181180
ingester receives a log line that doesn't follow the expected order, the line
182-
is rejected and an error is returned to the user.
181+
is rejected and an error is returned to the user.
183182

184183
The ingester validates that log lines are received in
185184
timestamp-ascending order. Each log has a timestamp that occurs at a later
@@ -190,7 +189,7 @@ Logs from each unique set of labels are built up into "chunks" in memory and
190189
then flushed to the backing storage backend.
191190

192191
If an ingester process crashes or exits abruptly, all the data that has not yet
193-
been flushed could be lost. Loki is usually configured with a [Write Ahead Log](../../operations/storage/wal/) which can be _replayed_ on restart as well as with a `replication_factor` (usually 3) of each log to mitigate this risk.
192+
been flushed could be lost. Loki is usually configured with a [Write Ahead Log](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/storage/wal/) which can be _replayed_ on restart as well as with a `replication_factor` (usually 3) of each log to mitigate this risk.
194193

195194
When not configured to accept out-of-order writes,
196195
all lines pushed to Loki for a given stream (unique combination of
@@ -209,7 +208,7 @@ nanosecond timestamps:
209208
### Handoff
210209

211210
{{< admonition type="warning" >}}
212-
Handoff is deprecated behavior mainly used in stateless deployments of ingesters, which is discouraged. Instead, it's recommended using a stateful deployment model together with the [write ahead log](../../operations/storage/wal/).
211+
Handoff is deprecated behavior mainly used in stateless deployments of ingesters, which is discouraged. Instead, it's recommended using a stateful deployment model together with the [write ahead log](https://grafana.com/docs/loki/latest<LOKI_VERSION>/operations/storage/wal/).
213212
{{< /admonition >}}
214213

215214
By default, when an ingester is shutting down and tries to leave the hash ring,
@@ -232,7 +231,6 @@ works in single-process mode as [queriers](#querier) need access to the same
232231
back-end store and BoltDB only allows one process to have a lock on the DB at a
233232
given time.
234233

235-
236234
## Query frontend
237235

238236
The **query frontend** is an **optional service** providing the querier's API endpoints and can be used to accelerate the read path. When the query frontend is in place, incoming query requests should be directed to the query frontend instead of the queriers. The querier service will be still required within the cluster, in order to execute the actual queries.
@@ -277,20 +275,18 @@ This cache is only applicable when using single store TSDB.
277275
The query frontend caches log volume query results similar to the [metric query](#metric-queries) results.
278276
This cache is only applicable when using single store TSDB.
279277

280-
281278
## Query scheduler
282279

283-
The **query scheduler** is an **optional service** providing more [advanced queuing functionality](../../operations/query-fairness/) than the [query frontend](#query-frontend).
280+
The **query scheduler** is an **optional service** providing more [advanced queuing functionality](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/query-fairness/) than the [query frontend](#query-frontend).
284281
When using this component in the Loki deployment, query frontend pushes split up queries to the query scheduler which enqueues them in an internal in-memory queue.
285282
There is a queue for each tenant to guarantee the query fairness across all tenants.
286283
The queriers that connect to the query scheduler act as workers that pull their jobs from the queue, execute them, and return them to the query frontend for aggregation. Queriers therefore need to be configured with the query scheduler address (via the `-querier.scheduler-address` CLI flag) in order to allow them to connect to the query scheduler.
287284

288285
Query schedulers are **stateless**. However, due to the in-memory queue, it's recommended to run more than one replica to keep the benefit of high availability. Two replicas should suffice in most cases.
289286

290-
291287
## Querier
292288

293-
The **querier** service is responsible for executing [Log Query Language (LogQL)](../../query/) queries.
289+
The **querier** service is responsible for executing [Log Query Language (LogQL)](https://grafana.com/docs/loki/<LOKI_VERSION>/query/) queries.
294290
The querier can handle HTTP requests from the client directly (in "single binary" mode, or as part of the read path in "simple scalable deployment")
295291
or pull subqueries from the query frontend or query scheduler (in "microservice" mode).
296292

@@ -301,30 +297,28 @@ factor, it is possible that the querier may receive duplicate data. To resolve
301297
this, the querier internally **deduplicates** data that has the same nanosecond
302298
timestamp, label set, and log message.
303299

304-
305300
## Index Gateway
306301

307302
The **index gateway** service is responsible for handling and serving metadata queries.
308303
Metadata queries are queries that look up data from the index. The index gateway is only used by "shipper stores",
309-
such as [single store TSDB](../../operations/storage/tsdb/) or [single store BoltDB](../../operations/storage/boltdb-shipper/).
304+
such as [single store TSDB](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/storage/tsdb/) or [single store BoltDB](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/storage/boltdb-shipper/).
310305

311306
The query frontend queries the index gateway for the log volume of queries so it can make a decision on how to shard the queries.
312307
The queriers query the index gateway for chunk references for a given query so they know which chunks to fetch and query.
313308

314309
The index gateway can run in `simple` or `ring` mode. In `simple` mode, each index gateway instance serves all indexes from all tenants.
315310
In `ring` mode, index gateways use a consistent hash ring to distribute and shard the indexes per tenant amongst available instances.
316311

317-
318312
## Compactor
319313

320-
The **compactor** service is used by "shipper stores", such as [single store TSDB](../../operations/storage/tsdb/)
321-
or [single store BoltDB](../../operations/storage/boltdb-shipper/), to compact the multiple index files produced by the ingesters
314+
The **compactor** service is used by "shipper stores", such as [single store TSDB](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/storage/tsdb/)
315+
or [single store BoltDB](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/storage/boltdb-shipper/), to compact the multiple index files produced by the ingesters
322316
and shipped to object storage into single index files per day and tenant. This makes index lookups more efficient.
323317

324318
To do so, the compactor downloads the files from object storage in a regular interval, merges them into a single one,
325319
uploads the newly created index, and cleans up the old files.
326320

327-
Additionally, the compactor is also responsible for [log retention](../../operations/storage/retention/) and [log deletion](../../operations/storage/logs-deletion/).
321+
Additionally, the compactor is also responsible for [log retention](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/storage/retention/) and [log deletion](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/storage/logs-deletion/).
328322

329323
In a Loki deployment, the compactor service is usually run as a single instance.
330324

@@ -340,7 +334,18 @@ from the query frontend.
340334

341335
When running multiple rulers, they use a consistent hash ring to distribute rule groups amongst available ruler instances.
342336

337+
## Pattern ingester
338+
339+
The optional **pattern ingester** component receives log data from the ingesters and scans the logs to detect and aggregate patterns. This can be useful for understanding the structure of your logs at scale. The pattern ingester is used by the pattern feature in Logs Drilldown, which lets you detect similar log lines and add or exclude them from your search.
340+
341+
The ingester uses a drain algorithm to identify related logs that share the same pattern, and maintain their counts over time. Patterns consist of a number, a string, and a Loki series identifier.
342+
343+
The pattern ingester exposes a query API, so you can fetch detected patterns. This API is used by the Patterns tab in the Grafana Logs Drilldown plugin.
344+
345+
This component is disabled by default and must be enabled in your [Loki config file](https://grafana.com/docs/loki/latest/configure/#supported-contents-and-default-values-of-lokiyaml).
346+
343347
## Bloom Planner
348+
344349
{{< admonition type="warning" >}}
345350
This feature is an [experimental feature](/docs/release-life-cycle/). Engineering and on-call support is not available.
346351
No SLA is provided.
@@ -353,27 +358,29 @@ been built for a given day and tenant and what series need to be newly added.
353358
This service is also used to apply blooms retention.
354359

355360
## Bloom Builder
361+
356362
{{< admonition type="warning" >}}
357363
This feature is an [experimental feature](/docs/release-life-cycle/). Engineering and on-call support is not available.
358364
No SLA is provided.
359365
{{< /admonition >}}
360366

361367
The Bloom Builder service is responsible for processing the tasks created by the Bloom Planner.
362368
The Bloom Builder creates bloom blocks from structured metadata of log entries.
363-
The resulting blooms are grouped in bloom blocks spanning multiple series and chunks from a given day.
369+
The resulting blooms are grouped in bloom blocks spanning multiple series and chunks from a given day.
364370
This component also builds metadata files to track which blocks are available for each series and TSDB index file.
365371

366372
The service is stateless and horizontally scalable.
367373

368374
## Bloom Gateway
375+
369376
{{< admonition type="warning" >}}
370377
This feature is an [experimental feature](/docs/release-life-cycle/). Engineering and on-call support is not available.
371378
No SLA is provided.
372379
{{< /admonition >}}
373380

374-
The Bloom Gateway service is responsible for handling and serving chunks filtering requests.
381+
The Bloom Gateway service is responsible for handling and serving chunks filtering requests.
375382
The index gateway queries the Bloom Gateway when computing chunk references, or when computing shards for a given query.
376-
The gateway service takes a list of chunks and a filtering expression and matches them against the blooms,
383+
The gateway service takes a list of chunks and a filtering expression and matches them against the blooms,
377384
filtering out any chunks that do not match the given label filter expression.
378385

379386
The service is horizontally scalable. When running multiple instances, the client (Index Gateway) shards requests

docs/sources/get-started/labels/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Loki automatically tries to populate a default `service_name` label while ingest
4444
- Grafana Cloud Application Observability
4545

4646
{{< admonition type="note" >}}
47-
If you are already applying a `service_name`, Loki will use that value.
47+
If you are already applying a `service_name`, Loki will use that value. For example, if you are using the Kubernetes monitoring Helm Chart, the Alloy configuration applies a `service_name` by default.
4848
{{< /admonition >}}
4949

5050
Loki will attempt to create the `service_name` label by looking for the following labels in this order:

docs/sources/operations/blocking-queries.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Block unwanted queries
3-
menuTitle: Unwanted queries
43
description: Describes how to configure Grafana Loki to block unwanted or expensive queries using per-tenant overrides.
54
weight:
65
---

docs/sources/operations/storage/compactor-horizontal-scaling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ compactor:
116116
To run Compactor in Worker mode, the Horizontal Scaling Mode needs to be set to "worker" and Main compactor's GRPC address needs to be set:
117117
```yaml
118118
common:
119-
compactor_grpc_address: <HOST>:<GRPC PORT>
119+
compactor_grpc_address: <HOST>:<GRPC_PORT>
120120
compactor:
121121
# CLI flag: -compactor.horizontal-scaling-mode="worker"
122122
horizontal_scaling_mode: "worker"

0 commit comments

Comments
 (0)