dimas-b commented on code in PR #4115:
URL: https://github.com/apache/polaris/pull/4115#discussion_r3431409615


##########
extensions/metrics-reports/spi/src/main/java/org/apache/polaris/extension/metrics/IcebergMetricsReporter.java:
##########
@@ -16,38 +16,33 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.polaris.service.reporting;
+package org.apache.polaris.extension.metrics;

Review Comment:
   nit: it is generally advisable to use different packages in different jar 
files (for isolation reasons).
   
   How about `org.apache.polaris.extension.metrics.spi` here?



##########
runtime/defaults/src/main/resources/application-it.properties:
##########
@@ -20,6 +20,8 @@
 # Configuration common to ALL integration tests (executed with "it" profile – 
Gradle "intTest" tasks).
 # Note: Quarkus integration tests cannot use QuarkusTestProfile.
 
+polaris.iceberg-metrics.reporting.type=no-op

Review Comment:
   nit: this is probably not necessary given the same entry in 
`runtime/defaults/src/main/resources/application-test.properties`



##########
runtime/server/build.gradle.kts:
##########
@@ -40,6 +40,8 @@ dependencies {
   runtimeOnly(project(":polaris-extensions-federation-hadoop"))
   runtimeOnly(project(":polaris-extensions-auth-opa"))
   runtimeOnly(project(":polaris-extensions-auth-ranger"))
+  runtimeOnly(project(":polaris-extensions-metrics-reports"))
+  runtimeOnly(project(":polaris-api-metrics-reports-service"))

Review Comment:
   nit: should this "api" module be a transitive dep. of 
`polaris-extensions-metrics-reports`?.. This impl. module implies that specific 
API 🤔 



##########
runtime/service/src/main/java/org/apache/polaris/service/reporting/MetricsReportingConfiguration.java:
##########
@@ -23,6 +23,6 @@
 
 @ConfigMapping(prefix = "polaris.iceberg-metrics.reporting")
 public interface MetricsReportingConfiguration {
-  @WithDefault("default")

Review Comment:
   Strictly speaking, per our [Evolution 
Guidelines](https://polaris.apache.org/releases/1.5.0/evolution/) retracting a 
config option is considered a "breaking change".
   
   Could we support the old `default` type by redirecting it to `log`?
   
   Perhaps we could have a small inner class with `@Identifier("default")` 
extending `LoggingMetricsReporter`? WDYT?



##########
runtime/service/src/main/java/org/apache/polaris/service/config/ServiceProducers.java:
##########
@@ -457,9 +457,16 @@ public RequestIdSupplier requestIdSupplier() {
 
   @Produces
   @ApplicationScoped
-  public PolarisMetricsReporter metricsReporter(
-      MetricsReportingConfiguration config, @Any 
Instance<PolarisMetricsReporter> reporters) {
-    return reporters.select(Identifier.Literal.of(config.type())).get();
+  public IcebergMetricsReporter metricsReporter(
+      MetricsReportingConfiguration config, @Any 
Instance<IcebergMetricsReporter> reporters) {
+    var selected = reporters.select(Identifier.Literal.of(config.type()));
+    if (selected.isUnsatisfied()) {
+      LOGGER.warn(
+          "No IcebergMetricsReporter found for type '{}'; Iceberg metrics will 
be dropped",
+          config.type());
+      return (catalogName, catalogId, table, tableId, metricsReport, 
receivedTimestamp) -> {};

Review Comment:
   Ok, let's leave this producer "as is" for now 👍 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to