You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "denis-chudov (via GitHub)" <gi...@apache.org> on 2025/07/31 15:28:40 UTC
[PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
denis-chudov opened a new pull request, #6350:
URL: https://github.com/apache/ignite-3/pull/6350
https://issues.apache.org/jira/browse/IGNITE-25938
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#discussion_r2250819005
##########
modules/metrics/src/main/java/org/apache/ignite/internal/metrics/MetricManagerImpl.java:
##########
@@ -247,6 +257,43 @@ public Collection<MetricExporter> enabledExporters() {
return inBusyLock(busyLock, enabledMetricExporters::values);
}
+ private static List<ExporterView> defaultExporters(List<? extends ExporterView> configuredExporters) {
+ if (configuredExporters.stream().map(ExporterView::exporterName).anyMatch(n -> n.equals(LogPushExporter.EXPORTER_NAME))) {
Review Comment:
Got an explanation. Agreed.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#discussion_r2250667439
##########
modules/metrics-exporter-otlp/src/integrationTest/java/org/apache/ignite/internal/metrics/exporters/ItOtlpMetricsTest.java:
##########
@@ -95,7 +93,8 @@ void otlpMetricsGetCorrectlyReported() {
cluster.runningNodes().forEach(node -> {
MetricManager metricManager = unwrapIgniteImpl(node).metricManager();
- assertThat(metricManager.enabledExporters(), contains(instanceOf(OtlpPushMetricExporter.class)));
+ boolean contains = metricManager.enabledExporters().stream().anyMatch(e -> e.getClass().equals(OtlpPushMetricExporter.class));
Review Comment:
> hasAtLeastOneElementOfType what is it?
It's a method of assertj.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on code in PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#discussion_r2249160222
##########
modules/metrics/src/main/java/org/apache/ignite/internal/metrics/MetricManagerImpl.java:
##########
@@ -247,6 +257,43 @@ public Collection<MetricExporter> enabledExporters() {
return inBusyLock(busyLock, enabledMetricExporters::values);
}
+ private static List<ExporterView> defaultExporters(List<? extends ExporterView> configuredExporters) {
+ if (configuredExporters.stream().map(ExporterView::exporterName).anyMatch(n -> n.equals(LogPushExporter.EXPORTER_NAME))) {
Review Comment:
If user defined an exporter with the exporterName `logPush` in configuration (and the type of exporter is defined by exporterName), then the instance from configuration will be used.
In fact, it is a way to filter from default exporters the ones that were specified in configuration, i just decided not to overcomplicate the code with wrapping it into collection and filtering, maybe it would look more obvious
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on code in PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#discussion_r2249159470
##########
modules/metrics/src/main/java/org/apache/ignite/internal/metrics/MetricManagerImpl.java:
##########
@@ -121,7 +128,10 @@ public void start(Map<String, MetricExporter> availableExporters) {
MetricView conf = metricConfiguration.value();
- for (ExporterView exporter : conf.exporters()) {
+ List<ExporterView> exporters = StreamSupport.stream(conf.exporters().spliterator(), false).collect(toList());
Review Comment:
Hmm, I saw that NamedListView is Iterable, but didn't check whether it already has `stream()` method. Will fix it.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#discussion_r2248641664
##########
modules/metrics/src/main/java/org/apache/ignite/internal/metrics/MetricManagerImpl.java:
##########
@@ -121,7 +128,10 @@ public void start(Map<String, MetricExporter> availableExporters) {
MetricView conf = metricConfiguration.value();
- for (ExporterView exporter : conf.exporters()) {
+ List<ExporterView> exporters = StreamSupport.stream(conf.exporters().spliterator(), false).collect(toList());
Review Comment:
Is `StreamSupport.stream(conf.exporters().spliterator(), false)` just a way to retrieve values from namedListView? If true, why not to use `List<ExporterView> exporters = conf.exporters().stream().collect(toList());` ?
##########
modules/metrics-exporter-otlp/src/integrationTest/java/org/apache/ignite/internal/metrics/exporters/ItOtlpMetricsTest.java:
##########
@@ -95,7 +93,8 @@ void otlpMetricsGetCorrectlyReported() {
cluster.runningNodes().forEach(node -> {
MetricManager metricManager = unwrapIgniteImpl(node).metricManager();
- assertThat(metricManager.enabledExporters(), contains(instanceOf(OtlpPushMetricExporter.class)));
+ boolean contains = metricManager.enabledExporters().stream().anyMatch(e -> e.getClass().equals(OtlpPushMetricExporter.class));
Review Comment:
Since we already widely use assert I'd rather use
```
import static org.assertj.core.api.Assertions.assertThat;
...
assertThat(metricManager.enabledExporters()).hasAtLeastOneElementOfType(OtlpPushMetricExporter.class);
```
or similar. This looks more concise.
##########
modules/metrics/src/main/java/org/apache/ignite/internal/metrics/MetricManagerImpl.java:
##########
@@ -247,6 +257,43 @@ public Collection<MetricExporter> enabledExporters() {
return inBusyLock(busyLock, enabledMetricExporters::values);
}
+ private static List<ExporterView> defaultExporters(List<? extends ExporterView> configuredExporters) {
+ if (configuredExporters.stream().map(ExporterView::exporterName).anyMatch(n -> n.equals(LogPushExporter.EXPORTER_NAME))) {
Review Comment:
Could you please elaborate this. Why do we believe that there are no default exporters if there's "logPush" in the configuredExporters list?
##########
modules/metrics/src/main/java/org/apache/ignite/internal/metrics/exporters/configuration/LogPushExporterConfigurationSchema.java:
##########
@@ -38,8 +38,13 @@ public class LogPushExporterConfigurationSchema extends ExporterConfigurationSch
/**
* List of enabled metric sources. If not empty, metric sources that are not enumerated will be not printed.
Review Comment:
will be not printed -> will not be printed.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#discussion_r2250678804
##########
modules/metrics/src/main/java/org/apache/ignite/internal/metrics/MetricManagerImpl.java:
##########
@@ -247,6 +257,43 @@ public Collection<MetricExporter> enabledExporters() {
return inBusyLock(busyLock, enabledMetricExporters::values);
}
+ private static List<ExporterView> defaultExporters(List<? extends ExporterView> configuredExporters) {
+ if (configuredExporters.stream().map(ExporterView::exporterName).anyMatch(n -> n.equals(LogPushExporter.EXPORTER_NAME))) {
Review Comment:
> If user defined an exporter with the exporterName logPush in configuration (and the type of exporter is defined by exporterName), then the instance from configuration will be used.
Still not sure that I properly got it. Do you assume that `logPush` is the only possible default exporter?
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc merged PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#issuecomment-3149719265
> Should we also add a test that will verify that logPush exported is available by default? Or there is one and I just missed it?
added
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on code in PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#discussion_r2249160707
##########
modules/metrics-exporter-otlp/src/integrationTest/java/org/apache/ignite/internal/metrics/exporters/ItOtlpMetricsTest.java:
##########
@@ -95,7 +93,8 @@ void otlpMetricsGetCorrectlyReported() {
cluster.runningNodes().forEach(node -> {
MetricManager metricManager = unwrapIgniteImpl(node).metricManager();
- assertThat(metricManager.enabledExporters(), contains(instanceOf(OtlpPushMetricExporter.class)));
+ boolean contains = metricManager.enabledExporters().stream().anyMatch(e -> e.getClass().equals(OtlpPushMetricExporter.class));
Review Comment:
`hasAtLeastOneElementOfType` what is it?
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25938 Add the metric log exporter to the default configuration [ignite-3]
Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on code in PR #6350:
URL: https://github.com/apache/ignite-3/pull/6350#discussion_r2250076982
##########
modules/metrics-exporter-otlp/src/integrationTest/java/org/apache/ignite/internal/metrics/exporters/ItOtlpMetricsTest.java:
##########
@@ -95,7 +93,8 @@ void otlpMetricsGetCorrectlyReported() {
cluster.runningNodes().forEach(node -> {
MetricManager metricManager = unwrapIgniteImpl(node).metricManager();
- assertThat(metricManager.enabledExporters(), contains(instanceOf(OtlpPushMetricExporter.class)));
+ boolean contains = metricManager.enabledExporters().stream().anyMatch(e -> e.getClass().equals(OtlpPushMetricExporter.class));
Review Comment:
fixed using `containsInRelativeOrder` which allows spaces in the array that it accepts.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org