Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internet_speed: Support blacklisting or chosing servers #11625

Closed
KoffeinKaio opened this issue Aug 4, 2022 · 3 comments · Fixed by #12617 or #12707
Closed

internet_speed: Support blacklisting or chosing servers #11625

KoffeinKaio opened this issue Aug 4, 2022 · 3 comments · Fixed by #12617 or #12707
Labels
feature request Requests for new plugin and for new features to existing plugins waiting for response waiting for response from contributor

Comments

@KoffeinKaio
Copy link

KoffeinKaio commented Aug 4, 2022

Use Case

My ISP provieds its own speedtest server, which is of course selected frist for lowest latency/distance.
Thing is, they cheat. It gets routet ISP-internal and provides the full line speeds, not the one to the internet.

Expected behavior

I kinda want something like

[[inputs.internet_speed]]
  ## Sets if runs file download test
  interval = "30m"
  excluded_servers = "193894,203049,390484"

or (allowed servers)

[[inputs.internet_speed]]
  ## Sets if runs file download test
  interval = "30m"
  servers = "193894,203049,390484"

Actual behavior

as far as I can see, its not supported to chose or exclude servers

Additional info

If someone could point me where to do the code changes, I might implement it myself.

@KoffeinKaio KoffeinKaio added the feature request Requests for new plugin and for new features to existing plugins label Aug 4, 2022
@KoffeinKaio KoffeinKaio changed the title internet_speed: Support blacklisting servers internet_speed: Support blacklisting or chosing servers Aug 4, 2022
@reimda
Copy link
Contributor

reimda commented Aug 4, 2022

Hi @KoffeinKaio, are those six digit server numbers you are using the same as the ID from the speedtest-go module?

https://github.com/showwin/speedtest-go/blob/4800c78e8fdd4afecb98147ff95049db14288a8a/speedtest/server.go#L34

If so, it looks like telegraf could be changed to remove them from the list of servers here

https://github.com/influxdata/telegraf/blob/master/plugins/inputs/internet_speed/internet_speed.go#L41

We would need to be careful not to remove all the servers from the list or warn the user if they did, but it seems like that would possible.

Are you able to put together a PR to make this code change?

@theS1LV3R
Copy link

I would love this to be a feature too. May be able to attempt to create a PR, though I haven't worked that much with go before, and never with the speedtest-go library.

powersj added a commit to powersj/telegraf that referenced this issue Feb 3, 2023
This adds the ability to exclude or include specific speedtest server
IDs. If a user excludes a server ID that server is always excluded from
selection. If a user includes a specific server ID, then we will look
for only that ID.

This does not let a user pick a random server ID. The speedtest-go
library will receive the 10 closet servers. As such, users need to
be careful as they can prevent any server from being picked.

fixes: influxdata#11449
fixes: influxdata#11625
fixes: influxdata#12595
@powersj
Copy link
Contributor

powersj commented Feb 3, 2023

@KoffeinKaio

Can you try one of the test artifacts on #12617 and use the server_id_exclude option to ignore certain servers?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins waiting for response waiting for response from contributor
Projects
None yet
4 participants