diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java index e8f1358fab0..641d1a1bb62 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrCore.java +++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java @@ -1162,7 +1162,7 @@ public final class SolrCore implements SolrInfoBean, SolrMetricProducer, Closeab File dataDirFile = dataDirPath.toFile(); manager.registerGauge(this, registry, () -> dataDirFile.getTotalSpace(), true, "totalSpace", Category.CORE.toString(), "fs"); manager.registerGauge(this, registry, () -> dataDirFile.getUsableSpace(), true, "usableSpace", Category.CORE.toString(), "fs"); - manager.registerGauge(this, registry, () -> dataDirPath.toAbsolutePath().toString(), true, "fs", "dataDir"); + manager.registerGauge(this, registry, () -> dataDirPath.toAbsolutePath().toString(), true, "path", Category.CORE.toString(), "fs"); manager.registerGauge(this, registry, () -> { try { return org.apache.lucene.util.IOUtils.spins(dataDirPath.toAbsolutePath()); @@ -1170,7 +1170,7 @@ public final class SolrCore implements SolrInfoBean, SolrMetricProducer, Closeab // default to spinning return true; } - }, true, "spins", Category.CORE.toString(), "fs", "dataDir"); + }, true, "spins", Category.CORE.toString(), "fs"); } private void checkVersionFieldExistsInSchema(IndexSchema schema, CoreDescriptor coreDescriptor) { diff --git a/solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java b/solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java index 1184402cd91..055109e0fb5 100644 --- a/solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java +++ b/solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java @@ -178,11 +178,12 @@ public class SolrMetricsIntegrationTest extends SolrTestCaseJ4 { assertEquals(g.getValue(), cc.getResourceLoader().getInstancePath().toAbsolutePath().toString()); boolean spins = IOUtils.spins(cc.getCoreRootDirectory()); g = (Gauge)metrics.get("CONTAINER.fs.coreRoot.spins"); - g = (Gauge)metrics.get("CONTAINER.fs.coreRoot.spins"); assertEquals(spins, g.getValue()); + g = (Gauge)metrics.get("CONTAINER.fs.spins"); if (cc.getConfig().getSolrDataHome() != null) { spins = IOUtils.spins(cc.getConfig().getSolrDataHome()); - g = (Gauge)metrics.get("CONTAINER.fs.spins"); + assertEquals(spins, g.getValue()); + } else { assertEquals(spins, g.getValue()); } }