Hello! I have:
Host A with InfluxDB
Host B with Telegraf and straight connection to Host A
Host C with Telegraf and straight connection to Host B (but not A)
How can I set up Host B telegraf to send metrics from Host C to InfluxDB?
What I’ve done already:
[[inputs.influxdb_v2_listener]]
on Host B and [[outputs.influxdb_v2]]
on Host C
Host C doesn’t see any problem and sends metrics like normal. But I can’t see metrics with host=Host C in the Data Explorer. So I guess problem is in the Host B .
I tried to turn on debug on both hosts, but it didn’t help, no information about transmission.
There are no complete examples about inputs.influxdb_v2_listener
configs:
Host B
[[inputs.influxdb_v2_listener]]
service_address = "192.168.0.45:9086"
Host C
[agent]
interval = "5s"
round_interval = false
metric_batch_size = 8000
metric_buffer_limit = 1000000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
hostname = "$INFLUX_HOSTNAME" # Host C
omit_hostname = false
[[outputs.influxdb_v2]]
alias = "master_db"
urls = ["192.168.0.45:9086"]
token = "$INFLUX_TOKEN"
organization = "ORG"
exclude_bucket_tag = true
bucket = "master"
bucket_tag = "influxdb_database"
timeout = "120s"
content_encoding = "gzip"
Maybe someone have guesses or examples what I’m missing?
Hipska
December 21, 2022, 10:22am
2
That looks completely correct…
Are you sure there is no metric filtering done on Host B?
yeah, i’m sure, all other inputs are the same on both Host B and Host C
Hipska
December 21, 2022, 10:51am
4
I mean filtering on the processors/aggregators or outputs…
No, nothing. I don’t even use processors or aggregators.
Output on Host B is practically same:
[[outputs.influxdb_v2]]
alias = "master_db"
urls = ["$INFLUX_HOST"]
token = "$INFLUX_TOKEN"
organization = "ORG"
exclude_bucket_tag = true
bucket = "master"
bucket_tag = "influxdb_database"
timeout = "120s"
content_encoding = "gzip"
Hipska
December 21, 2022, 11:04am
6
And what is the content of the tag influxdb_database
on metrics that come from Host C? Is it the same as for metrics on Host B?
yes, the same
It’s like this
[[inputs.swap]]
[[inputs.system]]
fielddrop = ["uptime_format"]
[[inputs.docker]]
endpoint = "unix:///var/run/docker.sock"
gather_services = false
source_tag = false
container_name_include = []
container_name_exclude = []
timeout = "10s"
total = false
docker_label_include = []
docker_label_exclude = []
tag_env = ["JAVA_HOME", "HEAP_SIZE"]
[inputs.docker.tags]
influxdb_database = "docker" # !!!!!!!!
Hipska
December 21, 2022, 12:49pm
8
If you want to keep the bucket for metrics coming from Host C, you will need to add the following to your inputs.influxdb_v2_listener on Host B:
bucket_tag = "influxdb_database"
Thx for your help, it was included, I pasted this part above.
The problem was with time on Host C, it was not syncing with ntp suddenly.
Hipska
December 21, 2022, 3:09pm
10
No, on the listener part on Host B, so like this:
[[inputs.influxdb_v2_listener]]
service_address = "192.168.0.45:9086"
bucket_tag = "influxdb_database"
But glad you figured it out…
You’re fantastic. Thank you again)
We needed to add the http:// to the urls in the [[outputs.influxdb_v2]] configuration block
urls = [“http://x.x.x.x :port”]
instead of the supplied example
urls = [“192.168.0.45:9086”]
But the proxy functionality worked fine