diff --git a/apps/emqx_prometheus/src/emqx_prometheus.app.src b/apps/emqx_prometheus/src/emqx_prometheus.app.src index 31f8cbfaf..013de63fb 100644 --- a/apps/emqx_prometheus/src/emqx_prometheus.app.src +++ b/apps/emqx_prometheus/src/emqx_prometheus.app.src @@ -2,7 +2,7 @@ {application, emqx_prometheus, [ {description, "Prometheus for EMQX"}, % strict semver, bump manually! - {vsn, "5.0.4"}, + {vsn, "5.0.5"}, {modules, []}, {registered, [emqx_prometheus_sup]}, {applications, [kernel, stdlib, prometheus, emqx]}, diff --git a/apps/emqx_prometheus/src/emqx_prometheus.erl b/apps/emqx_prometheus/src/emqx_prometheus.erl index a66f275f8..4712a43c8 100644 --- a/apps/emqx_prometheus/src/emqx_prometheus.erl +++ b/apps/emqx_prometheus/src/emqx_prometheus.erl @@ -219,6 +219,10 @@ emqx_collect(emqx_connections_count, Stats) -> gauge_metric(?C('connections.count', Stats)); emqx_collect(emqx_connections_max, Stats) -> gauge_metric(?C('connections.max', Stats)); +emqx_collect(emqx_live_connections_count, Stats) -> + gauge_metric(?C('live_connections.count', Stats)); +emqx_collect(emqx_live_connections_max, Stats) -> + gauge_metric(?C('live_connections.max', Stats)); %% sessions emqx_collect(emqx_sessions_count, Stats) -> gauge_metric(?C('sessions.count', Stats)); @@ -460,6 +464,8 @@ emqx_stats() -> [ emqx_connections_count, emqx_connections_max, + emqx_live_connections_count, + emqx_live_connections_max, emqx_sessions_count, emqx_sessions_max, emqx_topics_count, diff --git a/changes/v5.0.17/feat-9930.en.md b/changes/v5.0.17/feat-9930.en.md new file mode 100644 index 000000000..1747bb23e --- /dev/null +++ b/changes/v5.0.17/feat-9930.en.md @@ -0,0 +1 @@ +Expose the stats `live_connections.count` and `live_connections.max` to Prometheus. diff --git a/changes/v5.0.17/feat-9930.zh.md b/changes/v5.0.17/feat-9930.zh.md new file mode 100644 index 000000000..d17c1cf68 --- /dev/null +++ b/changes/v5.0.17/feat-9930.zh.md @@ -0,0 +1 @@ +将统计数据 `live_connections.count` 和 `live_connections.max` 公开给 Prometheus.