Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/balena-io-examples/baletheus
Balena Service Discovery for Prometheus
https://github.com/balena-io-examples/baletheus
balena prometheus typescript
Last synced: about 1 month ago
JSON representation
Balena Service Discovery for Prometheus
- Host: GitHub
- URL: https://github.com/balena-io-examples/baletheus
- Owner: balena-io-examples
- License: mit
- Created: 2019-03-02T00:54:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T20:42:49.000Z (over 1 year ago)
- Last Synced: 2024-11-06T08:43:03.347Z (about 2 months ago)
- Topics: balena, prometheus, typescript
- Language: TypeScript
- Homepage:
- Size: 842 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://dashboard.balena-cloud.com)
1. [Provision a device](https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/)
1. [Deploy this project to the application containing the
device](https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/#deploy-code)
1. Generate an [API key](https://www.balena.io/docs/learn/manage/account/#api-keys) to use in this project
1. [Set the API_KEY value in balenaCloud](https://www.balena.io/docs/learn/manage/serv-vars/)
1. 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
All runtime configuration is done via environment variables:
| Environment Variable Name | Type | Required? | Use |
|:-----------|:------------|:------------|:------------|
| `API_KEY` | string | true | Key to access balenaCloud API |
| `APPLICATION` | string or number | false | Application to filter devices (either number or name) |
| `SD_FILE_PATH` | string | false | File path to write devices to |
| `REFRESH_RATE` | number | false | Refresh interval (ms) (default | 5000) |
| `USE_PUBLIC_URLS` | boolean | false | Enable scraping via public URL |
| `WRITE_EMPTY` | boolean | false | Enable writing file without any devices (disable failsafe) |## Labels:
Exported labels include:
| Label | Type |
|:-----------|:------------|
| 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!