influxdata / influxdata/telegraf
[FR] Openweathermap plugin for Telegraf - addition of 'wind_gust' metric
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Use Case
Greetings,
Openweathermap plugin currently pulls two wind metrics - `wind_speed` and `wind_direction`, but the upstream API also offers the `wind_gust` value.
Sample output from curling the openweather api:
```
"wind": {
"speed": 6.43,
"deg": 155,
"gust": 16.41
},
```
Adding this to the telegraf openweathermap plugin _looks_ to require small additions in three places in https://github.com/influxdata/telegraf/blob/master/plugins/inputs/openweathermap/openweathermap.go - a single line entry after each of the three existing
```
"wind_degrees": e.Wind.Deg,
"wind_speed": e.Wind.Speed,
```
definitions, with `wind_gust` as the API returned key name, and `e.Wind.Gust` as the new internal variable.
And one line addition to: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/openweathermap/types.go - adding a new entry after:
```
Wind struct {
Deg float64 `json:"deg"`
Speed float64 `json:"speed"`
```
I'd assume same type (float64 and speed) as 'Wind.Speed'.
I'd guess some adds to the output samples and the /testcases/ directory, but I'm not a go lang guy, so I'm going to avoid guessing about those requirements.
thanks,
Jedd.
### Expected behavior
n/a
### Actual behavior
n/a
### Additional info
_No response_
Contributor guide
Research direction
Start in plugins/inputs/openweathermap/openweathermap.go and types.go, following the existing wind_degrees and wind_speed mappings and Wind struct fields. Check the output samples and testcases directory for related expectations. Done means the upstream gust value is represented as wind_gust and covered consistently in the samples or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100