https://github.com/dsmith73/openweathermap_exporter
https://github.com/dsmith73/openweathermap_exporter
go openweathermap prometheus-exporter
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dsmith73/openweathermap_exporter
- Owner: dsmith73
- Created: 2020-05-12T20:37:11.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-12T21:28:46.000Z (about 6 years ago)
- Last Synced: 2025-01-03T12:45:20.944Z (over 1 year ago)
- Topics: go, openweathermap, prometheus-exporter
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Openweather exporter for prometheus
_docker image_
Exporter for openweather API
_modified the `.go` from: [blackrez/openweathermap_exporter](https://github.com/blackrez/openweathermap_exporter) to provide additional options and information_
This leverages the code from [Brian Downs](https://github.com/briandowns/openweathermap)
---
## Quickstart
**Create an API key from https://openweathermap.org/.**
This exporter leverages city_id from openweathermap.org for better accuracy -
The IDs can be found **[here](http://bulk.openweathermap.org/sample/)**
`.env`
```sh
OWM_PORT=:2112
OWM_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
OWM_LOCATION=4259418
```
**Clone this repo**
**Add the scraper in prometheus**
```yml
scrape_configs:
- job_name: 'weather'
scrape_interval: 60s
# Port is configurable
static_configs:
- targets: ['openweathermap:2112']
```
**Spin up the docker image**
`docker build . -t openweathermap_exporter --force-rm`
* `--force-rm` tells docker to get rid of intermediate builds in the multi-stage build process
---
## or - Spin up with Docker-Compose
```yml
openweathermap:
build:
context: https://github.com/dsmith73/openweathermap_exporter.git
dockerfile: ./Dockerfile
container_name: openweathermap
hostname: openweathermap
environment:
- OWM_PORT=${OWM_PORT}
- OWM_API_KEY=${OWM_API_KEY}
- OWM_LOCATION=${OWM_LOCATION}
expose:
- 2112
restart: always
labels:
description: "container to pull weather info for specified locations"
```
---
| Contact: |
| :---------: |
| **[Slack](https://101101workspace.slack.com/archives/D012ESWSXHQ "dsmith73 on 101101 workspace")** |
|  |