using environment variables

This commit is contained in:
root
2023-11-20 21:25:54 -06:00
parent 739fb64a42
commit 3801944fac
4 changed files with 18 additions and 5 deletions

View File

@@ -1,2 +1,10 @@
# docker-observation
Various tools to monitor Docker containers
## Environment Variables
- `DOCKER_INFLUXDB_INIT_ORG`
- `INFLUX_WRITE_TOKEN`
- `INFLUX_HOST`
- `LOKI_HOST`

View File

@@ -13,8 +13,13 @@ services:
promtail:
image: grafana/promtail
restart: unless-stopped
env_file:
- .env
volumes:
- ./promtail:/etc/promtail
- /var/run/docker.sock:/var/run/docker.sock
- /var/log:/var/log:ro
command: -config.file=/etc/promtail/promtail-config.yml
command: [
"-config.file=/etc/promtail/promtail-config.yml",
"-config.expand-env=true"
]

View File

@@ -6,7 +6,7 @@ positions:
filename: /tmp/positions.yaml
clients:
- url: http://loki:3100/loki/api/v1/push
- url: http://${LOKI_HOST}:3100/loki/api/v1/push
scrape_configs:
- job_name: flog_scrape
@@ -19,5 +19,5 @@ scrape_configs:
target_label: 'container'
- source_labels: ['__meta_docker_container_log_stream']
target_label: 'logstream'
# - target_label: 'host'
# replacement: 'docker-lxc'
- target_label: 'host'
replacement: '${HOSTNAME}'

View File

@@ -80,7 +80,7 @@
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
urls = ["http://influxdb:8086"]
urls = ["http://${INFLUX_HOST}:8086"]
## Token for authentication.
token = "$INFLUX_WRITE_TOKEN"