You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "shodaaan (via GitHub)" <gi...@apache.org> on 2025/04/08 12:45:22 UTC
[PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
shodaaan opened a new pull request, #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216
- created fixture provider and fixture for exporting fullGC metrics from VersionGarbageCollector to Prometheus via Pushgateway
- created interface FullGCMetricsExporter for injecting FullGCMetricsExporterFixture into VersionGarbageCollector
- added direct call to the FullGCMetricsExporter interface methods that exports metrics from VersionGarbageCollector after each fullGC iteration completion
- added initialization of MetricStatisticsProvider to RevisionCommand and wired it to be used by VersionGarbageCollector as StatisticsProvider
- added exportMetrics parameter to RevisionCommandOptions
- added parameter to FullGCStatsCollectorImpl for modifying the qualified metric prefix when metrics will be pushed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim commented on PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#issuecomment-2828034448
@shodaaan thanks for quick fixes. I have approved and ran the workflows, would merge after the build passes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "Joscorbe (via GitHub)" <gi...@apache.org>.
Joscorbe commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2037069552
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -37,7 +37,8 @@
*/
class FullGCStatsCollectorImpl implements FullGCStatsCollector {
- static final String FULL_GC = "FullGC";
+ static final String FULL_GC_PUSH_METRICS_PREFIX = "oak_FullGC";
+ static String FULL_GC = "FullGC";
Review Comment:
Do we really need to remove the `final` here?
```suggestion
static final String FULL_GC = "FullGC";
```
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/FullGCMetricsExporterFixtureProvider.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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
+ *
+ * http://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.jackrabbit.oak.run;
+
+import com.codahale.metrics.MetricRegistry;
+import io.prometheus.client.CollectorRegistry;
+import io.prometheus.client.dropwizard.DropwizardExports;
+import io.prometheus.client.exporter.PushGateway;
+import org.apache.jackrabbit.oak.run.MetricsExporterFixtureProvider.ExportMetricsArgs;
+import org.apache.jackrabbit.oak.run.MetricsExporterFixtureProvider.ExporterType;
+import org.apache.jackrabbit.oak.run.cli.NodeStoreFixtureProvider;
+import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import static java.util.Collections.emptyMap;
+import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.getService;
+
+/**
+ * Initializes metrics exported fixture for fullGC. For use in oak-run RevisionsCommand.
+ */
+public class FullGCMetricsExporterFixtureProvider {
+
+ private static final Logger log = LoggerFactory.getLogger(NodeStoreFixtureProvider.class);
+
+ @Nullable
+ public static FullGCMetricsExporterFixture<PushGateway> create(RevisionsCommand.RevisionsOptions options, Whiteboard wb) {
Review Comment:
```suggestion
static FullGCMetricsExporterFixture<PushGateway> create(RevisionsCommand.RevisionsOptions options, Whiteboard wb) {
```
Same here
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java:
##########
@@ -247,9 +248,17 @@ void setFullGcMaxAge(final long fullGcMaxAge, final TimeUnit unit) {
this.fullGcMaxAgeInMillis = unit.toMillis(fullGcMaxAge);
}
- public void setStatisticsProvider(StatisticsProvider provider) {
+ public void setStatisticsProvider(StatisticsProvider provider) {
Review Comment:
```suggestion
public void setStatisticsProvider(StatisticsProvider provider) {
```
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -231,12 +238,11 @@ private static CounterStats counter(StatisticsProvider provider, String name) {
return provider.getCounterStats(qualifiedName(name), METRICS_ONLY);
}
- private static String qualifiedName(String metricName) {
- return FULL_GC + "." + metricName;
+ public static String qualifiedName(String metricName) {
Review Comment:
```suggestion
private static String qualifiedName(String metricName) {
```
I don't see new usages of this method that would require to make it public.
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/FullGCMetricsExporterFixtureProvider.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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
+ *
+ * http://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.jackrabbit.oak.run;
+
+import com.codahale.metrics.MetricRegistry;
+import io.prometheus.client.CollectorRegistry;
+import io.prometheus.client.dropwizard.DropwizardExports;
+import io.prometheus.client.exporter.PushGateway;
+import org.apache.jackrabbit.oak.run.MetricsExporterFixtureProvider.ExportMetricsArgs;
+import org.apache.jackrabbit.oak.run.MetricsExporterFixtureProvider.ExporterType;
+import org.apache.jackrabbit.oak.run.cli.NodeStoreFixtureProvider;
+import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import static java.util.Collections.emptyMap;
+import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.getService;
+
+/**
+ * Initializes metrics exported fixture for fullGC. For use in oak-run RevisionsCommand.
+ */
+public class FullGCMetricsExporterFixtureProvider {
Review Comment:
```suggestion
class FullGCMetricsExporterFixtureProvider {
```
I would suggest to reduce visibility of this class, since it's only intended in this package.
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java:
##########
@@ -118,7 +125,7 @@ public RevisionsCommand(boolean exitWhenDone) {
this.exitWhenDone = exitWhenDone;
}
- private static class RevisionsOptions extends Utils.NodeStoreOptions {
+ public static class RevisionsOptions extends Utils.NodeStoreOptions {
Review Comment:
```suggestion
static class RevisionsOptions extends Utils.NodeStoreOptions {
```
So with above changes we can reduce this to package-only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2057758621
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -83,9 +84,15 @@ class FullGCStatsCollectorImpl implements FullGCStatsCollector {
private final CounterStats counter;
private final CounterStats failureCounter;
+ private static String METRICS_QUALIFIED_NAME_PREFIX;
FullGCStatsCollectorImpl(StatisticsProvider provider) {
+ this(provider, false);
+ }
+
+ FullGCStatsCollectorImpl(StatisticsProvider provider, boolean pushMetrics) {
this.provider = provider;
+ this.METRICS_QUALIFIED_NAME_PREFIX = pushMetrics ? FULL_GC_PUSH_METRICS_PREFIX : FULL_GC;
Review Comment:
When fullGC runs inside the Author process, and metrics from VersionGarbageCollector are pulled by Prometheus, the "oak_" prefix is added to all of the metrics automatically.
When running VersionGarbageCollector from oak-run, in which case the metrics are pushed to pushgateway, this prefix needs to be added manually.
That is the reason for this change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2055449275
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -231,12 +238,11 @@ private static CounterStats counter(StatisticsProvider provider, String name) {
return provider.getCounterStats(qualifiedName(name), METRICS_ONLY);
}
- private static String qualifiedName(String metricName) {
- return FULL_GC + "." + metricName;
+ public static String qualifiedName(String metricName) {
Review Comment:
Fixed, thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2055446115
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java:
##########
@@ -118,7 +125,7 @@ public RevisionsCommand(boolean exitWhenDone) {
this.exitWhenDone = exitWhenDone;
}
- private static class RevisionsOptions extends Utils.NodeStoreOptions {
+ public static class RevisionsOptions extends Utils.NodeStoreOptions {
Review Comment:
Done, thank you for the suggestion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2055439609
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -37,7 +37,8 @@
*/
class FullGCStatsCollectorImpl implements FullGCStatsCollector {
- static final String FULL_GC = "FullGC";
+ static final String FULL_GC_PUSH_METRICS_PREFIX = "oak_FullGC";
+ static String FULL_GC = "FullGC";
Review Comment:
Fixed, thank you for the suggestion
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2057753981
##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/run/cli/NodeStoreFixtureProvider.java:
##########
@@ -100,15 +100,19 @@ private static boolean oldSegmentStore(Options options) {
return !manifest.exists();
}
- private static StatisticsProvider createStatsProvider(Options options, Whiteboard wb, Closer closer) {
+ public static StatisticsProvider createStatsProvider(Whiteboard wb, Closer closer) {
+ ScheduledExecutorService executorService =
+ MoreExecutors.getExitingScheduledExecutorService(new ScheduledThreadPoolExecutor(1));
+ MetricStatisticsProvider statsProvider = new MetricStatisticsProvider(getPlatformMBeanServer(), executorService);
+ closer.register(statsProvider);
+ closer.register(() -> reportMetrics(statsProvider));
+ wb.register(MetricRegistry.class, statsProvider.getRegistry(), emptyMap());
+ return statsProvider;
+ }
+
+ public static StatisticsProvider createStatsProvider(Options options, Whiteboard wb, Closer closer) {
Review Comment:
Done, thank you for the suggestion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609 : add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "Joscorbe (via GitHub)" <gi...@apache.org>.
Joscorbe merged PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2055436549
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java:
##########
@@ -247,9 +248,17 @@ void setFullGcMaxAge(final long fullGcMaxAge, final TimeUnit unit) {
this.fullGcMaxAgeInMillis = unit.toMillis(fullGcMaxAge);
}
- public void setStatisticsProvider(StatisticsProvider provider) {
+ public void setStatisticsProvider(StatisticsProvider provider) {
Review Comment:
Done, thank you for the suggestion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2056332881
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -83,9 +84,15 @@ class FullGCStatsCollectorImpl implements FullGCStatsCollector {
private final CounterStats counter;
private final CounterStats failureCounter;
+ private static String METRICS_QUALIFIED_NAME_PREFIX;
FullGCStatsCollectorImpl(StatisticsProvider provider) {
+ this(provider, false);
+ }
+
+ FullGCStatsCollectorImpl(StatisticsProvider provider, boolean pushMetrics) {
this.provider = provider;
+ this.METRICS_QUALIFIED_NAME_PREFIX = pushMetrics ? FULL_GC_PUSH_METRICS_PREFIX : FULL_GC;
Review Comment:
why can't we use the same metrics prefix here?
##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/run/cli/NodeStoreFixtureProvider.java:
##########
@@ -100,15 +100,19 @@ private static boolean oldSegmentStore(Options options) {
return !manifest.exists();
}
- private static StatisticsProvider createStatsProvider(Options options, Whiteboard wb, Closer closer) {
+ public static StatisticsProvider createStatsProvider(Whiteboard wb, Closer closer) {
+ ScheduledExecutorService executorService =
+ MoreExecutors.getExitingScheduledExecutorService(new ScheduledThreadPoolExecutor(1));
+ MetricStatisticsProvider statsProvider = new MetricStatisticsProvider(getPlatformMBeanServer(), executorService);
+ closer.register(statsProvider);
+ closer.register(() -> reportMetrics(statsProvider));
+ wb.register(MetricRegistry.class, statsProvider.getRegistry(), emptyMap());
+ return statsProvider;
+ }
+
+ public static StatisticsProvider createStatsProvider(Options options, Whiteboard wb, Closer closer) {
Review Comment:
this should remain private.
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java:
##########
@@ -211,6 +219,8 @@ private static class RevisionsOptions extends Utils.NodeStoreOptions {
.withOptionalArg().ofType(Long.class).defaultsTo(TimeUnit.DAYS.toSeconds(1));
fullGCAuditLoggingEnabled = parser.accepts("fullGCAuditLoggingEnabled", "Enable audit logging for Full GC")
.withOptionalArg().ofType(Boolean.class).defaultsTo(FALSE);
+ exportMetrics = parser.accepts("export-metrics",
Review Comment:
```suggestion
exportMetrics = parser.accepts("exportMetrics",
```
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java:
##########
@@ -211,6 +219,8 @@ private static class RevisionsOptions extends Utils.NodeStoreOptions {
.withOptionalArg().ofType(Long.class).defaultsTo(TimeUnit.DAYS.toSeconds(1));
fullGCAuditLoggingEnabled = parser.accepts("fullGCAuditLoggingEnabled", "Enable audit logging for Full GC")
.withOptionalArg().ofType(Boolean.class).defaultsTo(FALSE);
+ exportMetrics = parser.accepts("export-metrics",
Review Comment:
let's be consistent with other var names.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2055444171
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/FullGCMetricsExporterFixtureProvider.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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
+ *
+ * http://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.jackrabbit.oak.run;
+
+import com.codahale.metrics.MetricRegistry;
+import io.prometheus.client.CollectorRegistry;
+import io.prometheus.client.dropwizard.DropwizardExports;
+import io.prometheus.client.exporter.PushGateway;
+import org.apache.jackrabbit.oak.run.MetricsExporterFixtureProvider.ExportMetricsArgs;
+import org.apache.jackrabbit.oak.run.MetricsExporterFixtureProvider.ExporterType;
+import org.apache.jackrabbit.oak.run.cli.NodeStoreFixtureProvider;
+import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import static java.util.Collections.emptyMap;
+import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.getService;
+
+/**
+ * Initializes metrics exported fixture for fullGC. For use in oak-run RevisionsCommand.
+ */
+public class FullGCMetricsExporterFixtureProvider {
Review Comment:
Done, thank you.
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/FullGCMetricsExporterFixtureProvider.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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
+ *
+ * http://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.jackrabbit.oak.run;
+
+import com.codahale.metrics.MetricRegistry;
+import io.prometheus.client.CollectorRegistry;
+import io.prometheus.client.dropwizard.DropwizardExports;
+import io.prometheus.client.exporter.PushGateway;
+import org.apache.jackrabbit.oak.run.MetricsExporterFixtureProvider.ExportMetricsArgs;
+import org.apache.jackrabbit.oak.run.MetricsExporterFixtureProvider.ExporterType;
+import org.apache.jackrabbit.oak.run.cli.NodeStoreFixtureProvider;
+import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import static java.util.Collections.emptyMap;
+import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.getService;
+
+/**
+ * Initializes metrics exported fixture for fullGC. For use in oak-run RevisionsCommand.
+ */
+public class FullGCMetricsExporterFixtureProvider {
+
+ private static final Logger log = LoggerFactory.getLogger(NodeStoreFixtureProvider.class);
+
+ @Nullable
+ public static FullGCMetricsExporterFixture<PushGateway> create(RevisionsCommand.RevisionsOptions options, Whiteboard wb) {
Review Comment:
Done, thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609 : add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "Joscorbe (via GitHub)" <gi...@apache.org>.
Joscorbe commented on PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#issuecomment-2830775124
It seems the failures in the pipeline are not related with the PR. Merging (with squash).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2058051719
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -37,6 +37,7 @@
*/
class FullGCStatsCollectorImpl implements FullGCStatsCollector {
+ static final String FULL_GC_PUSH_METRICS_PREFIX = "oak_FullGC";
Review Comment:
It should also use a better name.
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -83,9 +84,15 @@ class FullGCStatsCollectorImpl implements FullGCStatsCollector {
private final CounterStats counter;
private final CounterStats failureCounter;
+ private static String METRICS_QUALIFIED_NAME_PREFIX;
FullGCStatsCollectorImpl(StatisticsProvider provider) {
+ this(provider, false);
+ }
+
+ FullGCStatsCollectorImpl(StatisticsProvider provider, boolean pushMetrics) {
this.provider = provider;
+ this.METRICS_QUALIFIED_NAME_PREFIX = pushMetrics ? FULL_GC_PUSH_METRICS_PREFIX : FULL_GC;
Review Comment:
I would change the variable name to indicate that they are from OAK-RUN.
`PushMetrics` doesn't sound very intuitive to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11609: - add support for metrics export to Prometheus via pushgateway for VersionGarbageCollector [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #2216:
URL: https://github.com/apache/jackrabbit-oak/pull/2216#discussion_r2058150577
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -83,9 +84,15 @@ class FullGCStatsCollectorImpl implements FullGCStatsCollector {
private final CounterStats counter;
private final CounterStats failureCounter;
+ private static String METRICS_QUALIFIED_NAME_PREFIX;
FullGCStatsCollectorImpl(StatisticsProvider provider) {
+ this(provider, false);
+ }
+
+ FullGCStatsCollectorImpl(StatisticsProvider provider, boolean pushMetrics) {
this.provider = provider;
+ this.METRICS_QUALIFIED_NAME_PREFIX = pushMetrics ? FULL_GC_PUSH_METRICS_PREFIX : FULL_GC;
Review Comment:
Done, thank you for the suggestion.
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java:
##########
@@ -37,6 +37,7 @@
*/
class FullGCStatsCollectorImpl implements FullGCStatsCollector {
+ static final String FULL_GC_PUSH_METRICS_PREFIX = "oak_FullGC";
Review Comment:
Done, thank you for the suggestion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org