Healthcheck for `Loki`.

This commit is contained in:
Kazuhiro MUSASHI 2020-10-17 14:41:02 +09:00
parent 654a98b3ce
commit 25a17917f5
4 changed files with 65 additions and 8 deletions

View File

@ -1,6 +0,0 @@
{
"service": {
"name": "loki",
"port": 3100
}
}

View File

@ -8,10 +8,14 @@
end
# Deploy `prometheus` files:
remote_file '/etc/loki/loki-config.yml' do
template '/etc/loki/loki-config.yml' do
owner 'root'
group 'root'
mode '644'
variables(ipaddr: node['consul']['ipaddr'])
notifies :restart, 'service[loki]'
end
# Deploy `systemd` configuration for `prometheus`:
@ -27,11 +31,13 @@ service 'loki' do
end
# Depoy `consul` service configuration for `loki`:
remote_file '/etc/consul.d/service-loki.json' do
template '/etc/consul.d/service-loki.json' do
owner 'root'
group 'root'
mode '644'
variables(ipaddr: node['consul']['ipaddr'])
notifies :restart, 'service[supervisor]'
end

View File

@ -0,0 +1,12 @@
{
"service": {
"name": "loki",
"port": 3100,
"check":{
"tcp": "<%= @ipaddr %>:3100",
"interval": "60s",
"timeout": "1s",
"success_before_passing": 3
}
}
}

View File

@ -0,0 +1,45 @@
auth_enabled: false
server:
http_listen_port: 3100
ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 5m
chunk_retain_period: 30s
max_transfer_retries: 0
schema_config:
configs:
- from: 2018-04-15
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 168h
storage_config:
boltdb:
directory: /var/opt/loki/index
filesystem:
directory: /var/opt/loki/chunks
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
chunk_store_config:
max_look_back_period: 0s
table_manager:
retention_deletes_enabled: false
retention_period: 0s