Skip to content

Exports Tankerkönig data for Prometheus

Notifications You must be signed in to change notification settings

uhlig-it/tankerkoenig-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tankerkönig Exporter

Exports Tankerkönig data for Prometheus

Build

$ goreleaser --snapshot

Deployment

$ cd deployment
$ ansible-playbook playbook.yml -i somewhere.example.com,

Manual Approach

  1. Search for a station within 1 km of my home:

    $ curl "https://creativecommons.tankerkoenig.de/json/list.php?lat=48.52&lng=8.82&rad=1&sort=dist&type=all&apikey=$TANKERKOENIG_API_KEY" | jq -r '.stations[].id'
    870efffb-676b-4301-854e-c80e93c3e3ef
  2. For that station, get the current price of Diesel:

    $ TANKERKOENIG_STATIONS=870efffb-676b-4301-854e-c80e93c3e3ef
    $ curl "https://creativecommons.tankerkoenig.de/json/prices.php?ids=$TANKERKOENIG_STATIONS&apikey=$TANKERKOENIG_API_KEY" | jq -r '.prices[].diesel'

Ideas

  • Concourse resource creates a new version when the price has change (risen/fallen)

Links