mirror of
https://github.com/jomjol/AI-on-the-edge-device-docs.git
synced 2025-12-07 03:57:00 +03:00
add documentation prometheus integration (#55)
This commit is contained in:
44
docs/prometheus-openmetrics.md
Normal file
44
docs/prometheus-openmetrics.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Prometheus/OpenMetrics
|
||||
|
||||
A set of metrics is exported via the `/metrics` path on the device. Besides the current value, a set of device properties are exported. Multiple sequences (aka *numbers*) are supported via a label. The metrics are provided in text wire format.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
$ curl http://192.168.178.23/metrics
|
||||
# HELP ai_on_the_edge_device_flow_value current value of meter readout
|
||||
# TYPE ai_on_the_edge_device_flow_value gauge
|
||||
ai_on_the_edge_device_flow_value{sequence="main"} 240.7064
|
||||
# HELP ai_on_the_edge_device_cpu_temperature_celsius current cpu temperature in celsius
|
||||
# TYPE ai_on_the_edge_device_cpu_temperature_celsius gauge
|
||||
ai_on_the_edge_device_cpu_temperature_celsius 41
|
||||
# HELP ai_on_the_edge_device_rssi_dbm current WiFi signal strength in dBm
|
||||
# TYPE ai_on_the_edge_device_rssi_dbm gauge
|
||||
ai_on_the_edge_device_rssi_dbm -67
|
||||
# HELP ai_on_the_edge_device_memory_heap_free_bytes available heap memory
|
||||
# TYPE ai_on_the_edge_device_memory_heap_free_bytes gauge
|
||||
ai_on_the_edge_device_memory_heap_free_bytes 716303
|
||||
# HELP ai_on_the_edge_device_uptime_seconds device uptime in seconds
|
||||
# TYPE ai_on_the_edge_device_uptime_seconds gauge
|
||||
ai_on_the_edge_device_uptime_seconds 214267
|
||||
# HELP ai_on_the_edge_device_rounds_total data aquisition rounds since device startup
|
||||
# TYPE ai_on_the_edge_device_rounds_total counter
|
||||
ai_on_the_edge_device_rounds_total 239
|
||||
```
|
||||
|
||||
## Prometheus Scrape Config
|
||||
|
||||
The following scrape config (add to `prometheus.yml`) can be used as an example to ingest available metrics with prometheus:
|
||||
|
||||
```
|
||||
scrape_configs:
|
||||
- job_name: watermeter
|
||||
scrape_interval: 300s
|
||||
metrics_path: /metrics
|
||||
static_configs:
|
||||
- targets: ['192.168.178.23']
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
- [OpenMetrics](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md)
|
||||
Reference in New Issue
Block a user