/baletheus

Balena Service Discovery for Prometheus

Primary LanguageTypeScript

baletheus: balenaCloud Service Discovery for Prometheus

Monitor your balenaCloud devices with Prometheus directly via the file service discovery (sd) mechanism.

How to use:

This project will deploy a full Prometheus instance to a device, along with a sidecar for balenaCloud device discovery. By default the device discovery will include all devices owned by the user who deploys this project.

Deploy directly to balenaCloud to run a Prometheus instance with a sidecar sd daemon. The sd sidecar writes to a shared volume that Prometheus reads from directly.

To deploy:

  1. Create an account on balenaCloud
  2. Provision a device
  3. Deploy this project to the application containing the device
  4. Generate an API key to use in this project
  5. Set the API_KEY value in balenaCloud
  6. Access the Prometheus instance via public URL port 80
  • Note that if you are using public URLs, you will need to do that manually (the daemon does not modify that property on the devices)

baletheus Configuration options

Pass in an API_KEY value via balenaCloud or in the environment

All other runtime configuration is done via environment variables:

SD_FILE_PATH: PATH (required) File path to write devices to
REFRESH_RATE: NUMBER Refresh interval (ms) (default: 5000)
USE_PUBLIC_URLS: BOOLEAN Enable scraping via public URL
WRITE_EMPTY: BOOLEAN Enable writing file without any devices (disable failsafe)

Labels:

Exported labels include:

device_name: string,
uuid: string,
device_type: string,
commit: string,
os_version: string,
os_variant: string,
supervisor_version: string

NOTE:

At this point, only one sidecar per device is supported. A meta-exporter is in the works, stay tuned!