Feature request: abstraction for profile context
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
osprofiler |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Hi,
I'm working on a patch to oslo.messaging that will integrate osprofiler for tracing across RPC calls:
https:/
Ilya makes a good observation about accessing the current context:
https:/
Ideally oslo.messaging shouldn't have to explicitly construct the components of osprofiler's context as I have done in the patch:
# send profiler state to the server for tracing the RPC call
if profiler:
prof = profiler.get()
if prof:
}
Instead the context should be opaque as far as oslo.messaging is concerned - osprofiler should provide it in the correct serialized form for including in the messages meta-data.
Would it be possible to provide a new profiler access method that returns a pre-built context as a map rather than have oslo.messaging pick out the values explicitly? Then oslo.messaging wouldn't care what's in the context. like this:
# send profiler state to the server for tracing the RPC call
if profiler:
prof = profiler.get()
if prof:
And on the server side we can easily set the state (as we do in the patch):
ctxt = msg.get(
if ctxt is not None:
Changed in osprofiler: | |
status: | New → Confirmed |