collectd
collectd copied to clipboard
write_http plugin fails to notice DNS changes
- Version of collectd: 5.5.0
- Operating system / distribution: Ubuntu 16.04 LTS & CoreOS stable 1010.5.0 (HVM)
Expected behavior
write_http plugin should send metrics to right destinations even if the dns record value of 'URL' parameter changed.
Actual behavior
write_http plugin sends metrics to the initial destination that it resolved at the start time. (there might be no dns cache expiration in write_http plugin)
Steps to reproduce
- make a dns record (A or CNAME) and set TTL as a small value : for example, 'metric.target.com' for '10.10.10.1' and TTL 60 seconds (1 minute).
- set URL parameter of write_http plugin to that domain. example below.
<Plugin "write_http">
<Node "localhost">
URL "metric.target.com"
Format JSON
</Node>
</Plugin>
- change the dns record to the another value. for example, '10.10.10.1' -> '10.10.10.2'
- write_http plugin still sends metrics to the old ip (10.10.10.1) even after DNS TTL time. it does not catch up changes in the dns record. it should send to the new ip (10.10.10.2).
Hi @breadmj,
can you check if cURL and the webserver keep the connection open, most likely thanks to HTTP keep-alive? Thanks!
—octo
Hello @octo,
my webserver doesn't support keep connection open (keep-alive) feature. I figure this happens regardless of the keep-alive.
Thanks for your support.