So far I have InfluxDB V1 and Grafana running in docker compose. I have Telegraf running on bare metal feeding data into the Influx container about the system and the docker environment.
My dilemma is as follows: I want to use InfluxDB Listener plugin to listen for metrics coming from a remote server across the internet.
Apparently I have to bind this listener to a port. This is where I’m lost. Currently my other exposed services are reverse proxied by a Traefik container. It intercepts requests to my server and routes them to the appropriate docker container.
My question is: how can I get it to route to Telegraf if it is running on bare metal? I am trying to keep my configuration as simple as possible, so adding ANOTHER network layer to reverse proxy telegraf seems a bit much.
Ideally to simplify things I could run telegraf in a docker container as well. I have yet to find a working example that allows me to monitor the docker environment as well as the host filesystem. Any info on that would be greatly appreciated, as I can reverse proxy and deploy the services with docker.
Telegraf config:
# OUTPUTS
[[outputs.influxdb]]
url = "http://10.1.10.151:8086" # required.
database = "telegraf" # required.
precision = "s"
# INPUTS
[[inputs.docker]]
endpoint = "unix:///var/run/docker.sock"
container_names = []
timeout = "5s"
perdevice = true
## Whether to report for each container total blkio and network stats or not
total = false
## docker labels to include and exclude as tags. Globs accepted.
## Note that an empty array for both will include all labels as tags
docker_label_include = []
docker_label_exclude = []
[[inputs.docker_log]]
# Docker Endpoint
# To use TCP, set endpoint = "tcp://[ip]:[port]"
# To use environment variables (ie, docker-machine), set endpoint = "ENV"
endpoint = "unix:///var/run/docker.sock"
[[inputs.cpu]]
percpu = true
totalcpu = true
# filter all fields beginning with 'time_'
fielddrop = ["time_*"]
[[inputs.disk]]
[inputs.disk.tagpass]
# tagpass conditions are OR, not AND.
# If the (filesystem is ext4 or xfs) OR (the path is /opt or /home)
# then the metric passes
fstype = [ "ext4", "xfs" ]
# Globs can also be used on the tag values
path = [ "/opt", "/home*" ]
[[inputs.diskio]]
[[inputs.kernel]]
[[inputs.net]]
[[inputs.netstat]]
# Collect response time of a TCP or UDP connection
[[inputs.net_response]]
## Protocol, must be "tcp" or "udp"
## NOTE: because the "udp" protocol does not respond to requests, it requires
## a send/expect string pair (see below).
protocol = "tcp"
## Server address (default localhost)
address = "localhost:80"
[[inputs.processes]]
[[inputs.sensors]]
[[inputs.swap]]
[[inputs.mem]]
[[inputs.internal]]
[[inputs.interrupts]]
[[inputs.temp]]
[[inputs.wireless]]
[[inputs.bond]]
[[inputs.dns_query]]
## servers to query
servers = ["8.8.8.8"]
[[inputs.system]]