Giter VIP home page Giter VIP logo

prometheus-owntracks-exporter's Introduction

Prometheus OwnTracks Exporter

A simple Python HTTP server exporting OwnTracks Recorder stats for Prometheus

Build (Docker) Lint Docker Pulls License Black

Installation

Docker

Pre-built Docker images are available on Docker Hub: linusgroh/prometheus-owntracks-exporter

docker run -d \
  -v "/path/to/owntracks/storage:/owntracks" \
  -e OWNTRACKS_STORAGEDIR="/owntracks" \
  -e OWNTRACKS_URL="http://owntracks-recorder:8083" \
  linusgroh/prometheus-owntracks-exporter

Docker Compose

services:
  owntracks-recorder:
    ...

  prometheus:
    ...

  prometheus-owntracks-exporter:
    image: linusgroh/prometheus-owntracks-exporter
    depends_on:
      - prometheus
    volumes:
      - /path/to/owntracks/storage:/owntracks
    environment:
      OWNTRACKS_STORAGEDIR: /owntracks
      OWNTRACKS_URL: http://owntracks-recorder:8083

Manually

poetry install --no-root --no-dev
poetry run python main.py

Development

poetry install --no-root
poetry run uvicorn main:app --reload

Configuration

Configuration is done via environment variables (or by adding a .env file).

Name Description Default
DEBUG Run the underlying Starlette ASGI app in debug mode False
OWNTRACKS_STORAGEDIR Path to the OwnTracks Recorder storage directory (OTR_STORAGEDIR, --storagedir)
OWNTRACKS_URL Base URL to the OwnTracks Recorder's HTTP API (without /api/...)
SERVER_HOST HTTP server host "0.0.0.0"
SERVER_PORT HTTP server port 80
UPDATE_INTERVAL Interval in which the metrics are updated (in seconds) 60

prometheus.yml

scrape_configs:
  - job_name: 'owntracks'
    static_configs:
      - targets: ['prometheus-owntracks-exporter:80']

Metrics

Name Description
owntracks_cards_count Total number of cards
owntracks_devices_count Total number of devices
owntracks_last_locations_count Total number of last locations
owntracks_last_received_timestamp Timestamp of the last received message
owntracks_locations_count Total number of locations
owntracks_storagedir_size Size of the OwnTracks Recorder's storage directory in bytes
owntracks_users_count Total number of users
owntracks_version_info OwnTracks Recorder version
owntracks_waypoints_count Total number of waypoints

Grafana

A simple Grafana dashboard is available in grafana/owntracks.json.

prometheus-owntracks-exporter's People

Contributors

linusg avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jlrgraham

prometheus-owntracks-exporter's Issues

Data dont get updated

Hi,
I have the exporter running. The logs show that data is published but in grafana updates only show when the container is rebooted.
I guess the exporter does not grap the data vom the recoder database every 60sec. Wouldnt it be better to use the recorders api for gathering the data?
regards

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.