Open abhi-jha opened 1 year ago
A plugin to monitor websites' response time, health etc. Something close to what traceroute does.
There are like 3 different requests in that title :) What are you actually trying to do or what is your end goal metric? And have you looked at the ping plugin?
Oh, I was looking for something that can do all of them or most of them in a singular plugin. Basically a website's health/usability. @Hipska can clarify.
On Slack we only discussed for a plugin that can do trace routes natively instead of via the exec command.
Response time and health can already be done via existing plugins.
Yeah, lets reduce the scope for this. I am fine with doing just the traceroute thing.
I need a little help in deciding what the output should look like before I got implementing. Any comments, guidlines is very much apprecaited.
But this requires telegraf having sudo user access so that it can execute mtr command. The idea is to get this functionality in a native plugin.
How is adding a plugin going to resolve the need to use sudo?
There is a solution to run mtr
already with exec and parsing the output. We have had a request for mtr
before in https://github.com/influxdata/telegraf/issues/2509 and it seemed to come back to use exec, as you are doing now.
I am pushing back on this, because I am not sure I see the value in a new plugin, where we will have different users wanting different options, when they can pretty easily run with exec today and take the fields and format they want.
I think traceroute being supported natively eliminates the need to run it via exec
. Getting the same information via libraries shoudln't require messing with any privileges.
@powersj Let me know if we need to discuss this more. I am looking around for some libraries that can provide the traceroute
metrics. Do let me know if you have some ideas to pick a particular one.
I can start with a PR.
Let me know if we need to discuss this more. I am looking around for some libraries that can provide the traceroute metrics
I would like to see what you find, especially if it does not require sudo.
You can see https://github.com/traviscross/mtr/issues/204#issuecomment-723961118 about why mtr requires sudo and the comments about setting setuid or other privliges can remove the need for sudo. Again, a user could use this method, today.
For the ping
input we currently use pro-bing, and it seems you can already set an TTL with that one, so it should be possible to implement a traceroute with it.
Should I go ahead and give pro-bing a shot? I want to see what the exact would look like.
Sure, let us know if it doesn’t work out, we can look for alternatives or solutions.
Is there a suggested list of metrics that comes to mind as ouptut?
count of hops, time taken(min, max, avg, sd), result_code,packets_sent, packets_received, ttl
Is this the right direction?
If it could be like you showed as example in “Additional info”, that would be great!
Just be sure to emit a metric for every hop.
Note to myself: https://github.com/wisdomatom/go-mtr
Hello. Looks like I missed this for some time. Is there already such a plugin in? Or should I continue ahead?
There is no mtr or trace route related plugin yet, You are free to go ahead 😉
@abhi-jha a PR for adding such a plugin would be appreciated!
Hello. I am trying to get pro-bing library to work as a small POC.
https://influxcommunity.slack.com/archives/CH99HUH8V/p1716680252073199
The problem is that TTLs don't seem to be working very with the library. Do you have any insights?
Use Case
Curently we can do this via the
exec
plugin as described below.But this requires telegraf having
sudo
user access so that it can executemtr
command.The idea is to get this functionality in a native plugin.
Example new plugin :
Expected behavior
Not sure but it could look like how
mtr
provides output:trace,dest=google.com,hop=7,host=hostname.local,ip=2a00:1450:8106::1 avg=19.83,best=14.22,worst=37.31,stdev=6.73,status="OK",loss=10,snt=10i 1679419996000000000
It maybe possible to include how many hops it is taking as well, something that
dig
does when doing recurisve search to root servers.Actual behavior
I used
mtr
withinexec
for now but it required that I make the current user which ran telegraf a sudoer.Making it a native plugin that is only dependent on libraries eliminates the need to have it within
sudoer
Additional info