Hello,
I have influxdb 2 and telegraf up and running as docker containers. Telegraf has its own configuration. It works okay, meaning it writes data to influxdb 2 local instance using output plugin . When I enter http://localhost:8086/orgs/{org_number}/load-data/telegrafs I don’t see that telegraf config but I would like to be able to see it there. Is it possible at all?
Second question, partially related. I would like to be able to edit the existing telegraf config. I know that there is this GetTelegrafsApi
on the Influx Client in C# and it works properly, meaning I was able to create a config with this Api and see it under http://localhost:8086/orgs/{org_number}/load-data/telegrafs. But does this new config get copied to the running telegraf instance? Which telegraf agent does pick these configs that are created from GetTelegrafsApi
? A new one runing in the influxdb 2 container?
You can see the telegraf configuration in the web interface. You can do what Telegraf does and download the config using your auth token and something like curl or wget.
But does this new config get copied to the running telegraf instance?
No, not until you restart telegraf.
Which telegraf agent does pick these configs that are created from
GetTelegrafsApi
? A new one runing in the influxdb 2 container?
Not sure I understand the questions here.
Hi @jpowers,
thanks for your answers! Still few things are unclear to me.
You can see the telegraf configuration in the web interface
Hm, I used telegraf.conf which I mounted to the telegraf docker container, then I opened InfluxDB UI and I can’t see the config from telegraf.conf there. Probably I did something wrong?
No, not until you restart telegraf.
Okay, let me rephrase to ensure I understood it completely:
Each time I change something in the telegraf config programatically (through let’s say InfluxDB C# client) I need to restart telegraf to get this new config applied?
This is my setup:
Which telegraf agent does pick these configs that are created from
GetTelegrafsApi
? A new one runing in the influxdb 2 container?
I mean the situation like:
- I have InfluxDB docker container running
- I have telegraf docker container running with telegraf.conf mounted
- I used Telegraf C# API to update already existing telegraf config
- Will the telegraf docker container pick up this updated config? Or there is a local telegraf agent running as linux proces inside the InfluxDB container?
- Will the telegraf container update the initial telegraf.conf not to loose the config created with the REST API?
Thanks in advance for your answers
Telegraf has no way to know that the config was updated. You need to restart telegraf to fetch the config again.
- Will the telegraf container update the initial telegraf.conf not to loose the config created with the REST API?
Telegraf has no write access to the remote config. It only does a GET to download the config.