This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch 5.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/5.2 by this push:
new 74a4d48e0f PHOENIX-7604 Log exceptions in GlobalClientMetrics static
initializer (#2142)
74a4d48e0f is described below
commit 74a4d48e0fa5318ee0d47183c28d42b126248664
Author: Istvan Toth <[email protected]>
AuthorDate: Thu May 8 17:02:24 2025 +0200
PHOENIX-7604 Log exceptions in GlobalClientMetrics static initializer
(#2142)
---
.../apache/phoenix/monitoring/GlobalClientMetrics.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git
a/phoenix-core-client/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
b/phoenix-core-client/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
index 1867643002..36767d9a86 100644
---
a/phoenix-core-client/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
+++
b/phoenix-core-client/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
@@ -175,11 +175,16 @@ public enum GlobalClientMetrics {
private GlobalMetric metric;
static {
- initPhoenixGlobalClientMetrics();
- if (isGlobalMetricsEnabled) {
- MetricRegistry metricRegistry = createMetricRegistry();
- registerPhoenixMetricsToRegistry(metricRegistry);
-
GlobalMetricRegistriesAdapter.getInstance().registerMetricRegistry(metricRegistry);
+ try {
+ initPhoenixGlobalClientMetrics();
+ if (isGlobalMetricsEnabled) {
+ MetricRegistry metricRegistry = createMetricRegistry();
+ registerPhoenixMetricsToRegistry(metricRegistry);
+
GlobalMetricRegistriesAdapter.getInstance().registerMetricRegistry(metricRegistry);
+ }
+ } catch (Throwable t) {
+ LOGGER.error("Failed to initialize GlobalClientMetrics", t);
+ throw t;
}
}