WeatherExporter get current weather from OpenWeatherMap and export them to metrics endpoint in prometheus format
Variable | Description |
---|---|
OWM_API_KEY |
OpenWeatherMap api key for retrive data |
OWM_LOCATION |
OpenWeatherMap City for retrive data |
EXPORTER_PORT |
Port for Expose |
$ go run .\main.go
$ docker build -t weatherexporter -f dockerfile .
$ docker run -d -t -i -e OWM_API_KEY='YOUR_OWM_API_KEY' -e OWM_LOCATION='YOUR_CIRY' -e EXPORTER_PORT=':80' -p 80:80 weatherexporter
For Deploy we create Azure VM with same specifications. Configuration for create Azure VM is giver in the terraform folder
For configure VM and create service we use ansible role in roles/weatherserver
For start service we use docker-compose file docker-compose.yml
Docker-compose contains services:
- prometheus for collect metrics
- grafana for display metrics (with dashboards provision)
- weatherexporter for retrive temperature and export metrics
- traefik for reverse proxy to grafana with acme generated ssl certificate
Option | Description |
---|---|
AZURE_AD_CLIENT_ID |
Azure AD Client ID |
AZURE_AD_CLIENT_SECRET |
Azure AD Client Secret |
AZURE_AD_TENANT_ID |
Azure AD Tenant ID |
AZURE_SUBSCRIPTION_ID |
Azure Subscription ID for Deployment |
DOCKER_HUB_ACCESS_TOKEN |
Docker hub access token for push image |
DOCKER_HUB_USERNAME |
Docker hub username for push image |
OWM_API_KEY |
OpenWeatherMap api key for retrive data |
OWM_CITY |
OpenWeatherMap city for retrive data |
SERVER_NAME |
HTTP Url for your server |
SSH_PRIVATE_KEY |
SSH Private key for configure and deploy server |
TF_VAR_PUBLIC_KEY |
SSH Public key for terraform configuration |
There are 3 workflow: