span end and stopping/cleaning up the tracing #1215
Replies: 1 comment
-
span->End() is optional in the example posted by you, as it will implicitly called when the lambda function finishes ( through Span object's destructor). In general, it's good to call
tracerProvider->Shutdown() is enough to shut down all other dependent objects ( exporter, processor and context ). Closing tracer is optional too. |
Beta Was this translation helpful? Give feedback.
-
After the inital setup I get a tracer. Then in the http handler I create a span and a scope.
The examples show a
span->End()
before we leave the scope of the span(as below). Is this needed in this pattern or does the created scope variable trigger a span cleanup(above)?Secondly, assuming this pattern in a thread:
Do we need to call the shutdown and close functions before exiting?
Beta Was this translation helpful? Give feedback.
All reactions