shantanoo-desai / komponist

A Composer for your favorite IoT/ IIoT container stacks with Ansible + Jinja2 + Docker Compose v2
GNU Affero General Public License v3.0
25 stars 2 forks source link

[telegraf] Configure and Setup Telegraf v1.x #47

Closed shantanoo-desai closed 1 year ago

shantanoo-desai commented 1 year ago

Description

Introduce InfluxData telegraf v1.x to Komponist. With the new feature patch for Docker Secrets, it is now possible to use Docker Secrets mounted into a Telegraf container and use the secretsstore plugin for credentials access to other services in Komponist.

The values can be merged into the generated .env which will be picked up by core docker-compose.yml file.

flowchart LR
T[Telegraf] -->| outputs.influxdb | Iv1[InfluxDBv1]
T -->| outputs.influxdbv2 | Iv2[InfluxDBv2]
T --> | outputs.socket_writer | QDB[QuestDB]
MQTT[MQTT broker] -->| inputs.mqtt_consumer | T

Tasks

shantanoo-desai commented 1 year ago

Update

Introduction of telegraf will occur when 1.27.x releases in June

shantanoo-desai commented 1 year ago

Plugins

Some requirements on configuring Telegraf Plugins are described as follows:

Input Plugins

mqtt_consumer

Configuration Key Values in TOML File Related Env Var in .env
servers tcp://komponist_mosquitto:1883 N/A
topics Default values in conf/creds.yml N/A
username "@{komponist_secretstore:mqtt_username}" TELEGRAF_MQTT_USERNAME
password "@{komponist_secretstore:mqtt_password}" TELEGRAF_MQTT_USERNAME
data_format influx N/A

Output Plugins

influxdb

Configuration Key Values in TOML File Related Env Var in .env
urls http://komponist_influxdbv1:8086 N/A
database "{{ credentials.influxdbv1.init_database }}" INFLUXDB_DB
username "@{komponist_secretstore:influxdb_user}" INFLUXDB_USER
INFLUXDB_READ_USER
INFLUXDB_WRITE_USER
password "@{komponist_secretstore:influxdb_user_password}" INFLUXDB_USER_PASSWORD
INFLUXDB_READ_PASSWORD
INFLUXDB_WRITE_PASSWORD

influxdb_v2

Configuration Key Values in TOML File Related Env Var in .env
urls http://komponist_influxdbv2:8087 N/A
token "@{komponist_secretstore:influxdbv2_admin_token}" DOCKER_INFLUXDB_INIT_ADMIN_TOKEN
organization "{{ credentials.influxdbv2.init_org }}" DOCKER_INFLUXDB_INIT_ORG
bucket "{{ credentials.influxdbv2.init_bucket }}" DOCKER_INFLUXDB_INIT_BUCKET

socket_writer

For questdb

Configuration Key Values in TOML File Related Env Var in .env
urls tcp://komponist_questdb:9009 N/A