提交 19ff8db6 编写于 作者: Z zentol

[hotfix] [metrics] Prevent registration exceptions

上级 56cdec7d
......@@ -179,8 +179,12 @@ public class MetricRegistry {
* @param group the group that contains the metric
*/
public void register(Metric metric, String metricName, AbstractMetricGroup group) {
if (reporter != null) {
reporter.notifyOfAddedMetric(metric, metricName, group);
try {
if (reporter != null) {
reporter.notifyOfAddedMetric(metric, metricName, group);
}
} catch (Exception e) {
LOG.error("Error while registering metric.", e);
}
}
......@@ -192,8 +196,12 @@ public class MetricRegistry {
* @param group the group that contains the metric
*/
public void unregister(Metric metric, String metricName, AbstractMetricGroup group) {
if (reporter != null) {
reporter.notifyOfRemovedMetric(metric, metricName, group);
try {
if (reporter != null) {
reporter.notifyOfRemovedMetric(metric, metricName, group);
}
} catch (Exception e) {
LOG.error("Error while registering metric.", e);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册