Since this entry point can be called when a distributed trace is received from
another service, calling Logger.metadata in the same way it is called in
start_trace/2 seems to cover that use-case (it should be idempotent, thus safe
if the same trace_id is already there from another local process).
However, I believe this may also fix an issue as a new span is created when
continuing a trace, which that should be updated in logs from this moment on.
Since this entry point can be called when a distributed trace is received from another service, calling Logger.metadata in the same way it is called in
start_trace/2
seems to cover that use-case (it should be idempotent, thus safe if the same trace_id is already there from another local process).However, I believe this may also fix an issue as a new span is created when continuing a trace, which that should be updated in logs from this moment on.
Do you think this may be helpful?