From 40b7dbb40761beffa720aafcb0e9ca07bdd78c0a Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Tue, 27 Jun 2023 01:39:04 -0600 Subject: [PATCH] fix(inputs.internet_speed): Add location as a field (#13497) --- plugins/inputs/internet_speed/README.md | 3 ++- plugins/inputs/internet_speed/internet_speed.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/inputs/internet_speed/README.md b/plugins/inputs/internet_speed/README.md index e3c1f282a..c1844d408 100644 --- a/plugins/inputs/internet_speed/README.md +++ b/plugins/inputs/internet_speed/README.md @@ -69,6 +69,7 @@ It collects the following fields: | Upload Speed | upload | float64 | Mbps | | Latency | latency | float64 | ms | | Jitter | jitter | float64 | ms | +| Location | location | string | - | And the following tags: @@ -81,5 +82,5 @@ And the following tags: ## Example Output ```text -internet_speed,source=speedtest02.z4internet.com:8080,server_id=54619,test_mode=single download=318.37580265897725,upload=30.444407341274385,latency=37.73174,jitter=1.99810 1675458921000000000 +internet_speed,source=speedtest02.z4internet.com:8080,server_id=54619,test_mode=single download=318.37580265897725,upload=30.444407341274385,latency=37.73174,jitter=1.99810,location="Somewhere, TX" 1675458921000000000 ``` diff --git a/plugins/inputs/internet_speed/internet_speed.go b/plugins/inputs/internet_speed/internet_speed.go index d8ee1b8fc..bf8706c25 100644 --- a/plugins/inputs/internet_speed/internet_speed.go +++ b/plugins/inputs/internet_speed/internet_speed.go @@ -107,6 +107,7 @@ func (is *InternetSpeed) Gather(acc telegraf.Accumulator) error { "upload": is.server.ULSpeed, "latency": timeDurationMillisecondToFloat64(is.server.Latency), "jitter": timeDurationMillisecondToFloat64(is.server.Jitter), + "location": is.server.Name, } tags := map[string]string{ "server_id": is.server.ID,