joeyutong commented on PR #870:
URL: https://github.com/apache/flink-agents/pull/870#issuecomment-4923225006

   Thanks for laying out the options. After thinking more about this, I do not 
have a fully comprehensive solution within the current resource abstraction 
either.
   
   I agree that a recorder-style direction could be the right long-term shape, 
but I do not think it should be embedding-specific. This seems more like a 
framework-level metric/effect abstraction: resource APIs may run from arbitrary 
caller threads, while actual `MetricGroup` access should happen only at a safe 
action/mailbox-thread boundary. Designing that properly is probably beyond the 
scope of this PR.
   
   The second option is more focused, but if the record path can still be 
called concurrently, it would either still race on the default `SimpleCounter`, 
or require a special thread-safe counter path. That seems to weaken the current 
metric-group single-threaded access contract.
   
   Given that, my suggestion is to narrow this PR to provider usage extraction 
and usage-returning APIs only, without promising automatic metric recording 
from ordinary resource APIs such as vector-store auto-embedding. We can track 
the framework-level metric recording abstraction separately and solve automatic 
recording there.
   
   @weiqingy @zxs1633079383 , what do you think?


-- 
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