loki works

This commit is contained in:
Philipp Rothmann 2023-02-14 12:38:12 +01:00
parent cc8a0b2905
commit 49a4d6ab17
5 changed files with 39 additions and 17 deletions

View File

@ -13,6 +13,7 @@ SECRET_BASIC_AUTH_ADMIN_PASSWORD_VERSION=v1
# COMPOSE_FILE="$COMPOSE_FILE:compose.promtail.yml" # COMPOSE_FILE="$COMPOSE_FILE:compose.promtail.yml"
# LOKI_PUSH_URL=https://loki.monitoring.example.org/loki/api/v1/push # LOKI_PUSH_URL=https://loki.monitoring.example.org/loki/api/v1/push
## Prometheus, Alertmanager ## Prometheus, Alertmanager
# COMPOSE_FILE="$COMPOSE_FILE:compose.prometheus.yml" # COMPOSE_FILE="$COMPOSE_FILE:compose.prometheus.yml"
# ALERTMANAGER_SMTP_FROM=noreply@autonomic.zone # ALERTMANAGER_SMTP_FROM=noreply@autonomic.zone

View File

@ -84,11 +84,13 @@ abra app cp monitoring.dev.local-it.cloud gathering.org.yml prometheus:/promethe
### TODO ### TODO
* metrics.compose.yml -> compose.yml * metrics.compose.yml -> compose.yml
* [ ] Loki * Grafana
* [x] * [ ] Test SSO
* Loki
* [ ] s3 aws secret? * [ ] s3 aws secret?
* [ ] understand config, make it sane
* [ ] Promtail * [ ] Promtail
* [ ] Loki -> Grafana Datasource * [ ] make it work
* prometheus retention! * prometheus retention!
* traefik metrics * traefik metrics
* [uptime-kuma](https://github.com/louislam/uptime-kuma/wiki/Prometheus-Integration), [dashboard](https://grafana.com/grafana/dashboards/14847-uptime-kuma/) * [uptime-kuma](https://github.com/louislam/uptime-kuma/wiki/Prometheus-Integration), [dashboard](https://grafana.com/grafana/dashboards/14847-uptime-kuma/)

View File

@ -27,7 +27,7 @@ services:
condition: on-failure condition: on-failure
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}_loki.loadbalancer.server.port=9090" - "traefik.http.services.${STACK_NAME}_loki.loadbalancer.server.port=3100"
- "traefik.http.routers.${STACK_NAME}-loki.rule=Host(`loki.${DOMAIN}`)" - "traefik.http.routers.${STACK_NAME}-loki.rule=Host(`loki.${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-loki.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}-loki.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-loki.tls=true" - "traefik.http.routers.${STACK_NAME}-loki.tls=true"

View File

@ -6,6 +6,7 @@ services:
image: debian:stable-slim image: debian:stable-slim
entrypoint: "/bin/tail -f /dev/null" entrypoint: "/bin/tail -f /dev/null"
networks: networks:
proxy: proxy:
external: true external: true

View File

@ -23,13 +23,18 @@ distributor:
ingester: ingester:
lifecycler: lifecycler:
address: 127.0.0.1
ring: ring:
kvstore: kvstore:
store: memberlist store: inmemory
replication_factor: 1 replication_factor: 1
final_sleep: 0s final_sleep: 0s
chunk_idle_period: 5m chunk_idle_period: 1h # Any chunk not receiving new logs in this time will be flushed
chunk_retain_period: 30s max_chunk_age: 1h # All chunks will be flushed when they hit this age, default is 1h
chunk_target_size: 1048576 # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first
chunk_retain_period: 30s # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)
max_transfer_retries: 0 # Chunk transfers disabled
memberlist: memberlist:
abort_if_cluster_join_fails: false abort_if_cluster_join_fails: false
@ -43,18 +48,20 @@ memberlist:
{{ if eq (env "LOKI_STORAGE_FILESYSTEM") "1" }} {{ if eq (env "LOKI_STORAGE_FILESYSTEM") "1" }}
schema_config: schema_config:
configs: configs:
- from: 2020-05-15 - from: 2020-10-24
store: boltdb store: boltdb-shipper
object_store: filesystem object_store: filesystem
schema: v11 schema: v11
index: index:
prefix: index_ prefix: index_
period: 168h period: 24h
storage_config: storage_config:
boltdb: boltdb_shipper:
directory: /loki/index 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
shared_store: filesystem
filesystem: filesystem:
directory: /loki/chunks directory: /loki/chunks
{{ end }} {{ end }}
@ -92,7 +99,18 @@ storage_config:
{{ end }} {{ end }}
compactor:
working_directory: /loki/boltdb-shipper-compactor
shared_store: filesystem
limits_config: limits_config:
enforce_metric_name: false enforce_metric_name: false
reject_old_samples: true reject_old_samples: true
reject_old_samples_max_age: 168h reject_old_samples_max_age: 168h
chunk_store_config:
max_look_back_period: 0s
table_manager:
retention_deletes_enabled: false
retention_period: 0s