Merge pull request #9930 from olcai/add-live-connections-to-prometheus-v5
feat(emqx_prometheus): expose live_connections stats to prometheus
This commit is contained in:
commit
3dea6b7913
@ -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]},
|
||||
|
||||
@ -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,
|
||||
|
||||
1
changes/v5.0.17/feat-9930.en.md
Normal file
1
changes/v5.0.17/feat-9930.en.md
Normal file
@ -0,0 +1 @@
|
||||
Expose the stats `live_connections.count` and `live_connections.max` to Prometheus.
|
||||
1
changes/v5.0.17/feat-9930.zh.md
Normal file
1
changes/v5.0.17/feat-9930.zh.md
Normal file
@ -0,0 +1 @@
|
||||
将统计数据 `live_connections.count` 和 `live_connections.max` 公开给 Prometheus.
|
||||
Loading…
Reference in New Issue
Block a user