dimas-b commented on code in PR #3468:
URL: https://github.com/apache/polaris/pull/3468#discussion_r2706346156
##########
runtime/service/src/main/java/org/apache/polaris/service/reporting/PolarisMetricsReporter.java:
##########
@@ -21,7 +21,67 @@
import org.apache.iceberg.catalog.TableIdentifier;
import org.apache.iceberg.metrics.MetricsReport;
+/**
+ * SPI interface for reporting Iceberg metrics received by Polaris.
+ *
+ * <p>Implementations can be used to send metrics to external systems for
analysis and monitoring.
+ * Custom implementations must be annotated with {@link
+ * jakarta.enterprise.context.ApplicationScoped @ApplicationScoped} and {@link
+ * io.smallrye.common.annotation.Identifier @Identifier("my-reporter-type")}
for CDI discovery.
+ *
+ * <p>The implementation to use is selected via the {@code
polaris.iceberg-metrics.reporting.type}
+ * configuration property, which defaults to {@code "default"}.
+ *
+ * <p>Custom implementations that need access to request-scoped context (such
as realm information
+ * or principal details) should inject the appropriate CDI beans (e.g., {@code
RealmContext}, {@code
+ * PolarisPrincipalHolder}) rather than expecting this data to be passed as
parameters.
+ *
+ * <p>Example implementation:
+ *
+ * <pre>{@code
+ * @ApplicationScoped
+ * @Identifier("custom")
+ * public class CustomMetricsReporter implements PolarisMetricsReporter {
+ *
+ * @Inject RealmContext realmContext;
+ *
+ * @Override
+ * public void reportMetric(
+ * String catalogName, TableIdentifier table, MetricsReport
metricsReport, long timestampMs) {
+ * // Send metrics to external system
+ * }
+ * }
+ * }</pre>
+ *
+ * @see DefaultMetricsReporter
+ * @see MetricsReportingConfiguration
+ */
Review Comment:
No worries
--
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]