Skip to content

Commit

Permalink
adding a config file for influxdb container.
Browse files Browse the repository at this point in the history
INFLUXDB_GRAPHITE_TEMPLATES expects multiple templates to be separated by ',' (see influxdata/influxdb#7323),
in the same time ',' is used to separate multiple additional tags for a single template (see https://docs.influxdata.com/influxdb/v1.8/supported_protocols/graphite/#adding-tags)
So unfortunately it's impossible to configure a template with multiple additional tags thru INFLUXDB_GRAPHITE_TEMPLATES env variable,
and providing a config file with templates is the only available option for this.

in order to check the whole influxdb config (including default values) you should start docker-compose setup and attach to the
influxdb container (note that execution of docker compose commands is done in the metrics directory):
    cd metrics
    docker compose up -d
    docker compose exec influxdb bash

then you can run this command in the influxdb container's shell:
    influxd config

the default configuration file for influxdb container is located at '/etc/influxdb/influxdb.conf', you can print its content or check
how the whole configuration looks like with it using these commands:
    cat /etc/influxdb/influxdb.conf
    INFLUXDB_CONFIG_PATH=/etc/influxdb/influxdb.conf influxd config
  • Loading branch information
DenysGonchar committed Sep 17, 2021
1 parent 7751742 commit 5d3a5be
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ _build
rebar3.crashdump
*~
rebar3
metrics/influxdb_data
11 changes: 9 additions & 2 deletions metrics/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ services:
- "2003:2003"
networks:
- metrics-network
volumes:
- type: "bind"
source: "./influxdb_data"
target: "/influxdb"
- type: "bind"
source: "./influxdb.conf"
target: "/influxdb.conf"
read_only: true
environment:
INFLUXDB_GRAPHITE_ENABLED: "true"
INFLUXDB_GRAPHITE_TEMPLATES: 'instance.measurement*'
INFLUXDB_CONFIG_PATH: "/influxdb.conf"
grafana:
image: "grafana/grafana:6.7.3"
ports:
Expand Down
10 changes: 10 additions & 0 deletions metrics/influxdb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[meta]
dir = "/influxdb/meta"

[data]
dir = "/influxdb/data"
wal-dir = "/influxdb/wal"

[[graphite]]
enabled = true
templates = ["instance.measurement*"]

0 comments on commit 5d3a5be

Please sign in to comment.