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
To run the exporter:
export TTN_API_KEY=<key>
./ttn_exporterIf you want to use Docker:
docker run -p 9981:9981 -e TTN_API_KEY=<key> ghcr.io/juusujanar/ttn-exporter:v1.0.4Help on flags:
./ttn_exporter --helpTo use this exporter, you need to generate a user or an organization API key. Gateway API keys do not work currently, because the exporter needs permissions to dynamically load a list of all available gateways (currently limited up to 100 gateways).
When you create an organization API key, you must grant it the following rights:
- List the gateways the organization is a collaborator of - required to get a list of gateways
- View gateway status - to get gateway status and metrics
When you create a user API key, you must grant it the following rights:
- List the gateways the user is a collaborator of - required to get a list of gateways
- View gateway status - to get gateway status and metrics
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/"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/"