Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugin support #36

Merged
merged 43 commits into from
Feb 25, 2020
Merged

Add plugin support #36

merged 43 commits into from
Feb 25, 2020

Conversation

rnburn
Copy link
Contributor

@rnburn rnburn commented Feb 3, 2020

Adds an interface for loading tracer as plugins.

The plugin-tracer interface only use types that have well defined ABIs. Provided the standard-c++ library is suitably linked, plugins can be portable and not tied to a particular standard-c++ library implementation.

Because we're not far enough along with a tracer implementation to test against, this also adds a small dynamic load example for testing. But it can be replaced when there's an SDK implementation.

Copy link

@jmacd jmacd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Copy link
Contributor

@g-easy g-easy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

opentelemetry::nostd::string_view name,
const opentelemetry::trace::StartSpanOptions &options) noexcept override;

private:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop what?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty private: section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. Removed.

{
if (argc != 3)
{
std::cerr << "Usage: load_plugin <plugin> <confg>\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks.

ci/do_ci.sh Outdated
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-Werror" \
"${SRC_DIR}"
make
make test
exit 0
elif [[ "$1" == "cmake.build_example_plugin" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update ci/README.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@rnburn rnburn changed the title WIP: Add plugin support Add plugin support Feb 24, 2020
{
namespace detail
{
inline void CopyErrorMessage(const char *source, std::string &destination) noexcept
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this isn't a virtual, can it just use std::string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's using a std::string for the destination.

It takes a const char* instead of string_view or string for the source to handle the case when it might be a nullptr.

@rnburn rnburn merged commit 4dd7a6b into open-telemetry:master Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants