Compare commits

...
Author SHA1 Message Date
fauno 28a5091aed Merge branch 'main' into loki-tsdb 2026-10-30 10:54:08 -03:00
fauno 56caa14fcf chore(deps): update grafana/loki docker tag to v3.7.9 (#38)
Reviewed-on: #38
Reviewed-by: fauno <fauno@sutty.coop.ar>
2026-10-30 13:53:18 +00:00
fauno 5c65a257fc feat: improve loki debugging (#37)
Reviewed-on: #37
Reviewed-by: simon <135+simon@noreply.git.coopcloud.tech>
Reviewed-by: fauno <fauno@sutty.coop.ar>
2026-10-30 13:52:43 +00:00
dannygroenewegen e708e418ba feat: opt-in Loki index store migration from deprecated boltdb-shipper to TSDB
boltdb-shipper is deprecated and will be removed in Loki 4.0.
Setting LOKI_TSDB_FROM_DATE adds a second schema_config period (store:
tsdb) from that date onward, alongside the existing boltdb-shipper
period, so logs before the cutover stay queryable under the old store
while new logs are indexed with TSDB.
2026-10-29 12:44:30 +01:00
renovate-bot b508b13366 chore(deps): update grafana/loki docker tag to v3.7.9 2026-10-20 23:16:59 +00:00
5 changed files with 51 additions and 3 deletions
+6
View File
@@ -81,6 +81,12 @@ SECRET_BASIC_AUTH_VERSION=v1
# LOKI_RETENTION_PERIOD=744h
# LOKI_STORAGE_FILESYSTEM=1
#
# Opt in to migrating the deprecated boltdb-shipper index store to TSDB, from this date
# onward (YYYY-MM-DD). MUST be a FUTURE date, e.g. the day after you deploy this: a past
# or same-day date makes both stores claim that day's data, breaking queries for it.
# Logs from before this date are still ingested and queried from boltdb-shipper.
# LOKI_TSDB_FROM_DATE=2026-11-01
#
## S3 Storage
# LOKI_STORAGE_S3=1
# LOKI_AWS_ENDPOINT=https://minio.autonomic.zone
+12
View File
@@ -130,6 +130,18 @@ $ echo '{
$ systemctl restart docker.service
```
### Upgrading: Loki TSDB migration
Loki's index store defaults to `boltdb-shipper`, which is deprecated upstream in favour of
TSDB. To migrate an existing deployment without losing access to already-ingested logs, set
`LOKI_TSDB_FROM_DATE` in your `.env` (see `.env.sample`) to a date on or after the day after
your deploy, then `abra app deploy`. Logs from before that date stay on boltdb-shipper and
remain queryable as before; only logs from that date onward are indexed with TSDB.
**The date must be in the future when you deploy it, never today or earlier**: both stores share the same
per-day table, so a past or same-day date makes them collide over that day's data and
breaks querying it.
### Setup Push Gateway
1. Enable in the env file by uncommenting the following lines:
+2 -1
View File
@@ -2,7 +2,7 @@ version: '3.8'
services:
loki:
image: grafana/loki:3.7.2
image: grafana/loki:3.7.9
command: -config.file=/etc/loki/local-config.yaml
networks:
- proxy
@@ -23,6 +23,7 @@ services:
- STACK_NAME
- LOKI_STORAGE_FILESYSTEM
- LOKI_STORAGE_S3
- LOKI_TSDB_FROM_DATE
healthcheck:
test: ["CMD", "/usr/bin/loki", "-health"]
interval: 10s
+29 -1
View File
@@ -56,12 +56,26 @@ schema_config:
index:
prefix: index_
period: 24h
{{ if env "LOKI_TSDB_FROM_DATE" }}
- from: {{ env "LOKI_TSDB_FROM_DATE" }}
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
{{ end }}
storage_config:
boltdb_shipper:
active_index_directory: /loki/boltdb-shipper-active
cache_location: /loki/boltdb-shipper-cache
cache_ttl: 24h # Can be increased for faster performance over longer query periods, uses more disk space
{{ if env "LOKI_TSDB_FROM_DATE" }}
tsdb_shipper:
active_index_directory: /loki/tsdb-index
cache_location: /loki/tsdb-cache
{{ end }}
filesystem:
directory: /loki/chunks
{{ end }}
@@ -74,6 +88,15 @@ schema_config:
index:
prefix: index_
period: 24h
{{ if env "LOKI_TSDB_FROM_DATE" }}
- from: {{ env "LOKI_TSDB_FROM_DATE" }}
store: tsdb
object_store: aws
schema: v13
index:
prefix: index_
period: 24h
{{ end }}
storage_config:
boltdb_shipper:
@@ -81,6 +104,11 @@ storage_config:
cache_location: /loki/index_cache
resync_interval: 5s
shared_store: aws
{{ if env "LOKI_TSDB_FROM_DATE" }}
tsdb_shipper:
active_index_directory: /loki/tsdb-index
cache_location: /loki/tsdb-cache
{{ end }}
aws:
endpoint: {{ env "LOKI_AWS_ENDPOINT" }}
@@ -99,7 +127,7 @@ storage_config:
compactor:
working_directory: /loki/boltdb-shipper-compactor
working_directory: /loki/compactor
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
+2 -1
View File
@@ -1 +1,2 @@
- alloy and prometheus containers restart policy from on-failure to unless-stopped
- opt-in migration of Loki's index store from deprecated boltdb-shipper to TSDB via LOKI_TSDB_FROM_DATE
- alloy and prometheus containers restart policy from on-failure to unless-stopped