I am using InfluxDB v2.3 and within Telegraf section I have created a configuration and selected ‘System’. After this config was running and exposed all ‘System’ metrics I can see that within the metrics I am unable to see the data I have stored in the DB.
In order for InfluxDB to get the metrics Telegraf is collecting, users generally use the InfluxDB_v2 output plugin. This is what sends metrics directly to InfluxDB, which you can then view in whatever tools you want.
It might help to see your config to understand the flow of things better as well.
Thanks for getting back. however, what I would like to achieve is the opposite. I do not want to send the data to Influx, but the contrary. I already have data in the InfluxDB v2.3. Example data is in line protocol;
What I would like is to expose this data as a metric to show on Prometheus to configure further alerts from there. So far I have managed to expose metrics with the link I provided above, however the metrics do not include the actual data within the database. Is what I am looking a possibility since usually the flow is the other way round, from Prometheus to Influx?
I have reviewed the plugin you mentioned and visually it seems like it does the job. However I am running into some issues when trying to implement it. Below is my telegraf.conf;
[[outputs.influxdb_v2]]
## The URLs of the InfluxDB cluster nodes.
##
## 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://x.x.x.x:8086"]
## API token for authentication.
token = "2MT9KHzN0-H.....bv1TwaY7w=="
## Organization is the name of the organization you wish to write to; must exist.
organization = "company_name"
## Destination bucket to write into.
bucket = "cf_influx_import"
#### EXEC PLUGIN:
[[inputs.exec]]
command = ["cat /var/tmp/cf_data/cf_influx_import.txt"]
#command = ["/var/tmp/cf_data/script.sh"]
data_format = "prometheus"
I have a script “script.sh” that is getting JSON data from Cloudflare and converting it to line protocol. The converted line protocol is in a text file “cf_influx_import.txt”. This is the data that is being fed into InfluxDB v2.3.
I have tried with both [“cat /var/tmp/cf_data/cf_influx_import.txt”] and [“/var/tmp/cf_data/script.sh”] but when I run the telegraf --config command from setup instructions I am facing the following error: