Update loki to 3.0.0 and switch to tsdb

This commit is contained in:
Daniel Berteaud 2024-04-08 22:44:10 +02:00
parent 1d0d6e07b1
commit 511470492c
5 changed files with 23 additions and 25 deletions

View File

@ -1,6 +1,6 @@
FROM danielberteaud/alpine:24.4-1 AS builder FROM danielberteaud/alpine:24.4-1 AS builder
ARG LOKI_VERSION=2.9.6 ARG LOKI_VERSION=3.0.0
ADD https://github.com/grafana/loki/releases/download/v${LOKI_VERSION}/loki-linux-amd64.zip /tmp ADD https://github.com/grafana/loki/releases/download/v${LOKI_VERSION}/loki-linux-amd64.zip /tmp
ADD https://github.com/grafana/loki/releases/download/v${LOKI_VERSION}/SHA256SUMS /tmp ADD https://github.com/grafana/loki/releases/download/v${LOKI_VERSION}/SHA256SUMS /tmp

View File

@ -31,10 +31,12 @@ job "monitoring-agent" {
} }
volume "data" { volume "data" {
source = "vector_data" source = "vector_data"
type = "host" type = "host"
} }
volume "nomad" { volume "nomad" {
source = "nomad_alloc" source = "nomad_alloc"
type = "host" type = "host"
@ -432,6 +434,7 @@ _EOT
} }
volume "host" { volume "host" {
source = "host_root" source = "host_root"
type = "host" type = "host"

View File

@ -19,6 +19,7 @@ job "monitoring-services" {
} }
volume "data" { volume "data" {
source = "prometheus-data" source = "prometheus-data"
type = "csi" type = "csi"
@ -1474,6 +1475,7 @@ _EOT
} }
volume "data" { volume "data" {
source = "alertmanager-data" source = "alertmanager-data"
type = "csi" type = "csi"
@ -1857,6 +1859,7 @@ _EOT
} }
volume "data" { volume "data" {
source = "loki-data" source = "loki-data"
type = "csi" type = "csi"
@ -2013,7 +2016,7 @@ _EOT
driver = "docker" driver = "docker"
config { config {
image = "danielberteaud/loki:2.9.6-1" image = "danielberteaud/loki:3.0.0-1"
command = "loki" command = "loki"
args = ["--config.file=/local/loki.yml"] args = ["--config.file=/local/loki.yml"]
} }
@ -2058,9 +2061,8 @@ common:
rules_directory: /data/rules rules_directory: /data/rules
compactor: compactor:
compaction_interval: 1h compaction_interval: 1h
deletion_mode: filter-and-delete delete_request_store: filesystem
retention_enabled: true retention_enabled: true
shared_store: filesystem
working_directory: /data/compactor working_directory: /data/compactor
ingester: ingester:
chunk_idle_period: 1h chunk_idle_period: 1h
@ -2081,9 +2083,6 @@ ruler:
enable_alertmanager_discovery: true enable_alertmanager_discovery: true
enable_alertmanager_v2: true enable_alertmanager_v2: true
enable_api: true enable_api: true
ring:
kvstore:
store: inmemory
rule_path: /tmp/loki-rules rule_path: /tmp/loki-rules
storage: storage:
local: local:
@ -2096,18 +2095,17 @@ schema_config:
period: 24h period: 24h
prefix: index_ prefix: index_
object_store: filesystem object_store: filesystem
schema: v11 schema: v13
store: boltdb-shipper store: tsdb
server: server:
grpc_listen_address: 127.0.0.1 grpc_listen_address: 127.0.0.1
grpc_listen_port: 9095 grpc_listen_port: 9095
http_listen_address: 127.0.0.1 http_listen_address: 127.0.0.1
http_listen_port: 3100 http_listen_port: 3100
storage_config: storage_config:
boltdb_shipper: tsdb_shipper:
active_index_directory: /data/index active_index_directory: /data/tsdb-index
cache_location: /data/boltdb-cache cache_location: /data/tsdb-cache
shared_store: filesystem
_EOT _EOT
destination = "local/loki.yml" destination = "local/loki.yml"
@ -2383,6 +2381,7 @@ _EOT
} }
volume "data" { volume "data" {
source = "grafana-data" source = "grafana-data"
type = "csi" type = "csi"

View File

@ -20,27 +20,26 @@ common:
store: inmemory store: inmemory
storage_config: storage_config:
boltdb_shipper: tsdb_shipper:
active_index_directory: /data/index active_index_directory: /data/tsdb-index
cache_location: /data/boltdb-cache cache_location: /data/tsdb-cache
shared_store: filesystem
schema_config: schema_config:
configs: configs:
- from: '2020-10-24' - from: '2020-10-24'
store: boltdb-shipper store: tsdb
object_store: filesystem object_store: filesystem
schema: v11 schema: v13
index: index:
prefix: index_ prefix: index_
period: 24h period: 24h
compactor: compactor:
working_directory: /data/compactor working_directory: /data/compactor
shared_store: filesystem #shared_store: filesystem
delete_request_store: filesystem
compaction_interval: 1h compaction_interval: 1h
retention_enabled: true retention_enabled: true
deletion_mode: filter-and-delete
ingester: ingester:
chunk_idle_period: 1h chunk_idle_period: 1h
@ -68,9 +67,6 @@ ruler:
type: local type: local
local: local:
directory: /local/rules directory: /local/rules
ring:
kvstore:
store: inmemory
analytics: analytics:
reporting_enabled: false reporting_enabled: false

View File

@ -241,7 +241,7 @@ monitoring:
# Loki is the log server # Loki is the log server
loki: loki:
# Version of loki # Version of loki
version: 2.9.6 version: 3.0.0
# Docker image to use # Docker image to use
image: '[[ .docker.repo ]]loki:[[ .monitoring.loki.version ]]-1' image: '[[ .docker.repo ]]loki:[[ .monitoring.loki.version ]]-1'
# Custom env to set in the container # Custom env to set in the container