-
Notifications
You must be signed in to change notification settings - Fork 126
Conversation
Signed-off-by: Isaac Hier <[email protected]>
Signed-off-by: Isaac Hier <[email protected]>
Signed-off-by: Isaac Hier <[email protected]>
std::cerr << "usage: " << argv[0] << " <config-yaml-path>\n"; | ||
return 1; | ||
} | ||
setUpTracer(argv[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you need to close/flush the tracer before exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Luckily, no. At least not for the Jaeger client. My favorite thing about C++ is that most things are auto-closing (formally called RAII). Spans must be auto-closing according to OT C++ spec, but the Tracer::Close()
definition is a little more vague (see https://github.com/opentracing/opentracing-cpp/blob/master/include/opentracing/tracer.h#L149-L153). As of now, we aren't using close any differently here than for spans. Might add it just in case I change my mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, when the main function exits, the global tracer shared pointer is destroyed, invoking the Tracer destructor, which invokes Tracer::close
on its own. We could manually invoke any of these methods, but there is no need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not saying you are wrong, but I'd expect that behavior if you had a locally scoped variable that would get destroyed upon exiting the main scope. That global variables behave the same way is a surprise to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya it's a bit confusing. Here's a source quoting the standard about it: https://stackoverflow.com/a/2204628/1930331.
Signed-off-by: Isaac Hier <[email protected]>
Signed-off-by: Isaac Hier <[email protected]>
Signed-off-by: Isaac Hier <[email protected]>
Signed-off-by: Isaac Hier <[email protected]>
…into example-app Signed-off-by: Isaac Hier <[email protected]>
Signed-off-by: Isaac Hier <[email protected]>
This works now so landing it. |
No description provided.