diff --git a/.env.sample b/.env.sample index 9a4f13f..1fb4d18 100644 --- a/.env.sample +++ b/.env.sample @@ -13,6 +13,7 @@ SECRET_BASIC_AUTH_ADMIN_PASSWORD_VERSION=v1 # COMPOSE_FILE="$COMPOSE_FILE:compose.promtail.yml" # LOKI_PUSH_URL=https://loki.monitoring.example.org/loki/api/v1/push + ## Prometheus, Alertmanager # COMPOSE_FILE="$COMPOSE_FILE:compose.prometheus.yml" # ALERTMANAGER_SMTP_FROM=noreply@autonomic.zone diff --git a/README.md b/README.md index 68d0247..ab23e6f 100644 --- a/README.md +++ b/README.md @@ -84,11 +84,13 @@ abra app cp monitoring.dev.local-it.cloud gathering.org.yml prometheus:/promethe ### TODO * metrics.compose.yml -> compose.yml -* [ ] Loki - * [x] +* Grafana + * [ ] Test SSO +* Loki * [ ] s3 aws secret? + * [ ] understand config, make it sane * [ ] Promtail -* [ ] Loki -> Grafana Datasource + * [ ] make it work * prometheus retention! * traefik metrics * [uptime-kuma](https://github.com/louislam/uptime-kuma/wiki/Prometheus-Integration), [dashboard](https://grafana.com/grafana/dashboards/14847-uptime-kuma/) diff --git a/compose.loki.yml b/compose.loki.yml index 47fc9f4..8ca6646 100644 --- a/compose.loki.yml +++ b/compose.loki.yml @@ -27,7 +27,7 @@ services: condition: on-failure labels: - "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.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}-loki.tls=true" diff --git a/compose.yml b/compose.yml index db10f7b..ef8b722 100644 --- a/compose.yml +++ b/compose.yml @@ -6,6 +6,7 @@ services: image: debian:stable-slim entrypoint: "/bin/tail -f /dev/null" + networks: proxy: external: true diff --git a/loki.yml.tmpl b/loki.yml.tmpl index 360d988..679dabe 100644 --- a/loki.yml.tmpl +++ b/loki.yml.tmpl @@ -23,13 +23,18 @@ distributor: ingester: lifecycler: + address: 127.0.0.1 ring: kvstore: - store: memberlist + store: inmemory replication_factor: 1 final_sleep: 0s - chunk_idle_period: 5m - chunk_retain_period: 30s + chunk_idle_period: 1h # Any chunk not receiving new logs in this time will be flushed + 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: abort_if_cluster_join_fails: false @@ -43,18 +48,20 @@ memberlist: {{ if eq (env "LOKI_STORAGE_FILESYSTEM") "1" }} schema_config: configs: - - from: 2020-05-15 - store: boltdb - object_store: filesystem - schema: v11 - index: - prefix: index_ - period: 168h + - from: 2020-10-24 + store: boltdb-shipper + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 24h storage_config: - boltdb: - directory: /loki/index - + 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 + shared_store: filesystem filesystem: directory: /loki/chunks {{ end }} @@ -92,7 +99,18 @@ storage_config: {{ end }} +compactor: + working_directory: /loki/boltdb-shipper-compactor + shared_store: filesystem + 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 \ No newline at end of file