mirror of https://github.com/arendst/Tasmota.git
Add uptime metric to prometheus exporter
I'm following the naming practices: https://prometheus.io/docs/practices/naming/ - an application prefix (tasmota_) - a unit suffix in plural form Tested building and flashing: looks like ``` tasmota_uptime_seconds 78 ```
This commit is contained in:
parent
ad46af6d54
commit
956e6f5a5c
|
@ -37,6 +37,8 @@ void HandleMetrics(void)
|
||||||
|
|
||||||
char parameter[FLOATSZ];
|
char parameter[FLOATSZ];
|
||||||
|
|
||||||
|
WSContentSend_P(PSTR("# TYPE tasmota_uptime_seconds gauge\ntasmota_uptime_seconds %d\n"), uptime);
|
||||||
|
|
||||||
if (!isnan(global_temperature)) {
|
if (!isnan(global_temperature)) {
|
||||||
dtostrfd(global_temperature, Settings.flag2.temperature_resolution, parameter);
|
dtostrfd(global_temperature, Settings.flag2.temperature_resolution, parameter);
|
||||||
WSContentSend_P(PSTR("# TYPE global_temperature gauge\nglobal_temperature %s\n"), parameter);
|
WSContentSend_P(PSTR("# TYPE global_temperature gauge\nglobal_temperature %s\n"), parameter);
|
||||||
|
|
Loading…
Reference in New Issue