openweather-exporter

command module
v0.0.0-...-6840799 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

OpenWeather Exporter

Docker Pulls Docker Automated report Docker Build license release

Prometheus exporter for openweather API

Requirements

Development

Configuration

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

Environment CLI (--flag) Default Description
OW_LISTEN_ADDRESS listen-address :9091 The port for /metrics to listen on
OW_APIKEY apikey <REQUIRED> Your Openweather API key
OW_CITY city New York, NY City/Location in which to gather weather metrics. Separate multiple locations with | for example "New York, NY|Seattle, WA"
OW_DEGREES_UNIT degrees-unit F Unit in which to show metrics (Kelvin, Fahrenheit or Celsius)
OW_LANGUAGE language EN Language in which to show metrics

Usage

Binary Usage

# Export weather metrics from Seattle using binary
./openweather-exporter --city "Seattle, WA" --apikey mi4o2n54i0510n4510

Docker Usage

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

Docker-compose Usage

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

Prometheus Scrape Usage

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

Grafana

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

Dashboard Link

Notes

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

./script/cibuild

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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