collectd icon indicating copy to clipboard operation
collectd copied to clipboard

write_http plugin fails to notice DNS changes

Open myungjae1 opened this issue 10 years ago • 2 comments

  • 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).

myungjae1 avatar Oct 28 '16 11:10 myungjae1

Hi @breadmj,

can you check if cURL and the webserver keep the connection open, most likely thanks to HTTP keep-alive? Thanks!

—octo

octo avatar Oct 30 '16 19:10 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.

myungjae1 avatar Oct 31 '16 02:10 myungjae1