From 3233a40af3289c4ce031984d072f2d39370c538c Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Wed, 26 Oct 2022 21:58:51 +0800 Subject: [PATCH] chore: don't delete bpapi when 5.0.x --- apps/emqx_prometheus/src/emqx_prometheus.erl | 14 ++++++++++++++ .../src/proto/emqx_prometheus_proto_v1.erl | 4 +++- changes/v5.0.10-en.md | 5 +++-- changes/v5.0.10-zh.md | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/emqx_prometheus/src/emqx_prometheus.erl b/apps/emqx_prometheus/src/emqx_prometheus.erl index 32f9928fb..de9349b97 100644 --- a/apps/emqx_prometheus/src/emqx_prometheus.erl +++ b/apps/emqx_prometheus/src/emqx_prometheus.erl @@ -59,6 +59,12 @@ -export([collect/1]). +-export([ + %% For bpapi, deprecated_since 5.0.10, remove this when 5.1.x + do_start/0, + do_stop/0 +]). + -define(C(K, L), proplists:get_value(K, L, 0)). -define(TIMER_MSG, '#interval'). @@ -591,3 +597,11 @@ emqx_cluster_data() -> {nodes_running, length(Running)}, {nodes_stopped, length(Stopped)} ]. + +%% deprecated_since 5.0.10, remove this when 5.1.x +do_start() -> + emqx_prometheus_sup:start_child(?APP). + +%% deprecated_since 5.0.10, remove this when 5.1.x +do_stop() -> + emqx_prometheus_sup:stop_child(?APP). diff --git a/apps/emqx_prometheus/src/proto/emqx_prometheus_proto_v1.erl b/apps/emqx_prometheus/src/proto/emqx_prometheus_proto_v1.erl index c0529cabd..e11f8e3ad 100644 --- a/apps/emqx_prometheus/src/proto/emqx_prometheus_proto_v1.erl +++ b/apps/emqx_prometheus/src/proto/emqx_prometheus_proto_v1.erl @@ -20,13 +20,15 @@ -export([ introduced_in/0, - + deprecated_since/0, start/1, stop/1 ]). -include_lib("emqx/include/bpapi.hrl"). +deprecated_since() -> "5.0.10". + introduced_in() -> "5.0.0". diff --git a/changes/v5.0.10-en.md b/changes/v5.0.10-en.md index 2b49aebf0..4bb7332f9 100644 --- a/changes/v5.0.10-en.md +++ b/changes/v5.0.10-en.md @@ -8,9 +8,10 @@ - Improve memory usage on core nodes when bootstrapping a replicant [#9236](https://github.com/emqx/emqx/pull/9236). -- Improve the stability of prometheus push_gateway and print error logs when POST fails [#9235](http://github.com/emqx/emqx/pull/9235). +- Improve stability of Prometheus Push Gateway and log errors when POST fails [#9235](http://github.com/emqx/emqx/pull/9235). -- Now we can disable some internal prometheus metrics. Closing some metrics that are not cared about when the prometheus/stats API timeout ( the machine load is too high ). [#9222](https://github.com/emqx/emqx/pull/9222). +- Now it is possible to opt out VM internal metrics in prometheus stats [#9222](https://github.com/emqx/emqx/pull/9222). + When system load is high, reporting too much metrics data may cause the prometheus stats API timeout. ## Bug fixes diff --git a/changes/v5.0.10-zh.md b/changes/v5.0.10-zh.md index 636e7fbd6..df5a16eed 100644 --- a/changes/v5.0.10-zh.md +++ b/changes/v5.0.10-zh.md @@ -8,7 +8,7 @@ - 在引导 `replicant` 节点时,改善 `core` 节点的内存使用量 [#9236](https://github.com/emqx/emqx/pull/9236)。 -- 增加 prometheus push_gateway 的稳定性, 并在 POST 失败时打印错误日志 [#9235](http://github.com/emqx/emqx/pull/9235)。 +- 增加 Prometheus Push Gateway 的稳定性, 并在 POST 失败时打印错误日志 [#9235](http://github.com/emqx/emqx/pull/9235)。 - 可通过配置关闭 prometheus 中的部分内部指标,如果遇到机器负载过高 prometheus 接口返回超时可考虑关闭部分不关心指标,以提高响应速度 [#9222](https://github.com/emqx/emqx/pull/9222)。