Skip to content

juusujanar/ttn-exporter

Repository files navigation

Prometheus exporter for The Things Network

This collects data from The Things Stack API and exports it via HTTP for Prometheus.

Works with:

  • The Things Network v3 Community edition - tested, default
  • Things Industries - untested
  • self-hosted Things Stack instances - untested

Badges

Release Software License Build status Go Doc Conventional Commits

Quick start

To run the exporter:

export TTN_API_KEY=<key>
./ttn_exporter

If you want to use Docker:

docker run -p 9981:9981 -e TTN_API_KEY=<key> ghcr.io/juusujanar/ttn-exporter:v1.0.4

Help on flags:

./ttn_exporter --help

Usage

API keys

To use this exporter, you need to generate an API key and grant it the following rights:

  • List the gateways the organization is a collaborator of - required when consuming organization gateways
  • View gateway status - to get gateway status and metrics

TTN URL

Specify custom URLs for which Things Stack instance to use using the --ttn.uri flag. Exporter defaults to Things Network Community Edition in Europe (eu1.cloud.thethings.network). For example, if you want to use enterprise Things Industries,

TTN_API_KEY=<key> ttn_exporter --ttn.uri="https://<tenant>.<region>.cloud.thethings.industries/"

Docker

To run the exporter as a Docker container, run:

docker run -p 9981:9981 -e TTN_API_KEY=<key> ghcr.io/juusujanar/ttn-exporter:v1.0.4 --ttn.uri="https://<tenant>.<region>.cloud.thethings.industries/"