Skip to main content

Prometheus exporter for Airthings devices

Project description

Airthings Exporter

Prometheus exporter for Airthings devices.

Requirements

  • Python 3
  • Airthings device

Setup

  • Register your Airthings device to sync with the cloud following the instructions manual
  • Check the Airthings app or the web dashboard to obtain your device serial number. This is your client id
  • Go to the Airthings Integrations webpage and request an API Client to obtain a client secret
  • Install airthings-exporter
pip install airthings-exporter

Usage

# Start server (1 device)
airthings-exporter --client-id [client_id] --client-secret [client_secret] --device-id [device_id]

# Start server (2 devices)
airthings-exporter --client-id [client_id] --client-secret [client_secret] --device-id [device_id_1] --device-id [device_id_2]

# Test server works
curl -s localhost:8000

Tested Devices

  • Airthings View Plus
  • Airthings Wave Mini

Example Prometheus configuration file (prometheus.yml)

scrape_configs:
  - job_name: 'airthings'
    scrape_interval: 5m
    scrape_timeout: 10s
    static_configs:
      - targets: ['localhost:8000']

API limitations

Airthings API for consumers allows only up to 120 requests per hour. Every scrape in prometheus sends one request per device to the Airthings API. Make sure the configured prometheus scrape interval does not exceed the limit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airthings-exporter-0.0.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

airthings_exporter-0.0.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file airthings-exporter-0.0.3.tar.gz.

File metadata

  • Download URL: airthings-exporter-0.0.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for airthings-exporter-0.0.3.tar.gz
Algorithm Hash digest
SHA256 19f6145b0f7d5ee696bc626a8e042c9e4c02126d4ce74feb849cf2137e854142
MD5 8cf4fb3510b18b9d413d79e5cba5947f
BLAKE2b-256 dc4d3dd5f31bbd96452d9894b5f4ffdcf2b075996a1a018dc3b921f417457b86

See more details on using hashes here.

File details

Details for the file airthings_exporter-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for airthings_exporter-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef0071501f7b3ba7a1a69ea5b6f64812549dd0280583f4879037b3a716dcc0b7
MD5 4e766b079b78554863df15a7867704d1
BLAKE2b-256 17b033ab20432a71082f0c8f287f354d8a9bd8c1fc3996ba95198327ed241d8e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page