flyrain commented on code in PR #2747:
URL: https://github.com/apache/polaris/pull/2747#discussion_r2402807154


##########
runtime/service/src/main/java/org/apache/polaris/service/context/RealmContextFilter.java:
##########
@@ -46,19 +50,20 @@ public Uni<Response> 
resolveRealmContext(ContainerRequestContext rc) {
                     rc.getHeaders()::getFirst))
         .onItem()
         .invoke(realmContext -> rc.setProperty(REALM_CONTEXT_KEY, 
realmContext))
+        // ContextLocals is used by RealmIdTagContributor to add the realm id 
to metrics
         .invoke(realmContext -> ContextLocals.put(REALM_CONTEXT_KEY, 
realmContext))

Review Comment:
   Trying to understand why `RealmIdTagContributor` cannot read from the 
`ContainerRequestContext` instead of relying on `ContextLocals` to pass around 
any object needed for a `HttpServerMetricsTagsContributor`. Or would it be 
reasonable to copy the whole `rc` into a `ContextLocals` by default? So that 
any operation on the `ContextLocals` can use the `ContainerRequestContext`. 
Would you mind sharing your thought on 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: [email protected]

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

Reply via email to