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

Explicitly initialize plugins (fixes #38) #40

Closed
wants to merge 1 commit into from

Conversation

dlsniper
Copy link

This allows a user to import plugins on local development environments which do not have access to AWS metadata without stalling the process at boot time.

Each of the three plugins will need to be imported and initialized manually.
The API will safeguard against multiple requests but it's not goroutine safe.

This allows a user to import plugins on local development environments
which do not have access to AWS metadata without stalling the process
at boot time.

Each of the three plugins will need to be imported and initialized manually.
The API will safeguard against multiple requests but it's not goroutine safe.
@ScottMansfield
Copy link

why not surround the init code with sync.Once to make them concurrent safe?

@dlsniper
Copy link
Author

dlsniper commented Feb 9, 2018

why not surround the init code with sync.Once to make them concurrent safe?

That's a very good point, I'll update the PR to reflect this, thank you!

@docmerlin
Copy link

Yah, this is a better way of doing it. init forces it to be at starttime and can cause conflicts occasionally.

@dlsniper
Copy link
Author

dlsniper commented Feb 9, 2018

Yah, this is a better way of doing it. init forces it to be at starttime and can cause conflicts occasionally.

This is not why I wanted to change this, please read #38.

_ "github.com/aws/aws-xray-sdk-go/plugins/ec2"
_ "github.com/aws/aws-xray-sdk-go/plugins/beanstalk"
_ "github.com/aws/aws-xray-sdk-go/plugins/ecs"
"github.com/aws/aws-xray-sdk-go/plugins/ec2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please rename these three plugin package since directly changing the plugin behavior under the same package name will not result in any compile or runtime errors for consumers, and will silently fail to record AWS metadata on their segments. Like "github.com/aws/aws-xray-sdk-go/awsplugins/ec2"

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.

4 participants