j0rn32 / Yr2Metrics

Gets weather data from Yr.no and exposes Prometheus metrics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yr2Metrics

.Net6 minimal api

Retrieves weather data from Yr.no using the NowCast 2.0 API. Prometheus metrics will be available on http://localhost/metrics

Running

Config from appsettings.json: dotnet run

Config from parameters: dotnet run -- --Yr:UserAgent="testapp nameATdomain.com" --Yr:Latitude=59.13 --Yr:Longitude=10.16

Docker

Build: docker build -t yr2metrics .

Run with parameters from appsettings.json interactive: docker run --rm -t -p 80:80 yr2metrics .

Run with parameters interactive: docker run -i --rm -p 80:80 -e "Yr:UserAgent"="me meATmail.com" -e "Yr:Latitude"=99 -e "Yr:Longitude"=33 -t yr2metrics

Docker run with parameters: docker run -d --restart unless-stopped -p 80:80 -e "Yr:UserAgent"="me meATmail.com" -e "Yr:Latitude"=99 -e "Yr:Longitude"=33 -t yr2metrics

About

Gets weather data from Yr.no and exposes Prometheus metrics


Languages

Language:C# 96.8%Language:Dockerfile 3.2%