Closed xing393939 closed 2 years ago
Please update the issue in English, as this SDK has global users.
Also, I am not sure what you are proposing for clearing tracing context. Could you submit a pull request or demo codes to show how to do this? Also, in my mind, if you can clear the context, you could stop this span in the same place.
Hi @xing393939, I think you can use recover()
to catch the panic and call span.End()
to report it in defer function, it may solve your problem
Hi @xing393939, I think you can use
recover()
to catch the panic and callspan.End()
to report it in defer function, it may solve your problem
If I do so, I need to get the span in the recover logic
, the span can not got by the root span directly, so I need to do same extra work to pass the span, I do not think it is a good idea.
Describe the solution you'd like I'd like to create a exit span with one statement like:
not two statement like:
Because when your program panic after CreateExitSpan(), you never have change to call span.End(), then this trace can not be sent. this is a demo to show this.