openweathermap-exporter

command module
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 10 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL