influxdata/telegraf

[inputs.openweathermap] Version 2.5 of the API is no longer supported

Open

#17.546 aberto em 29 de ago. de 2025

Ver no GitHub
 (13 comments) (5 reactions) (0 assignees)Go (4.161 forks)batch import
bughelp wantedsize/m

Métricas do repositório

Stars
 (9.892 stars)
Métricas de merge de PR
 (Mesclagem média 2d 12h) (136 fundiu PRs em 30d)

Description

Relevant telegraf.conf

[[inputs.openweathermap]]
  ## OpenWeatherMap API key.
  app_id = "xxxxxxxxxxxxxxxxxxxxxxxxxx"

  ## City ID's to collect weather data from.
  city_id = ["0000000"]

  ## Language of the description field. Can be one of "ar", "bg",
  ## "ca", "cz", "de", "el", "en", "fa", "fi", "fr", "gl", "hr", "hu",
  ## "it", "ja", "kr", "la", "lt", "mk", "nl", "pl", "pt", "ro", "ru",
  ## "se", "sk", "sl", "es", "tr", "ua", "vi", "zh_cn", "zh_tw"
  lang = "en"

  ## APIs to fetch; can contain "weather" or "forecast".
  fetch = ["weather", "forecast"]

  ## OpenWeatherMap base URL
  # base_url = "https://api.openweathermap.org/"

  ## Timeout for HTTP response.
  # response_timeout = "5s"

  ## Preferred unit system for temperature and wind speed. Can be one of
  ## "metric", "imperial", or "standard".
  units = "imperial"

  ## Query interval; OpenWeatherMap weather data is updated every 10
  ## minutes.
  interval = "10m"

Logs from Telegraf

2025-08-29T05:40:00Z E! [inputs.openweathermap] Error in plugin: querying "https://api.openweathermap.org/data/2.5/group?APPID=xxxxxxxxxxxxxxxxx&id=0000000&lang=en&units=imperial" failed: https://api.openweathermap.org/data/2.5/group?APPID=xxxxxxxxxxxxxxxxx&id=0000000&lang=en&units=imperial returned HTTP status 401 Unauthorized

System info

telegraf:1.35.4-alpine, Debian 13, k8s v1.33.3

Docker

No response

Steps to reproduce

  1. Attempt to create and run the openweathermap input with any valid configuration

Expected behavior

Input is able to hit and retrieve data from OpenWeathermap

Actual behavior

Telegraf returns a 401 error as version 2.5 of the API is no longer being hosted

Additional info

It seems that access to the 2.5 version of the API has been closed since June 2024, but the endpoint was still functional until today: https://openweathermap.org/one-call-transfer

Seems that the input will need to be fixed to utilize the 3.0 version of the API, as described in the linked blog post.

Guia do colaborador