diff --git a/README.md b/README.md index 627a2b6d..d26bec90 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ Depending on which optional services you start: | API docs | http://localhost:8089/ | | Chessground | http://localhost:8090/demo.html | | PGN Viewer | http://localhost:8091/ | +| InfluxDB | http://localhost:8086/ | ## Usage diff --git a/command/src/main.rs b/command/src/main.rs index 252c0805..c0b316bb 100644 --- a/command/src/main.rs +++ b/command/src/main.rs @@ -327,6 +327,14 @@ fn prompt_for_optional_services() -> Result>, Error "Berserk", "Python API client", ) + .item( + OptionalService { + compose_profile: vec!["monitoring"].into(), + repositories: None, + }, + "Monitoring", + "Metric collection using InfluxDB", + ) .item( OptionalService { compose_profile: None, diff --git a/conf/lila-ws.conf b/conf/lila-ws.conf index 291d2b3f..3c828ec0 100644 --- a/conf/lila-ws.conf +++ b/conf/lila-ws.conf @@ -2,5 +2,6 @@ include "application" mongo.uri = "mongodb://mongodb:27017/lichess?appName=lila-ws" redis.uri = "redis://redis" +kamon.influxdb.hostname = "influxdb" csrf.origin = ${?SCHEME}"://"${?LILA_DOMAIN} diff --git a/conf/lila.conf b/conf/lila.conf index b8ccba1d..a7e2d681 100644 --- a/conf/lila.conf +++ b/conf/lila.conf @@ -32,6 +32,11 @@ swiss.bbpairing = "/opt/bbpPairings/bbpPairings.exe" prismic.api_url = "https://lichess.cdn.prismic.io/api" +kamon.enabled = true +kamon.influxdb.hostname = "influxdb" +kamon.influxdb.authentication.token = "secret" +# api.influx_event.endpoint = "http://influxdb:8086/write?db=events" + plan.stripe.keys.public = "pk_test_123" plan.stripe.keys.secret = "sk_test_123" plan.payPal.keys.public = "sb" diff --git a/docker-compose.yml b/docker-compose.yml index 477f11be..1c082e7c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -113,7 +113,8 @@ services: context: docker dockerfile: lila-fishnet.Dockerfile environment: - - HTTP_API_LOGGER=true + # - HTTP_API_LOGGER=true + - KAMON_ENABLED=true - REDIS_HOST=redis restart: unless-stopped networks: @@ -245,6 +246,23 @@ services: depends_on: - mongodb + influxdb: + image: influxdb:2.7.4-alpine + restart: unless-stopped + ports: + - 8086:8086 + environment: + - DOCKER_INFLUXDB_INIT_MODE=setup + - DOCKER_INFLUXDB_INIT_USERNAME=admin + - DOCKER_INFLUXDB_INIT_PASSWORD=password + - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=secret + - DOCKER_INFLUXDB_INIT_ORG=lila-docker + - DOCKER_INFLUXDB_INIT_BUCKET=kamon + networks: + - lila-network + profiles: + - monitoring + networks: lila-network: driver: bridge