Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

lukasmalkmus/tankerkoenig_exporter

A Tankerkoenig API Exporter for Prometheus. - by Lukas Malkmus

Travis Status Go Report Latest Release License Docker


Table of Contents

  1. Introduction
  2. Usage
  3. Contributing
  4. License

Introduction

The tankerkoenig_exporter is a simple server that scrapes the Tankerkoenig API for gas station prices and exports them via HTTP for Prometheus consumption.

Usage

The first step is to grab an API key from the Tankerkoenig site. After that find some station IDs. Either use the API yourself or the TankstellenFinder.

Important: Be advised to set a high scrape interval (e.g. 5min). Each scrape performs a direct API call and to frequent requests can lead to the deauthorization of your API key!

Note: Since tankerkoenig isn't a very handy word, the metric namespace is tk_.

Installation

The easiest way to run the tankerkoenig is by grabbing the latest binary from the release page.

Building from source

This project uses go mod for vendoring.

git clone https://github.com/lukasmalkmus/tankerkoenig.git
cd tankerkoenig
make build

Using the application

./tankerkoenig [flags]

Help on flags:

./tankerkoenig --help

Using docker

Docker images are now available on DockerHub!

# .env file contains TANKERKOENIG_API_KEY="YOUR_API_TOKEN"
docker run -p9386:9386/tcp --env-file=.env lukasmalkmus/tankerkoenig-exporter:v0.9.1 --api.stations="51d4b55e-a095-1aa0-e100-80009459e03a"

Contributing

Feel free to submit PRs or to fill Issues. Every kind of help is appreciated.

License

© Lukas Malkmus, 2020

Distributed under Apache License (Apache License, Version 2.0).

See LICENSE for more information.