Skip to content

OpenWeatherMap current weather data exporter for Prometheus

License

Notifications You must be signed in to change notification settings

remmelt/openweathermap_exporter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Openweather exporter for prometheus

Exporter for openweather API

Quickstart

Create an API key from https://openweathermap.org/.

Install dependancies with go get and then build the binary.

go get -d -v
go build
SERVER_PORT=2112 OWM_LOCATION=LONDON,UK  OWM_API_KEY=apikey ./openweathermap_exporter

Then add the scraper in prometheus

scrape_configs:
  - job_name: 'weather'

    # Scrape is configured for free usage.
    scrape_interval: 60s

    # Port is not yet configurable
    static_configs:
      - targets: ['localhost:2112']

With Docker

The image is a multistage image, just launch as usual :

docker build -t ows .
docker run --rm -e SERVER_PORT=2112 -e OWM_LOCATION=LONDON,UK  -e OWM_API_KEY=apikey -p 2112:2112 ows

About

OpenWeatherMap current weather data exporter for Prometheus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 75.1%
  • Dockerfile 8.8%
  • HCL 8.5%
  • Makefile 7.6%