using environment variables
This commit is contained in:
@@ -1,2 +1,10 @@
|
|||||||
# docker-observation
|
# docker-observation
|
||||||
|
|
||||||
Various tools to monitor Docker containers
|
Various tools to monitor Docker containers
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
|
||||||
|
- `DOCKER_INFLUXDB_INIT_ORG`
|
||||||
|
- `INFLUX_WRITE_TOKEN`
|
||||||
|
- `INFLUX_HOST`
|
||||||
|
- `LOKI_HOST`
|
||||||
|
|||||||
@@ -13,8 +13,13 @@ services:
|
|||||||
promtail:
|
promtail:
|
||||||
image: grafana/promtail
|
image: grafana/promtail
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
volumes:
|
volumes:
|
||||||
- ./promtail:/etc/promtail
|
- ./promtail:/etc/promtail
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
- /var/log:/var/log:ro
|
- /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"
|
||||||
|
]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ positions:
|
|||||||
filename: /tmp/positions.yaml
|
filename: /tmp/positions.yaml
|
||||||
|
|
||||||
clients:
|
clients:
|
||||||
- url: http://loki:3100/loki/api/v1/push
|
- url: http://${LOKI_HOST}:3100/loki/api/v1/push
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: flog_scrape
|
- job_name: flog_scrape
|
||||||
@@ -19,5 +19,5 @@ scrape_configs:
|
|||||||
target_label: 'container'
|
target_label: 'container'
|
||||||
- source_labels: ['__meta_docker_container_log_stream']
|
- source_labels: ['__meta_docker_container_log_stream']
|
||||||
target_label: 'logstream'
|
target_label: 'logstream'
|
||||||
# - target_label: 'host'
|
- target_label: 'host'
|
||||||
# replacement: 'docker-lxc'
|
replacement: '${HOSTNAME}'
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
## Multiple URLs can be specified for a single cluster, only ONE of the
|
## Multiple URLs can be specified for a single cluster, only ONE of the
|
||||||
## urls will be written to each interval.
|
## urls will be written to each interval.
|
||||||
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
|
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
|
||||||
urls = ["http://influxdb:8086"]
|
urls = ["http://${INFLUX_HOST}:8086"]
|
||||||
|
|
||||||
## Token for authentication.
|
## Token for authentication.
|
||||||
token = "$INFLUX_WRITE_TOKEN"
|
token = "$INFLUX_WRITE_TOKEN"
|
||||||
|
|||||||
Reference in New Issue
Block a user