diff --git a/doc/prometheus_ep_description.md b/doc/prometheus_ep_description.md index 9d274f1e..8fb9e002 100644 --- a/doc/prometheus_ep_description.md +++ b/doc/prometheus_ep_description.md @@ -18,6 +18,8 @@ Prometheus metrics provided at `/metrics`. | Metric name | Type | Description | Labels | |----------------------------------------|---------|--------------------------------------------------------|--------------| | `ahoy_solar_info` | Gauge | Information about the AhoyDTU device | version, image, devicename | +| `ahoy_solar_uptime` | Counter | Seconds since boot of the AhoyDTU device | devicename | +| `ahoy_solar_rssi_db` | Gauge | Quality of the Wifi STA connection | devicename | | `ahoy_solar_inverter_info` | Gauge | Information about the configured inverter(s) | name, serial | | `ahoy_solar_inverter_enabled` | Gauge | Is the inverter enabled? | inverter | | `ahoy_solar_inverter_is_available` | Gauge | is the inverter available? | inverter | diff --git a/src/CHANGES.md b/src/CHANGES.md index e120702d..e9f3ea32 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -2,6 +2,11 @@ (starting from release version `0.5.66`) +## 0.5.107 +* fix: show save message +* fix: removed serial newline for `enqueueCmd` +* Merged improved Prometheus #808 + ## 0.5.106 * merged MI and debug message changes #804 * fixed MQTT autodiscover #794, #632 diff --git a/src/defines.h b/src/defines.h index d0c57264..05cbd23b 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 5 -#define VERSION_PATCH 106 +#define VERSION_PATCH 107 //------------------------------------- typedef struct { diff --git a/src/web/web.h b/src/web/web.h index d4e58e70..ce988c34 100644 --- a/src/web/web.h +++ b/src/web/web.h @@ -688,8 +688,17 @@ class Web { mApp->getVersion(), mConfig->sys.deviceName); metrics = String(type) + String(topic); - snprintf(topic,sizeof(topic),"# TYPE ahoy_solar_freeheap gauge\nahoy_solar_freeheap{devicename=\"%s\"} %u\n",mConfig->sys.deviceName,ESP.getFreeHeap()); - metrics += String(topic); + snprintf(type,sizeof(type),"# TYPE ahoy_solar_freeheap gauge\n"); + snprintf(topic,sizeof(topic),"ahoy_solar_freeheap{devicename=\"%s\"} %u\n",mConfig->sys.deviceName,ESP.getFreeHeap()); + metrics += String(type) + String(topic); + + snprintf(type,sizeof(type),"# TYPE ahoy_solar_uptime counter\n"); + snprintf(topic,sizeof(topic),"ahoy_solar_uptime{devicename=\"%s\"} %u\n", mConfig->sys.deviceName, mApp->getUptime()); + metrics += String(type) + String(topic); + + snprintf(type,sizeof(type),"# TYPE ahoy_solar_wifi_rssi_db gauge\n"); + snprintf(topic,sizeof(topic),"ahoy_solar_wifi_rssi_db{devicename=\"%s\"} %d\n", mConfig->sys.deviceName, WiFi.RSSI()); + metrics += String(type) + String(topic); // NRF Statistics stat = mApp->getStatistics(); @@ -799,7 +808,7 @@ class Web { String radioStatistic(String statistic, uint32_t value) { char type[60], topic[80], val[25]; - snprintf(type, sizeof(type), "# TYPE ahoy_solar_radio_%s gauge",statistic.c_str()); + snprintf(type, sizeof(type), "# TYPE ahoy_solar_radio_%s counter",statistic.c_str()); snprintf(topic, sizeof(topic), "ahoy_solar_radio_%s",statistic.c_str()); snprintf(val, sizeof(val), "%d", value); return ( String(type) + "\n" + String(topic) + " " + String(val) + "\n");