This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 087bf8aee8 Improves organization of manager metrics code (#6181)
087bf8aee8 is described below
commit 087bf8aee8af8660af7d383d16b262be1cf6c5cc
Author: Keith Turner <[email protected]>
AuthorDate: Thu Mar 5 13:08:16 2026 -0800
Improves organization of manager metrics code (#6181)
The manager metrics setup code was spread over multiple classes and
functions. Pulled setting up metrics into a single function in the
manager.
The tablet group watcher metrics code existed in manager code. Pulled
TGW metrics code into the TGW code for better encapsulation and
simplification of the manger code.
* code review update
* code review update
---
.../org/apache/accumulo/core/metrics/Metric.java | 8 +-
.../java/org/apache/accumulo/manager/Manager.java | 66 ++++++-----
.../accumulo/manager/TabletGroupWatcher.java | 76 +++++++++++-
.../accumulo/manager/metrics/ManagerMetrics.java | 128 ---------------------
.../compaction/BadCompactionServiceConfigIT.java | 6 +-
5 files changed, 120 insertions(+), 164 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/metrics/Metric.java
b/core/src/main/java/org/apache/accumulo/core/metrics/Metric.java
index cfbab66ec9..4898ff4eb8 100644
--- a/core/src/main/java/org/apache/accumulo/core/metrics/Metric.java
+++ b/core/src/main/java/org/apache/accumulo/core/metrics/Metric.java
@@ -37,7 +37,13 @@ public enum Metric {
"Time to execute an RPC request.", MetricDocSection.GENERAL_SERVER),
// Compactor Metrics
- COMPACTION_SVC_ERRORS("accumulo.compaction.svc.misconfigured",
MetricType.GAUGE,
+ COMPACTION_ROOT_SVC_ERRORS("accumulo.compaction.svc.root.misconfigured",
MetricType.GAUGE,
+ "A value of 1 indicates a misconfiguration in the compaction service,
while a value of 0 indicates that the configuration is valid.",
+ MetricDocSection.COMPACTION),
+ COMPACTION_META_SVC_ERRORS("accumulo.compaction.svc.meta.misconfigured",
MetricType.GAUGE,
+ "A value of 1 indicates a misconfiguration in the compaction service,
while a value of 0 indicates that the configuration is valid.",
+ MetricDocSection.COMPACTION),
+ COMPACTION_USER_SVC_ERRORS("accumulo.compaction.svc.user.misconfigured",
MetricType.GAUGE,
"A value of 1 indicates a misconfiguration in the compaction service,
while a value of 0 indicates that the configuration is valid.",
MetricDocSection.COMPACTION),
COMPACTOR_MAJC_CANCELLED("accumulo.compaction.majc.cancelled",
MetricType.FUNCTION_COUNTER,
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
index b50654a90b..34ad7ceaf3 100644
--- a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
+++ b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
@@ -22,9 +22,11 @@ import static
com.google.common.util.concurrent.Uninterruptibles.sleepUninterrup
import static java.lang.Thread.State.NEW;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.emptySortedMap;
+import static java.util.Objects.requireNonNull;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.apache.accumulo.core.metrics.Metric.MANAGER_GOAL_STATE;
import static
org.apache.accumulo.core.util.threads.ThreadPoolNames.FILE_RENAME_POOL;
import java.io.IOException;
@@ -39,7 +41,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.SortedMap;
@@ -103,7 +104,6 @@ import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
import org.apache.accumulo.core.metrics.MetricsInfo;
-import org.apache.accumulo.core.metrics.MetricsProducer;
import org.apache.accumulo.core.trace.TraceUtil;
import org.apache.accumulo.core.util.Retry;
import org.apache.accumulo.core.util.Timer;
@@ -114,7 +114,8 @@ import org.apache.accumulo.core.util.time.SteadyTime;
import org.apache.accumulo.core.zookeeper.ZcStat;
import
org.apache.accumulo.manager.compaction.coordinator.CompactionCoordinator;
import org.apache.accumulo.manager.merge.FindMergeableRangeTask;
-import org.apache.accumulo.manager.metrics.ManagerMetrics;
+import org.apache.accumulo.manager.metrics.fate.meta.MetaFateMetrics;
+import org.apache.accumulo.manager.metrics.fate.user.UserFateMetrics;
import org.apache.accumulo.manager.recovery.RecoveryManager;
import org.apache.accumulo.manager.split.FileRangeCache;
import org.apache.accumulo.manager.split.Splitter;
@@ -157,6 +158,7 @@ import com.google.common.net.HostAndPort;
import com.google.common.util.concurrent.RateLimiter;
import com.google.common.util.concurrent.Uninterruptibles;
+import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.MeterRegistry;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.context.Scope;
@@ -214,8 +216,6 @@ public class Manager extends AbstractServer
private final AtomicReference<Map<FateInstanceType,Fate<FateEnv>>> fateRefs =
new AtomicReference<>();
- private final ManagerMetrics managerMetrics = new ManagerMetrics();
-
static class TServerStatus {
// This is the set of tservers that an attempt to gather status from was
made
final LiveTServersSnapshot snapshot;
@@ -336,8 +336,8 @@ public class Manager extends AbstractServer
*/
public Fate<FateEnv> fate(FateInstanceType type) {
waitForFate();
- var fate = Objects.requireNonNull(fateRefs.get(), "fateRefs is not set
yet").get(type);
- return Objects.requireNonNull(fate, () -> "fate type " + type + " is not
present");
+ var fate = requireNonNull(fateRefs.get(), "fateRefs is not set
yet").get(type);
+ return requireNonNull(fate, () -> "fate type " + type + " is not present");
}
public FateClient<FateEnv> fateClient(FateInstanceType type) {
@@ -558,11 +558,11 @@ public class Manager extends AbstractServer
byte[] data =
getContext().getZooSession().asReaderWriter().getData(Constants.ZMANAGER_GOAL_STATE);
ManagerGoalState goal = ManagerGoalState.valueOf(new String(data,
UTF_8));
- try {
- managerMetrics.updateManagerGoalState(goal);
- } catch (IllegalStateException e) {
- log.warn("Error updating goal state metric", e);
- }
+ metricsGoalState.set(switch (goal) {
+ case CLEAN_STOP -> 0;
+ case SAFE_MODE -> 1;
+ case NORMAL -> 2;
+ });
return goal;
} catch (Exception e) {
log.error("Problem getting real goal state from zookeeper: ", e);
@@ -925,6 +925,26 @@ public class Manager extends AbstractServer
return info;
}
+ private void setupMetrics() {
+ MetricsInfo metricsInfo = getContext().getMetricsInfo();
+ metricsInfo.addMetricsProducers(balanceManager.getMetrics());
+ // ensure all tablet group watchers are setup
+ Preconditions.checkState(watchers.size() == DataLevel.values().length);
+ watchers.forEach(watcher ->
metricsInfo.addMetricsProducers(watcher.getMetrics()));
+ metricsInfo.addMetricsProducers(requireNonNull(compactionCoordinator));
+ // ensure fate is completely setup
+ Preconditions.checkState(fateReadyLatch.getCount() == 0);
+ metricsInfo.addMetricsProducers(new MetaFateMetrics(getContext(),
+
getConfiguration().getTimeInMillis(Property.MANAGER_FATE_METRICS_MIN_UPDATE_INTERVAL),
+ fate(FateInstanceType.META).getFateExecutors()));
+ metricsInfo.addMetricsProducers(new UserFateMetrics(getContext(),
+
getConfiguration().getTimeInMillis(Property.MANAGER_FATE_METRICS_MIN_UPDATE_INTERVAL),
+ fate(FateInstanceType.USER).getFateExecutors()));
+ metricsInfo.addMetricsProducers(this);
+ metricsInfo.init(MetricsInfo.serviceTags(getContext().getInstanceName(),
getApplicationName(),
+ getAdvertiseAddress(), getResourceGroup()));
+ }
+
@Override
public void run() {
final ServerContext context = getContext();
@@ -1018,13 +1038,8 @@ public class Manager extends AbstractServer
throw new IllegalStateException("Unable to read " + Constants.ZRECOVERY,
e);
}
- MetricsInfo metricsInfo = getContext().getMetricsInfo();
- List<MetricsProducer> producers = new ArrayList<>();
- producers.add(this);
- producers.add(balanceManager.getMetrics());
-
final TabletGroupWatcher userTableTGW =
- new TabletGroupWatcher(this, this.userTabletStore, null,
managerMetrics) {
+ new TabletGroupWatcher(this, this.userTabletStore, null) {
@Override
boolean canSuspendTablets() {
// Always allow user data tablets to enter suspended state.
@@ -1034,7 +1049,7 @@ public class Manager extends AbstractServer
watchers.add(userTableTGW);
final TabletGroupWatcher metadataTableTGW =
- new TabletGroupWatcher(this, this.metadataTabletStore,
watchers.get(0), managerMetrics) {
+ new TabletGroupWatcher(this, this.metadataTabletStore,
watchers.get(0)) {
@Override
boolean canSuspendTablets() {
// Allow metadata tablets to enter suspended state only if so
configured. Generally
@@ -1047,7 +1062,7 @@ public class Manager extends AbstractServer
watchers.add(metadataTableTGW);
final TabletGroupWatcher rootTableTGW =
- new TabletGroupWatcher(this, this.rootTabletStore, watchers.get(1),
managerMetrics) {
+ new TabletGroupWatcher(this, this.rootTabletStore, watchers.get(1)) {
@Override
boolean canSuspendTablets() {
// Never allow root tablet to enter suspended state.
@@ -1156,16 +1171,12 @@ public class Manager extends AbstractServer
throw new IllegalStateException(
"Unexpected previous fate reference map already initialized");
}
- managerMetrics.configureFateMetrics(getConfiguration(), this,
fateRefs.get());
fateReadyLatch.countDown();
} catch (KeeperException | InterruptedException e) {
throw new IllegalStateException("Exception setting up FaTE cleanup
thread", e);
}
- producers.addAll(managerMetrics.getProducers(this));
- metricsInfo.addMetricsProducers(producers.toArray(new MetricsProducer[0]));
- metricsInfo.init(MetricsInfo.serviceTags(getContext().getInstanceName(),
getApplicationName(),
- getAdvertiseAddress(), getResourceGroup()));
+ setupMetrics();
ThreadPools.watchCriticalScheduledTask(context.getScheduledExecutor()
.scheduleWithFixedDelay(() ->
ScanServerMetadataEntries.clean(context), 10, 10, MINUTES));
@@ -1631,10 +1642,13 @@ public class Manager extends AbstractServer
return upgradeCoordinator.getStatus() !=
UpgradeCoordinator.UpgradeStatus.COMPLETE;
}
+ private final AtomicInteger metricsGoalState = new AtomicInteger(-1);
+
@Override
public void registerMetrics(MeterRegistry registry) {
super.registerMetrics(registry);
- compactionCoordinator.registerMetrics(registry);
+ Gauge.builder(MANAGER_GOAL_STATE.getName(), metricsGoalState,
AtomicInteger::get)
+ .description(MANAGER_GOAL_STATE.getDescription()).register(registry);
}
private Map<FateInstanceType,Fate<FateEnv>> getFateRefs() {
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
index 5c6a393126..af9f87d0e7 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
@@ -23,6 +23,12 @@ import static java.lang.Math.min;
import static
org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType.FILES;
import static
org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType.LOGS;
import static
org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType.MIGRATION;
+import static
org.apache.accumulo.core.metrics.Metric.COMPACTION_META_SVC_ERRORS;
+import static
org.apache.accumulo.core.metrics.Metric.COMPACTION_ROOT_SVC_ERRORS;
+import static
org.apache.accumulo.core.metrics.Metric.COMPACTION_USER_SVC_ERRORS;
+import static org.apache.accumulo.core.metrics.Metric.MANAGER_META_TGW_ERRORS;
+import static org.apache.accumulo.core.metrics.Metric.MANAGER_ROOT_TGW_ERRORS;
+import static org.apache.accumulo.core.metrics.Metric.MANAGER_USER_TGW_ERRORS;
import java.io.IOException;
import java.time.Duration;
@@ -42,6 +48,8 @@ import java.util.SortedSet;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Stream;
@@ -72,13 +80,14 @@ import
org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.Fu
import org.apache.accumulo.core.metadata.schema.RootTabletMetadata;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
+import org.apache.accumulo.core.metrics.Metric;
+import org.apache.accumulo.core.metrics.MetricsProducer;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.Timer;
import org.apache.accumulo.core.util.threads.Threads;
import org.apache.accumulo.core.util.threads.Threads.AccumuloDaemonThread;
import org.apache.accumulo.manager.EventCoordinator.Event;
import org.apache.accumulo.manager.EventCoordinator.EventScope;
-import org.apache.accumulo.manager.metrics.ManagerMetrics;
import org.apache.accumulo.manager.recovery.RecoveryManager;
import org.apache.accumulo.manager.state.TableCounts;
import org.apache.accumulo.manager.state.TableStats;
@@ -110,6 +119,9 @@ import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Sets;
import com.google.common.net.HostAndPort;
+import io.micrometer.core.instrument.Gauge;
+import io.micrometer.core.instrument.MeterRegistry;
+
abstract class TabletGroupWatcher extends AccumuloDaemonThread {
private static final Logger LOG =
LoggerFactory.getLogger(TabletGroupWatcher.class);
@@ -122,22 +134,74 @@ abstract class TabletGroupWatcher extends
AccumuloDaemonThread {
final TableStats stats = new TableStats();
private SortedSet<TServerInstance> lastScanServers =
Collections.emptySortedSet();
private final EventHandler eventHandler;
- private final ManagerMetrics metrics;
+ private final TabletGroupWatcherMetrics metrics;
private final WalStateManager walStateManager;
private volatile Set<TServerInstance> filteredServersToShutdown = Set.of();
- TabletGroupWatcher(Manager manager, TabletStateStore store,
TabletGroupWatcher dependentWatcher,
- ManagerMetrics metrics) {
+ private static class TabletGroupWatcherMetrics implements MetricsProducer {
+ private final AtomicLong errorsGauge = new AtomicLong(0);
+ private final AtomicInteger compactionConfigurationError = new
AtomicInteger(0);
+ private final Ample.DataLevel level;
+
+ private TabletGroupWatcherMetrics(Ample.DataLevel level) {
+ this.level = level;
+ }
+
+ public void incrementTabletGroupWatcherError() {
+ errorsGauge.incrementAndGet();
+ }
+
+ public void setCompactionServiceConfigurationError() {
+ this.compactionConfigurationError.set(1);
+ }
+
+ public void clearCompactionServiceConfigurationError() {
+ this.compactionConfigurationError.set(0);
+ }
+
+ @Override
+ public void registerMetrics(MeterRegistry registry) {
+
+ Metric errorMetric;
+ Metric svcCfgErrorMetric;
+ switch (level) {
+ case USER -> {
+ errorMetric = MANAGER_USER_TGW_ERRORS;
+ svcCfgErrorMetric = COMPACTION_USER_SVC_ERRORS;
+ }
+ case METADATA -> {
+ errorMetric = MANAGER_META_TGW_ERRORS;
+ svcCfgErrorMetric = COMPACTION_META_SVC_ERRORS;
+ }
+ case ROOT -> {
+ errorMetric = MANAGER_ROOT_TGW_ERRORS;
+ svcCfgErrorMetric = COMPACTION_ROOT_SVC_ERRORS;
+ }
+ default -> throw new IllegalStateException("Unknown level " + level);
+ }
+ Gauge.builder(errorMetric.getName(), errorsGauge, AtomicLong::get)
+ .description(errorMetric.getDescription()).register(registry);
+ Gauge.builder(svcCfgErrorMetric.getName(), compactionConfigurationError,
AtomicInteger::get)
+ .description(svcCfgErrorMetric.getDescription()).register(registry);
+
+ }
+ }
+
+ TabletGroupWatcher(Manager manager, TabletStateStore store,
TabletGroupWatcher dependentWatcher) {
super("Watching " + store.name());
this.manager = manager;
this.store = store;
this.dependentWatcher = dependentWatcher;
- this.metrics = metrics;
+ this.metrics = new TabletGroupWatcherMetrics(store.getLevel());
this.walStateManager = new WalStateManager(manager.getContext());
this.eventHandler = new EventHandler();
manager.getEventCoordinator().addListener(store.getLevel(), eventHandler);
}
+ public MetricsProducer getMetrics() {
+ return metrics;
+ }
+
/** Should this {@code TabletGroupWatcher} suspend tablets? */
abstract boolean canSuspendTablets();
@@ -487,7 +551,7 @@ abstract class TabletGroupWatcher extends
AccumuloDaemonThread {
LOG.warn(
"Error on TabletServer trying to get Tablet management information
for metadata tablet. Error message: {}",
mtiError);
- this.metrics.incrementTabletGroupWatcherError(this.store.getLevel());
+ this.metrics.incrementTabletGroupWatcherError();
tableMgmtStats.tabletsWithErrors++;
continue;
}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/metrics/ManagerMetrics.java
b/server/manager/src/main/java/org/apache/accumulo/manager/metrics/ManagerMetrics.java
deleted file mode 100644
index 77689cea02..0000000000
---
a/server/manager/src/main/java/org/apache/accumulo/manager/metrics/ManagerMetrics.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.accumulo.manager.metrics;
-
-import static java.util.Objects.requireNonNull;
-import static org.apache.accumulo.core.metrics.Metric.COMPACTION_SVC_ERRORS;
-import static org.apache.accumulo.core.metrics.Metric.MANAGER_GOAL_STATE;
-import static org.apache.accumulo.core.metrics.Metric.MANAGER_META_TGW_ERRORS;
-import static org.apache.accumulo.core.metrics.Metric.MANAGER_ROOT_TGW_ERRORS;
-import static org.apache.accumulo.core.metrics.Metric.MANAGER_USER_TGW_ERRORS;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.accumulo.core.conf.AccumuloConfiguration;
-import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.fate.Fate;
-import org.apache.accumulo.core.fate.FateInstanceType;
-import org.apache.accumulo.core.manager.thrift.ManagerGoalState;
-import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
-import org.apache.accumulo.core.metrics.MetricsProducer;
-import org.apache.accumulo.manager.Manager;
-import org.apache.accumulo.manager.metrics.fate.FateMetrics;
-import org.apache.accumulo.manager.metrics.fate.meta.MetaFateMetrics;
-import org.apache.accumulo.manager.metrics.fate.user.UserFateMetrics;
-import org.apache.accumulo.manager.tableOps.FateEnv;
-
-import io.micrometer.core.instrument.Gauge;
-import io.micrometer.core.instrument.MeterRegistry;
-
-public class ManagerMetrics implements MetricsProducer {
-
- private List<FateMetrics<?>> fateMetrics;
-
- private final AtomicLong rootTGWErrorsGauge = new AtomicLong(0);
- private final AtomicLong metadataTGWErrorsGauge = new AtomicLong(0);
- private final AtomicLong userTGWErrorsGauge = new AtomicLong(0);
- private final AtomicInteger compactionConfigurationError = new
AtomicInteger(0);
- private final AtomicInteger goalState = new AtomicInteger(-1);
-
- public void updateManagerGoalState(ManagerGoalState goal) {
- int newValue = switch (goal) {
- case CLEAN_STOP -> 0;
- case SAFE_MODE -> 1;
- case NORMAL -> 2;
- };
- goalState.set(newValue);
- }
-
- public void configureFateMetrics(final AccumuloConfiguration conf, final
Manager manager,
- Map<FateInstanceType,Fate<FateEnv>> fateRefs) {
- requireNonNull(conf, "AccumuloConfiguration must not be null");
- requireNonNull(conf, "Manager must not be null");
- fateMetrics = List.of(
- new MetaFateMetrics(manager.getContext(),
-
conf.getTimeInMillis(Property.MANAGER_FATE_METRICS_MIN_UPDATE_INTERVAL),
- fateRefs.get(FateInstanceType.META).getFateExecutors()),
- new UserFateMetrics(manager.getContext(),
-
conf.getTimeInMillis(Property.MANAGER_FATE_METRICS_MIN_UPDATE_INTERVAL),
- fateRefs.get(FateInstanceType.USER).getFateExecutors()));
- }
-
- public void incrementTabletGroupWatcherError(DataLevel level) {
- switch (level) {
- case METADATA:
- metadataTGWErrorsGauge.incrementAndGet();
- break;
- case ROOT:
- rootTGWErrorsGauge.incrementAndGet();
- break;
- case USER:
- userTGWErrorsGauge.incrementAndGet();
- break;
- default:
- throw new IllegalStateException("Unhandled DataLevel: " + level);
- }
- }
-
- public void setCompactionServiceConfigurationError() {
- this.compactionConfigurationError.set(1);
- }
-
- public void clearCompactionServiceConfigurationError() {
- this.compactionConfigurationError.set(0);
- }
-
- @Override
- public void registerMetrics(MeterRegistry registry) {
- fateMetrics.forEach(fm -> fm.registerMetrics(registry));
- Gauge.builder(MANAGER_ROOT_TGW_ERRORS.getName(), rootTGWErrorsGauge,
AtomicLong::get)
-
.description(MANAGER_ROOT_TGW_ERRORS.getDescription()).register(registry);
- Gauge.builder(MANAGER_META_TGW_ERRORS.getName(), metadataTGWErrorsGauge,
AtomicLong::get)
-
.description(MANAGER_META_TGW_ERRORS.getDescription()).register(registry);
- Gauge.builder(MANAGER_USER_TGW_ERRORS.getName(), userTGWErrorsGauge,
AtomicLong::get)
-
.description(MANAGER_USER_TGW_ERRORS.getDescription()).register(registry);
- Gauge.builder(COMPACTION_SVC_ERRORS.getName(),
compactionConfigurationError, AtomicInteger::get)
-
.description(COMPACTION_SVC_ERRORS.getDescription()).register(registry);
- Gauge.builder(MANAGER_GOAL_STATE.getName(), goalState, AtomicInteger::get)
- .description(MANAGER_GOAL_STATE.getDescription()).register(registry);
- }
-
- public List<MetricsProducer> getProducers(Manager manager) {
- ArrayList<MetricsProducer> producers = new ArrayList<>();
- producers.add(this);
- producers.addAll(fateMetrics);
- producers.add(manager.getCompactionCoordinator());
- return producers;
- }
-}
diff --git
a/test/src/main/java/org/apache/accumulo/test/compaction/BadCompactionServiceConfigIT.java
b/test/src/main/java/org/apache/accumulo/test/compaction/BadCompactionServiceConfigIT.java
index 647da1c0e0..705ffd0bde 100644
---
a/test/src/main/java/org/apache/accumulo/test/compaction/BadCompactionServiceConfigIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/compaction/BadCompactionServiceConfigIT.java
@@ -19,7 +19,7 @@
package org.apache.accumulo.test.compaction;
import static
org.apache.accumulo.core.Constants.DEFAULT_COMPACTION_SERVICE_NAME;
-import static org.apache.accumulo.core.metrics.Metric.COMPACTION_SVC_ERRORS;
+import static
org.apache.accumulo.core.metrics.Metric.COMPACTION_USER_SVC_ERRORS;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Collections;
@@ -141,7 +141,7 @@ public class BadCompactionServiceConfigIT extends
AccumuloClusterHarness {
if (shutdownTailer.get()) {
break;
}
- if (s.startsWith(COMPACTION_SVC_ERRORS.getName())) {
+ if (s.startsWith(COMPACTION_USER_SVC_ERRORS.getName())) {
Metric m = TestStatsDSink.parseStatsDMetric(s);
Integer value = Integer.parseInt(m.getValue());
if (value == 0) {
@@ -265,7 +265,7 @@ public class BadCompactionServiceConfigIT extends
AccumuloClusterHarness {
if (shutdownTailer.get()) {
break;
}
- if (s.startsWith(COMPACTION_SVC_ERRORS.getName())) {
+ if (s.startsWith(COMPACTION_USER_SVC_ERRORS.getName())) {
Metric m = TestStatsDSink.parseStatsDMetric(s);
Integer value = Integer.parseInt(m.getValue());
if (value == 0) {