Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Example app #101

Merged
merged 9 commits into from
May 16, 2018
Merged

Example app #101

merged 9 commits into from
May 16, 2018

Conversation

isaachier
Copy link
Contributor

No description provided.

Isaac Hier added 3 commits May 8, 2018 19:49
Signed-off-by: Isaac Hier <ihier@uber.com>
Signed-off-by: Isaac Hier <ihier@uber.com>
Signed-off-by: Isaac Hier <ihier@uber.com>
std::cerr << "usage: " << argv[0] << " <config-yaml-path>\n";
return 1;
}
setUpTracer(argv[1]);
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

isaachier and others added 5 commits May 8, 2018 22:13
Signed-off-by: Isaac Hier <isaachier@gmail.com>
Signed-off-by: Isaac Hier <ihier@uber.com>
Signed-off-by: Isaac Hier <ihier@uber.com>
Signed-off-by: Isaac Hier <isaachier@gmail.com>
…into example-app

Signed-off-by: Isaac Hier <isaachier@gmail.com>
Signed-off-by: Isaac Hier <isaachier@gmail.com>
@isaachier
Copy link
Contributor Author

This works now so landing it.

@isaachier isaachier merged commit 772af75 into jaegertracing:master May 16, 2018
@isaachier isaachier deleted the example-app branch May 16, 2018 11:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants