Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
085992dab0
|
||
|
|
40d31a535f
|
||
|
|
6db3afa97c
|
||
|
|
f130a61bd2 | ||
|
|
7d7060c308
|
||
|
|
d3cc5977db | ||
|
|
05b5b3d742 | ||
|
|
09dd411989 | ||
|
|
28a5091aed
|
||
|
|
56caa14fcf | ||
|
|
5c65a257fc | ||
|
|
6ec83806e1 | ||
|
|
e708e418ba
|
||
|
|
d6f5e7ebf6 | ||
|
|
b508b13366 |
@@ -81,6 +81,12 @@ SECRET_BASIC_AUTH_VERSION=v1
|
|||||||
# LOKI_RETENTION_PERIOD=744h
|
# LOKI_RETENTION_PERIOD=744h
|
||||||
# LOKI_STORAGE_FILESYSTEM=1
|
# 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
|
## S3 Storage
|
||||||
# LOKI_STORAGE_S3=1
|
# LOKI_STORAGE_S3=1
|
||||||
# LOKI_AWS_ENDPOINT=https://minio.autonomic.zone
|
# LOKI_AWS_ENDPOINT=https://minio.autonomic.zone
|
||||||
|
|||||||
@@ -130,6 +130,18 @@ $ echo '{
|
|||||||
$ systemctl restart docker.service
|
$ 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
|
### Setup Push Gateway
|
||||||
|
|
||||||
1. Enable in the env file by uncommenting the following lines:
|
1. Enable in the env file by uncommenting the following lines:
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
grafana:
|
grafana:
|
||||||
image: grafana/grafana:13.2.3
|
image: grafana/grafana:13.3.0
|
||||||
volumes:
|
volumes:
|
||||||
- grafana-data:/var/lib/grafana:rw
|
- grafana-data:/var/lib/grafana:rw
|
||||||
secrets:
|
secrets:
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,7 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
loki:
|
loki:
|
||||||
image: grafana/loki:3.7.2
|
image: grafana/loki:3.7.9
|
||||||
command: -config.file=/etc/loki/local-config.yaml
|
command: -config.file=/etc/loki/local-config.yaml
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
@@ -23,6 +23,7 @@ services:
|
|||||||
- STACK_NAME
|
- STACK_NAME
|
||||||
- LOKI_STORAGE_FILESYSTEM
|
- LOKI_STORAGE_FILESYSTEM
|
||||||
- LOKI_STORAGE_S3
|
- LOKI_STORAGE_S3
|
||||||
|
- LOKI_TSDB_FROM_DATE
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "/usr/bin/loki", "-health"]
|
test: ["CMD", "/usr/bin/loki", "-health"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ services:
|
|||||||
start_period: 30s
|
start_period: 30s
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: unless-stopped
|
condition: any
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.swarm.network=proxy"
|
- "traefik.swarm.network=proxy"
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ services:
|
|||||||
image: "prometheuscommunity/smartctl-exporter:v0.15.0"
|
image: "prometheuscommunity/smartctl-exporter:v0.15.0"
|
||||||
volumes:
|
volumes:
|
||||||
- "/var/lib/smartmontools/json:/debug"
|
- "/var/lib/smartmontools/json:/debug"
|
||||||
|
- "/dev:/dev:ro"
|
||||||
command:
|
command:
|
||||||
- "--smartctl.fake-data"
|
- "--smartctl.fake-data"
|
||||||
- "--smartctl.interval=1h"
|
|
||||||
networks:
|
networks:
|
||||||
- "proxy"
|
- "proxy"
|
||||||
deploy:
|
deploy:
|
||||||
|
|||||||
+3
-3
@@ -3,7 +3,7 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: grafana/alloy:v1.20.1
|
image: grafana/alloy:v1.21.3
|
||||||
hostname: "${DOMAIN}"
|
hostname: "${DOMAIN}"
|
||||||
configs:
|
configs:
|
||||||
- source: config_alloy
|
- source: config_alloy
|
||||||
@@ -50,10 +50,10 @@ services:
|
|||||||
start_period: 30s
|
start_period: 30s
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: unless-stopped
|
condition: any
|
||||||
labels:
|
labels:
|
||||||
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=2.3.0+v1.20.1"
|
- "coop-cloud.${STACK_NAME}.version=2.3.0+v1.21.3"
|
||||||
configs:
|
configs:
|
||||||
config_alloy:
|
config_alloy:
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
|
|||||||
+29
-1
@@ -56,12 +56,26 @@ schema_config:
|
|||||||
index:
|
index:
|
||||||
prefix: index_
|
prefix: index_
|
||||||
period: 24h
|
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:
|
storage_config:
|
||||||
boltdb_shipper:
|
boltdb_shipper:
|
||||||
active_index_directory: /loki/boltdb-shipper-active
|
active_index_directory: /loki/boltdb-shipper-active
|
||||||
cache_location: /loki/boltdb-shipper-cache
|
cache_location: /loki/boltdb-shipper-cache
|
||||||
cache_ttl: 24h # Can be increased for faster performance over longer query periods, uses more disk space
|
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:
|
filesystem:
|
||||||
directory: /loki/chunks
|
directory: /loki/chunks
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -74,6 +88,15 @@ schema_config:
|
|||||||
index:
|
index:
|
||||||
prefix: index_
|
prefix: index_
|
||||||
period: 24h
|
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:
|
storage_config:
|
||||||
boltdb_shipper:
|
boltdb_shipper:
|
||||||
@@ -81,6 +104,11 @@ storage_config:
|
|||||||
cache_location: /loki/index_cache
|
cache_location: /loki/index_cache
|
||||||
resync_interval: 5s
|
resync_interval: 5s
|
||||||
shared_store: aws
|
shared_store: aws
|
||||||
|
{{ if env "LOKI_TSDB_FROM_DATE" }}
|
||||||
|
tsdb_shipper:
|
||||||
|
active_index_directory: /loki/tsdb-index
|
||||||
|
cache_location: /loki/tsdb-cache
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
aws:
|
aws:
|
||||||
endpoint: {{ env "LOKI_AWS_ENDPOINT" }}
|
endpoint: {{ env "LOKI_AWS_ENDPOINT" }}
|
||||||
@@ -99,7 +127,7 @@ storage_config:
|
|||||||
|
|
||||||
|
|
||||||
compactor:
|
compactor:
|
||||||
working_directory: /loki/boltdb-shipper-compactor
|
working_directory: /loki/compactor
|
||||||
compaction_interval: 10m
|
compaction_interval: 10m
|
||||||
retention_enabled: true
|
retention_enabled: true
|
||||||
retention_delete_delay: 2h
|
retention_delete_delay: 2h
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
- 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 any
|
||||||
@@ -1 +0,0 @@
|
|||||||
- alloy and prometheus containers restart policy from on-failure to unless-stopped
|
|
||||||
Reference in New Issue
Block a user