Merge pull request #8786 from mhansen/uptime-prometheus

Add uptime metric to prometheus exporter
This commit is contained in:
Theo Arends 2020-06-26 08:56:36 +02:00 committed by GitHub
commit 169d444532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,8 @@ void HandleMetrics(void)
char parameter[FLOATSZ];
WSContentSend_P(PSTR("# TYPE tasmota_uptime_seconds gauge\ntasmota_uptime_seconds %d\n"), uptime);
if (!isnan(global_temperature)) {
dtostrfd(global_temperature, Settings.flag2.temperature_resolution, parameter);
WSContentSend_P(PSTR("# TYPE global_temperature gauge\nglobal_temperature %s\n"), parameter);