MINOR: contrib/prometheus-exporter: Export internal errors per proxy/server
The new ST_F_EINT stats field is now exported for each proxy/server.
diff --git a/contrib/prometheus-exporter/README b/contrib/prometheus-exporter/README
index a9bd5e7..a0df4b2 100644
--- a/contrib/prometheus-exporter/README
+++ b/contrib/prometheus-exporter/README
@@ -178,6 +178,7 @@
| haproxy_frontend_http_comp_bytes_out_total | Total number of HTTP response bytes emitted by the compressor. |
| haproxy_frontend_http_comp_bytes_bypassed_total | Total number of bytes that bypassed the HTTP compressor (CPU/BW limit). |
| haproxy_frontend_http_comp_responses_total | Total number of HTTP responses that were compressed. |
+| haproxy_frontend_internal_errors_total | Total number of internal errors. |
+-------------------------------------------------+------------------------------------------------------------------------------+
* Backend metrics
@@ -230,6 +231,7 @@
| haproxy_backend_http_comp_bytes_out_total | Total number of HTTP response bytes emitted by the compressor. |
| haproxy_backend_http_comp_bytes_bypassed_total | Total number of bytes that bypassed the HTTP compressor (CPU/BW limit). |
| haproxy_backend_http_comp_responses_total | Total number of HTTP responses that were compressed. |
+| haproxy_backend_internal_errors_total | Total number of internal errors. |
+-----------------------------------------------------+--------------------------------------------------------------------------+
* Server metrics
@@ -279,6 +281,7 @@
| haproxy_server_http_responses_total | Total number of HTTP responses. |
| haproxy_server_idle_connections_current | Current number of idle connections available for reuse. |
| haproxy_server_idle_connections_limit | Limit on the number of available idle connections. |
+| haproxy_server_internal_errors_total | Total number of internal errors. |
+----------------------------------------------------+---------------------------------------------------------------------------+
Mapping of health check status :
diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c
index 4cf216a..6b828f4 100644
--- a/contrib/prometheus-exporter/service-prometheus.c
+++ b/contrib/prometheus-exporter/service-prometheus.c
@@ -234,7 +234,7 @@
[ST_F_INTERCEPTED] = ST_F_CACHE_LOOKUPS,
[ST_F_DCON] = ST_F_DSES,
[ST_F_DSES] = ST_F_WREW,
- [ST_F_WREW] = ST_F_REQ_RATE_MAX,
+ [ST_F_WREW] = ST_F_EINT,
[ST_F_CONNECT] = 0,
[ST_F_REUSE] = 0,
[ST_F_CACHE_LOOKUPS] = ST_F_CACHE_HITS,
@@ -245,6 +245,7 @@
[ST_F_CT_MAX] = 0,
[ST_F_RT_MAX] = 0,
[ST_F_TT_MAX] = 0,
+ [ST_F_EINT] = ST_F_REQ_RATE_MAX,
};
/* Matrix used to dump backend metrics. Each metric points to the next one to be
@@ -333,7 +334,7 @@
[ST_F_INTERCEPTED] = 0,
[ST_F_DCON] = 0,
[ST_F_DSES] = 0,
- [ST_F_WREW] = ST_F_CLI_ABRT,
+ [ST_F_WREW] = ST_F_EINT,
[ST_F_CONNECT] = ST_F_REUSE,
[ST_F_REUSE] = ST_F_BIN,
[ST_F_CACHE_LOOKUPS] = ST_F_CACHE_HITS,
@@ -344,6 +345,7 @@
[ST_F_CT_MAX] = ST_F_RT_MAX,
[ST_F_RT_MAX] = ST_F_TT_MAX,
[ST_F_TT_MAX] = ST_F_DREQ,
+ [ST_F_EINT] = ST_F_CLI_ABRT,
};
/* Matrix used to dump server metrics. Each metric points to the next one to be
@@ -432,7 +434,7 @@
[ST_F_INTERCEPTED] = 0,
[ST_F_DCON] = 0,
[ST_F_DSES] = 0,
- [ST_F_WREW] = ST_F_CLI_ABRT,
+ [ST_F_WREW] = ST_F_EINT,
[ST_F_CONNECT] = ST_F_REUSE,
[ST_F_REUSE] = ST_F_DRESP,
[ST_F_CACHE_LOOKUPS] = 0,
@@ -443,6 +445,7 @@
[ST_F_CT_MAX] = ST_F_RT_MAX,
[ST_F_RT_MAX] = ST_F_TT_MAX,
[ST_F_TT_MAX] = ST_F_CONNECT,
+ [ST_F_EINT] = ST_F_CLI_ABRT,
};
/* Name of all info fields */
@@ -605,6 +608,7 @@
[ST_F_CT_MAX] = IST("max_connect_time_seconds"),
[ST_F_RT_MAX] = IST("max_response_time_seconds"),
[ST_F_TT_MAX] = IST("max_total_time_seconds"),
+ [ST_F_EINT] = IST("internal_errors_total"),
};
/* Description of all info fields */
@@ -767,6 +771,7 @@
[ST_F_CT_MAX] = IST("Maximum observed time spent waiting for a connection to complete"),
[ST_F_RT_MAX] = IST("Maximum observed time spent waiting for a server response"),
[ST_F_TT_MAX] = IST("Maximum observed total request+response time (request+queue+connect+response+processing)"),
+ [ST_F_EINT] = IST("Total number of internal errors."),
};
/* Specific labels for all info fields. Empty by default. */
@@ -1085,6 +1090,7 @@
[ST_F_CT_MAX] = IST("gauge"),
[ST_F_RT_MAX] = IST("gauge"),
[ST_F_TT_MAX] = IST("gauge"),
+ [ST_F_EINT] = IST("counter"),
};
/* Return the server status: 0=DOWN, 1=UP, 2=MAINT, 3=DRAIN, 4=NOLB. */
@@ -1531,6 +1537,9 @@
case ST_F_WREW:
metric = mkf_u64(FN_COUNTER, px->fe_counters.failed_rewrites);
break;
+ case ST_F_EINT:
+ metric = mkf_u64(FN_COUNTER, px->fe_counters.internal_errors);
+ break;
case ST_F_REQ_RATE_MAX:
if (px->mode != PR_MODE_HTTP)
goto next_px;
@@ -1754,6 +1763,9 @@
case ST_F_WREW:
metric = mkf_u64(FN_COUNTER, px->be_counters.failed_rewrites);
break;
+ case ST_F_EINT:
+ metric = mkf_u64(FN_COUNTER, px->be_counters.internal_errors);
+ break;
case ST_F_CLI_ABRT:
metric = mkf_u64(FN_COUNTER, px->be_counters.cli_aborts);
break;
@@ -2002,6 +2014,9 @@
case ST_F_WREW:
metric = mkf_u64(FN_COUNTER, sv->counters.failed_rewrites);
break;
+ case ST_F_EINT:
+ metric = mkf_u64(FN_COUNTER, sv->counters.internal_errors);
+ break;
case ST_F_CLI_ABRT:
metric = mkf_u64(FN_COUNTER, sv->counters.cli_aborts);
break;