flyrain commented on code in PR #3385: URL: https://github.com/apache/polaris/pull/3385#discussion_r2850288989
########## site/content/in-dev/unreleased/configuration/config-sections/smallrye-polaris_persistence_metrics.md: ########## @@ -0,0 +1,35 @@ +--- +# +# 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. +# +title: smallrye-polaris_persistence_metrics +build: + list: never + render: never +--- + +Configuration for selecting the (`org.apache.polaris.core.persistence.metrics.MetricsPersistence`) implementation. + +This configuration allows selecting the metrics persistence backend independently from the entity metastore. Available types include: + + * `noop` (default) - No persistence, metrics are discarded Review Comment: Hi @obelix74, you raise a valid point about CDI. However, the established Polaris convention is to have the SPI layer explicitly carry contextual information such as principal name and request id, rather than injecting service layer beans directly into the persistence layer. A good example is the events implementation, https://github.com/apache/polaris/blob/ab579181d47aaf793f0987e1cb8caed30a6c96be/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEvent.java#L44, where contextual data is modeled and passed through the SPI instead of relying on CDI wiring. This approach creates a clear and explicit dependency boundary between layers. The persistence layer remains independent from service layer constructs, which helps preserve separation of concerns. In my view, this leads to a cleaner mental model. Each layer communicates through well defined contracts, instead of implicitly depending on runtime injection. That makes the architecture easier to reason about and evolve. -- 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]
