fix(inputs.internet_speed): Add location as a field (#13497)

This commit is contained in:
Joshua Powers 2023-06-27 01:39:04 -06:00 committed by GitHub
parent 6f6e49d615
commit 40b7dbb407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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
```

View File

@ -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,