billykwooten/openweather-exporter

Prometheus exporter utilizing Openweather API (https://openweathermap.org/api) to gather weather metrics.

69

stars

100

commits

Go

primary language

Dec 8, 2025

updated

README

OpenWeather Exporter

Docker Pulls report license release Go Version

Prometheus exporter for openweather API.

NOTE: As of version 0.0.12 of this exporter, you need to sign up for the API 3.0 free or paid subscription for your API keys to work.

Requirements

  • Linux / MacOSX, git bash for Windows
  • docker
  • Openweather API 3.0 Subscription (Free or Paid)

Development

Configuration

Openweather exporter can be controlled by both ENV or CLI flags as described below.

Enabling OW_ENABLE_POL will call the API more times to pull pollution/air quality data, be weary of your API calls, so you do not get charged. See openweather pricing here.

EnvironmentCLI (--flag)DefaultDescription
OW_LISTEN_ADDRESSlisten-address:9091The port for /metrics to listen on
OW_APIKEYapikey<REQUIRED>Your Openweather API key
OW_CITYcityNew York, NYCity/Location in which to gather weather metrics. Separate multiple locations with a pipe, " | "
OW_DEGREES_UNITdegrees-unitFUnit in which to show metrics (Kelvin, Fahrenheit or Celsius)
OW_LANGUAGElanguageENLanguage in which to show metrics
OW_CACHE_TTLcache-ttl300Time to Live Caching Time in Seconds
OW_ENABLE_POLenable-polfalse (bool)Enable Pollution Metrics.

Usage

Binary Usage

# Export weather metrics from Seattle using binary & pollution/UV metrics on
./openweather-exporter --city "Seattle, WA" --apikey mi4o2n54i0510n4510 --enable-pol

Docker Usage

# Export weather metrics from Seattle using docker
docker run -d --restart on-failure --name=openweather-exporter -p 9091:9091 billykwooten/openweather-exporter --city "Seattle, WA" --apikey mi4o2n54i0510n4510

Docker-compose Usage

  openweather-exporter:
    image: billykwooten/openweather-exporter
    container_name: openweather-exporter
    restart: always
    ports:
      - "9091:9091"
    environment:
      - OW_CITY=New York, NY
      - OW_APIKEY=mi4o2n54i0510n4510
      - OW_ENABLE_POL=true

Prometheus Scrape Usage

scrape_configs:
  - job_name: 'openweather-exporter'
    scrape_interval: 60s
    static_configs:
      - targets: ['openweather-exporter:9091']

Collectors

Openweather exporter metrics that are collected by default.

NameDescription
openweather_temperatureCurrent temperature in degrees
openweather_humidityCurrent relative humidity
openweather_feelslikeCurrent feels_like temperature in degrees (heat index)
openweather_pressureCurrent Atmospheric pressure hPa
openweather_windspeedCurrent Wind Speed in mph or meters/sec if imperial
openweather_windgustCurrent Wind Gust in mph or meters/sec if imperial
openweather_rain1hRain volume for last hour, in millimeters
openweather_snow1hSnow volume for last hour, in millimeters
openweather_winddegreeWind direction, degrees (meteorological)
openweather_cloudinessCloudiness in percentage
openweather_sunriseSunrise time, unix, UTC
openweather_sunsetSunset time, unix, UTC
openweather_currentconditionsCurrent weather conditions (sunny, cloudy, rainy, etc.)
openweather_ultraviolet_indexUltraviolet Index
openweather_visibilityVisibility in meters

If you enable pollution metrics, the following metrics will be enabled.

NameDescription
openweather_pollution_airqualityindexAir Quality Index. 1 = Good, 2 = Fair, 3 = Moderate, 4 = Poor, 5 = Very Poor.
openweather_pollution_carbonmonoxideConcentration of CO (Carbon Monoxide) μg/m3
openweather_pollution_nitrogenmonoxideConcentration of NO (Nitrogen Monoxide) μg/m3
openweather_pollution_nitrogendioxideConcentration of NO2 (Nitrogen Dioxide) μg/m3
openweather_pollution_ozoneConcentration of O3 (Ozone) μg/m3
openweather_pollution_sulphurdioxideConcentration of SO2 (Sulphur Dioxide) μg/m3
openweather_pollution_pm25Concentration of PM2.5 (Fine particles matter) μg/m3
openweather_pollution_pm10Concentration of PM10 (Coarse particles matter) μg/m3
openweather_pollution_nh3Concentration of NH3 (Ammonia) μg/m3

Grafana

I have created a grafana dashboard for this exporter, feel free to use it. Link below.

Dashboard Link

Development

If you'd like to build this yourself you can clone this repo and run:

./script/cibuild

Contributors

billykwooten

75 commits

ebariaux

10 commits

lomereiter

5 commits

martinlindhe

4 commits

billykwooten/openweather-exporter

Prometheus exporter utilizing Openweather API (https://openweathermap.org/api) to gather weather metrics.

69

stars

100

commits

Go

primary language

Dec 8, 2025

updated

README

OpenWeather Exporter

Docker Pulls report license release Go Version

Prometheus exporter for openweather API.

NOTE: As of version 0.0.12 of this exporter, you need to sign up for the API 3.0 free or paid subscription for your API keys to work.

Requirements

  • Linux / MacOSX, git bash for Windows
  • docker
  • Openweather API 3.0 Subscription (Free or Paid)

Development

Configuration

Openweather exporter can be controlled by both ENV or CLI flags as described below.

Enabling OW_ENABLE_POL will call the API more times to pull pollution/air quality data, be weary of your API calls, so you do not get charged. See openweather pricing here.

EnvironmentCLI (--flag)DefaultDescription
OW_LISTEN_ADDRESSlisten-address:9091The port for /metrics to listen on
OW_APIKEYapikey<REQUIRED>Your Openweather API key
OW_CITYcityNew York, NYCity/Location in which to gather weather metrics. Separate multiple locations with a pipe, " | "
OW_DEGREES_UNITdegrees-unitFUnit in which to show metrics (Kelvin, Fahrenheit or Celsius)
OW_LANGUAGElanguageENLanguage in which to show metrics
OW_CACHE_TTLcache-ttl300Time to Live Caching Time in Seconds
OW_ENABLE_POLenable-polfalse (bool)Enable Pollution Metrics.

Usage

Binary Usage

# Export weather metrics from Seattle using binary & pollution/UV metrics on
./openweather-exporter --city "Seattle, WA" --apikey mi4o2n54i0510n4510 --enable-pol

Docker Usage

# Export weather metrics from Seattle using docker
docker run -d --restart on-failure --name=openweather-exporter -p 9091:9091 billykwooten/openweather-exporter --city "Seattle, WA" --apikey mi4o2n54i0510n4510

Docker-compose Usage

  openweather-exporter:
    image: billykwooten/openweather-exporter
    container_name: openweather-exporter
    restart: always
    ports:
      - "9091:9091"
    environment:
      - OW_CITY=New York, NY
      - OW_APIKEY=mi4o2n54i0510n4510
      - OW_ENABLE_POL=true

Prometheus Scrape Usage

scrape_configs:
  - job_name: 'openweather-exporter'
    scrape_interval: 60s
    static_configs:
      - targets: ['openweather-exporter:9091']

Collectors

Openweather exporter metrics that are collected by default.

NameDescription
openweather_temperatureCurrent temperature in degrees
openweather_humidityCurrent relative humidity
openweather_feelslikeCurrent feels_like temperature in degrees (heat index)
openweather_pressureCurrent Atmospheric pressure hPa
openweather_windspeedCurrent Wind Speed in mph or meters/sec if imperial
openweather_windgustCurrent Wind Gust in mph or meters/sec if imperial
openweather_rain1hRain volume for last hour, in millimeters
openweather_snow1hSnow volume for last hour, in millimeters
openweather_winddegreeWind direction, degrees (meteorological)
openweather_cloudinessCloudiness in percentage
openweather_sunriseSunrise time, unix, UTC
openweather_sunsetSunset time, unix, UTC
openweather_currentconditionsCurrent weather conditions (sunny, cloudy, rainy, etc.)
openweather_ultraviolet_indexUltraviolet Index
openweather_visibilityVisibility in meters

If you enable pollution metrics, the following metrics will be enabled.

NameDescription
openweather_pollution_airqualityindexAir Quality Index. 1 = Good, 2 = Fair, 3 = Moderate, 4 = Poor, 5 = Very Poor.
openweather_pollution_carbonmonoxideConcentration of CO (Carbon Monoxide) μg/m3
openweather_pollution_nitrogenmonoxideConcentration of NO (Nitrogen Monoxide) μg/m3
openweather_pollution_nitrogendioxideConcentration of NO2 (Nitrogen Dioxide) μg/m3
openweather_pollution_ozoneConcentration of O3 (Ozone) μg/m3
openweather_pollution_sulphurdioxideConcentration of SO2 (Sulphur Dioxide) μg/m3
openweather_pollution_pm25Concentration of PM2.5 (Fine particles matter) μg/m3
openweather_pollution_pm10Concentration of PM10 (Coarse particles matter) μg/m3
openweather_pollution_nh3Concentration of NH3 (Ammonia) μg/m3

Grafana

I have created a grafana dashboard for this exporter, feel free to use it. Link below.

Dashboard Link

Development

If you'd like to build this yourself you can clone this repo and run:

./script/cibuild

Contributors

billykwooten

75 commits

ebariaux

10 commits

lomereiter

5 commits

martinlindhe

4 commits

Languages

Go

81.5%

Shell

16.9%

Dockerfile

1.6%