HTTP_response plugin should support checking connectivity and response times of multiple addresses.
Currently in config file only one address can be given: address = "" which is limiting. Instead it should
be possible to give a list of addresses, similar to the HTTPJSON plugin, which takes a list of servers.
In my use case I desired to monitor the /health api responses of several microservices at once.
Edit:
It turns out that the whole configuration sections [[inputs.http_response]] can be duplicated and telegraf will obey and act on each copy. So this issue is more about having somewhere in documentation mentioned clearly that (all or just some?) plugins can be instantiated multiple times. Current documentation does not point this out so the reader will automatically assume that each plugin is configured once only.
this is documented: https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md#output-configuration-examples
if you want to submit a PR to make it more obvious, that would be OK as well
Also: A tip from the linked docs:
It is highly recommended that you utilize name_override, name_prefix, or name_suffix config options to avoid measurement collisions
Hi is there a way to configure multiple http_requests in one input something like below:-
Tried modifying the file to monitor multiple web sites using the config file
nano /etc/telegraf/telegraf.conf
[[inputs.http_response]]
address = [
"http://localhost:90/mantisBT",
"http://localhost/app1",
"http://localhost/app2",
]
after saving this when I tried
telegraf -config /etc/telegraf/telegraf.conf -input-filter http_response -test
no output was displayed.
when i tried
[[inputs.http_response]]
address = "http://localhost:90/","http://localhost/app1"
after saving this when I tried
telegraf -config /etc/telegraf/telegraf.conf -input-filter http_response -test
printed error was below
2017/03/31 14:05:16 E! Error parsing /etc/telegraf/telegraf.conf, toml: line 985: parse error
when tried
[[inputs.http_response]]
address = "http://localhost:90/"
address = "http://localhost/app1"
it returned
2017/03/31 14:21:48 E! Error parsing /etc/telegraf/telegraf.conf, toml: line 986: key `address' is in conflict with line 985
Can you please reply.
Okay. learnt that below config can handle it.
[[inputs.http_response]]
# ## Server address (default http://localhost)
address = "http://localhost/app1"
[[inputs.http_response]]
# ## Server address (default http://localhost)
address = "http://localhost:90/"
[[inputs.http_response]]
# ## Server address (default http://localhost)
address = "http://localhost:3000/"
Thanks for the wonderful project..
telegraf -config /etc/telegraf/telegraf.conf -input-filter http_response -test
* Plugin: inputs.http_response, Collection 1
> http_response,server=http://localhost:90/,method=GET,host=10.*.*.* response_time=0.022389100000000002,http_response_code=301i 1490956393000000000
* Plugin: inputs.http_response, Collection 1
> http_response,method=GET,host=*.*.*.*,server=http://localhost:3000/ response_time=0.0030783000000000004,http_response_code=302i 1490956393000000000
* Plugin: inputs.http_response, Collection 1
> http_response,method=GET,host=*.*.*.*,server=http://localhost/app1
response_time=0.0216025,http_response_code=200i 1490956393000000000
Most helpful comment
Okay. learnt that below config can handle it.
Thanks for the wonderful project..