Skip to content
A prometheus exporter for the Tankerkoenig API (gas prices).
Go Makefile Dockerfile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor Code grooming Jun 4, 2019
.dockerignore
.gitignore
.golangci.yml Code grooming Jun 4, 2019
.promu.yml Code grooming Jun 4, 2019
.travis.yml Code grooming Jun 4, 2019
Dockerfile Code grooming Jun 4, 2019
LICENSE Code grooming Jun 4, 2019
MAINTAINERS.md Code grooming Jun 4, 2019
Makefile Code grooming Jun 4, 2019
Makefile.common
NOTICE Code grooming Jun 4, 2019
README.md Alter README docker example Aug 8, 2019
VERSION Direct instrumentation Aug 7, 2019
go.mod Code grooming Jun 4, 2019
go.sum Code grooming Jun 4, 2019
tankerkoenig_exporter.go Direct instrumentation Aug 7, 2019

README.md

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 -e --env-file=.env lukasmalkmus/tankerkoenig-exporter:v0.7.0 \
        --api.stations="9646eb5e-b7ae-4205-bdbd-0a64abc46c20,7566fb7a-b7cc-5214-bcad-0a53abd46d14"

Contributing

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

License

© Lukas Malkmus, 2019

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

See LICENSE for more information.

You can’t perform that action at this time.