Skip to content

Commit

Permalink
Disable Prometheus exporter by default, to enable uncomment METRICS i…
Browse files Browse the repository at this point in the history
…n config.h
  • Loading branch information
dzungpv committed Oct 27, 2023
1 parent c07ebee commit 78fe3fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions main/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,5 @@ const char *const language_names[] = {
#endif

static constexpr uint8_t NUM_LANGUAGES = sizeof(languages) / sizeof(const char *);

// #define METRICS 1 // un comment to enable Prometheus exporter
2 changes: 1 addition & 1 deletion main/languages/vi-VN.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace vi
// Page Status
const char txt_status_title[] PROGMEM = "Trạng thái";
const char txt_status_hvac[] PROGMEM = "Trạng thái ĐH";
const char txt_retries_hvac[] PROGMEM = "HVAC Connection Retries";
const char txt_retries_hvac[] PROGMEM = "ĐH thử lại kết nối";
const char txt_status_mqtt[] PROGMEM = "Trạng thái MQTT";
const char txt_status_wifi_ip[] PROGMEM = "WIFI IP";
const char txt_failed_get_wifi_ip[] PROGMEM = "Lỗi khi lấy địa chỉ IP";
Expand Down
4 changes: 4 additions & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
#include "html_init.h" // code html for initial config
#include "html_menu.h" // code html for menu
#include "html_pages.h" // code html for pages
#ifdef METRICS
#include "html_metrics.h" // prometheus metrics
#endif

// Start header for build with IDF and Platformio
bool loadWifi();
Expand Down Expand Up @@ -213,7 +215,9 @@ void setup()
server.on("/unit", handleUnit);
server.on("/status", handleStatus);
server.on("/others", handleOthers);
#ifdef METRICS
server.on("/metrics", handleMetrics);
#endif
server.onNotFound(handleNotFound);
if (login_password.length() > 0)
{
Expand Down

0 comments on commit 78fe3fd

Please sign in to comment.