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 plugin failed to fetch user info #12213

Closed
mikaelpeltier opened this issue Nov 9, 2022 · 6 comments · Fixed by #12248
Closed

Internet_speed plugin failed to fetch user info #12213

mikaelpeltier opened this issue Nov 9, 2022 · 6 comments · Fixed by #12248
Assignees
Labels
bug unexpected problem or unintended behavior upstream bug or issues that rely on dependency fixes

Comments

@mikaelpeltier
Copy link

Relevant telegraf.conf

# Monitors internet speed using speedtest.net service
[[inputs.internet_speed]]
  ## This plugin downloads many MB of data each time it is run. As such
  ## consider setting a higher interval for this plugin to reduce the
  ## demand on your internet connection.
  interval = "2m"

  ## Enable to reduce memory usage
  # memory_saving_mode = false

  ## Caches the closest server location
  # cache = false

Logs from Telegraf

2022-11-09T15:02:43Z I! Using config file: /etc/telegraf/telegraf.conf
2022-11-09T15:02:43Z I! Starting Telegraf 1.24.3
2022-11-09T15:02:43Z I! Available plugins: 222 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-11-09T15:02:43Z I! Loaded inputs: internet_speed
2022-11-09T15:02:43Z I! Loaded aggregators:
2022-11-09T15:02:43Z I! Loaded processors:
2022-11-09T15:02:43Z I! Loaded outputs: influxdb_v2
2022-11-09T15:02:43Z I! Tags enabled: host=420d5a7f0f5b
2022-11-09T15:02:43Z I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:"420d5a7f0f5b", Flush Interval:10s
2022-11-09T15:02:43Z D! [agent] Initializing plugins
2022-11-09T15:02:43Z D! [agent] Connecting outputs
2022-11-09T15:02:43Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2022-11-09T15:02:43Z D! [agent] Successfully connected to outputs.influxdb_v2
2022-11-09T15:02:43Z D! [agent] Starting service inputs
2022-11-09T15:02:53Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10 metrics
2022-11-09T15:03:00Z E! [inputs.internet_speed] Error in plugin: fetching user info failed: EOF

System info

Latest version of telegraf docker

Docker

No response

Steps to reproduce

  1. Configure internet_speed plugin with the official telegraf docker (latest version)
  2. Start telegraf
  3. internet_speed plugin will generate error because it failed to fetch user info

Expected behavior

internet_speed plugin should work as expected and collect internet connection data.
This plugin should work as it is the plugin used into the course Data Collection with Telegraf from the InfluxDB university website.

Actual behavior

internet_speed plugin failed to fetch user info
2022-11-09T15:03:00Z E! [inputs.internet_speed] Error in plugin: fetching user info failed: EOF

Additional info

I wonder if it is related to the FetchUserInfoContext method which do not initialize the user-agent into the http request.

@mikaelpeltier mikaelpeltier added the bug unexpected problem or unintended behavior label Nov 9, 2022
@powersj
Copy link
Contributor

powersj commented Nov 9, 2022

I wonder if it is related to the FetchUserInfoContext method which do not initialize the user-agent into the http request.

You mean the function I called out in your forum post ;)

Can I have you file a bug at the upstream showwin/speedtest-go and ask what issue might be causing this? This code is outside of telegraf.

Thanks

@powersj powersj added the waiting for response waiting for response from contributor label Nov 9, 2022
@mikaelpeltier
Copy link
Author

mikaelpeltier commented Nov 9, 2022

Yes, it seems related to the function that you mentionned.
I quickly checked and it could be related to user-agent, but not sure.
Yes, I just created a bug at the upstream showwin/speedtest-go.

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Nov 9, 2022
@powersj powersj added waiting for response waiting for response from contributor upstream bug or issues that rely on dependency fixes labels Nov 9, 2022
@mikaelpeltier
Copy link
Author

The new release of speedtest-go v1.2.1 contains a fix that should avoid this error.
Now, I think that the version of speedtest-go used by telegraf must be updated, someone could confirm this point ?

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Nov 15, 2022
@powersj
Copy link
Contributor

powersj commented Nov 15, 2022

Thanks for putting up that PR! I can put up a PR to update the dep in go.mod shortly

@srebhan
Copy link
Contributor

srebhan commented Nov 16, 2022

@mikaelpeltier please test the binary built by CI in #12248 once it's finished. Let me know if this fixes your issue.

@mikaelpeltier
Copy link
Author

mikaelpeltier commented Nov 19, 2022

Thanks, I did a quick test with the binary built by CI in #12248 and works as expected.

Indeed, plugin does not longer crashed.

2022-11-19T09:39:28Z I! Starting Telegraf 1.25.0-0242810d
...
2022-11-19T09:43:30Z D! [inputs.internet_speed] Found server: [23282]    11.04km
2022-11-19T09:43:30Z D! [inputs.internet_speed] Starting Speed Test
2022-11-19T09:43:30Z D! [inputs.internet_speed] Running Ping...
2022-11-19T09:43:30Z D! [inputs.internet_speed] Running Download...
2022-11-19T09:43:36Z D! [inputs.internet_speed] Running Upload...
2022-11-19T09:43:40Z D! [inputs.internet_speed] Test finished.
2022-11-19T09:44:00Z D! [inputs.internet_speed] Found server: [23282]    11.04km
2022-11-19T09:44:00Z D! [inputs.internet_speed] Starting Speed Test
2022-11-19T09:44:00Z D! [inputs.internet_speed] Running Ping...
2022-11-19T09:44:00Z D! [inputs.internet_speed] Running Download...
2022-11-19T09:44:05Z D! [inputs.internet_speed] Running Upload...
2022-11-19T09:44:09Z D! [inputs.internet_speed] Test finished.
2022-11-19T09:44:26Z D! [outputs.influxdb_v2] Wrote batch of 2 metrics in 226.5015ms
2022-11-19T09:44:26Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10 metrics

And I can display result into influxdb dashboard

graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior upstream bug or issues that rely on dependency fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants