OpentracingBundle-core icon indicating copy to clipboard operation
OpentracingBundle-core copied to clipboard

Disable automatic tracing for command

Open ptondereau opened this issue 3 years ago • 4 comments

I have a use case when my Symfony command are some kinds of worker. In this context, I want to avoid waiting for my command to finish and only trace the part I want to. WDYT?

ptondereau avatar Jan 20 '22 21:01 ptondereau

Hi @ptondereau , we also have this use case and kind of worked around it by just ignoring the wrapping command traces and just ensuring, that the "inner" spans (which are linked to other parent traces from different services) are flushed to the tracer. We are using the internal Auxmoney\OpentracingBundle\Internal\Opentracing interface to get access to the OpenTracing\Tracer instance and flush after each span manually.

However, we can imagine having this as a "regular" feature, maybe by decorating a long running command with a marker interface and querying for this interface in the appropriate event subscribers.

Currently, we are focusing primarily on upgrading the bundle, and are looking for help with implementing new features. Would you yourself like to take a shot? If not, any help is welcome. :)

cawolf avatar Jan 31 '22 11:01 cawolf

are these handle by this File ? For me I had to listen to these events manually & finish the active span from my Symfony code

ujwaldhakal avatar Aug 05 '22 07:08 ujwaldhakal

Yes, @ujwaldhakal , this subscriber opens the root span for each Command. The FinishCommandSpanSubscriber is its counterpart.

cawolf avatar Sep 06 '22 08:09 cawolf

Hi @cawolf

What if add in subscribers some filter function by command name not to begin trace automatically?

pronata avatar Jun 13 '24 06:06 pronata