Giter Site home page Giter Site logo

prometheus-waze-exporter's Introduction

prometheus-waze-exporter

Simple Prometheus exporter to monitor the travel distance and duration thanks to Waze API

Purpose

It has been made to monitor when is the best time to commute to avoid traffic jam.

Install

Having a working Golang environment:

go install github.com/trazfr/prometheus-waze-exporter@latest

Use

It performs a query to Waze to compute 2 main metrics:

  • waze_travel_distance_meters
  • waze_travel_time_seconds

It needs a configuration file to define which travel should be monitored.

To run it, just prometheus-waze-exporter config.json

Example of configuration file

config.json:

{
    "addresses": {
        "paris": "55 Rue du Faubourg Saint-Honoré, Paris, France",
        "versailles": "Place d'Armes, Versailles, France",
        "holidays": "Bormes-les-Mimosas, France"
    },
    "paths": [
        {
            "from": "paris",
            "to": "versailles"
        },
        {
            "from": "versailles",
            "to": "paris"
        },
        {
            "from": "paris",
            "to": "holidays"
        }
    ],
    "listen": ":9091",
    "region": "row",
    "vehicle": "taxi",
    "avoid_toll": true,
    "avoid_subscription_road": true,
    "avoid_ferry": true,
    "sleep": 500
}
  • region may be:

    • us for the United States
    • il for Israel
    • row, this is the default value
  • vehicle may be:

    • empty (""), it is a regular car. This is the default value if not defined
    • taxi
    • motorcycle
  • avoid_toll, avoid_subscription_road and avoid_ferry are booleans. Their default value is false.

  • sleep is an integer. It represents the number of milliseconds to wait between two calls to Waze API. Its default value is 500ms.

  • listen is :9091 if unset, so you may configure in your scrape config if Prometheus is running on the same server:

- job_name: prometheus-waze-exporter
  scrape_timeout: 1m
  scrape_interval: 5m
  static_configs:
  - targets: ['127.0.0.1:9091']

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.