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

CentralizedSamplingStrategy constructs a new recorder at each invocation when no service type in sampling request #46

Closed
aapolait opened this issue Dec 10, 2018 · 2 comments
Labels

Comments

@aapolait
Copy link
Contributor

When an AWSXRayRecorder is built without plugins and without explicitly setting the origin, CentralizedSamplingStrategy#shouldTrace will be called with a sampling request that doesn't have a service type. It has the following fallback:

if (!samplingRequest.getServiceType().isPresent()) {
samplingRequest.setServiceType(AWSXRayRecorderBuilder.defaultRecorder().getOrigin());
}

Not only does the fallback construct a new recorder at each invocation, but it also ends up being wasted work because the result of defaultRecorder() won't have any plugins either.

I'd be happy to submit a fix, but don't know what would be your preferred approach:

  1. Just remove the fallback since it isn't working anyway?
  2. Make CentralizedSamplingStrategy or AWSXRayRecorderBuilder have a list of default plugins that will be queried for origin when the recorder doesn't have an origin? (Though it looks like only EC2Plugin could be on the list since ECSPlugin always "matches" and ElasticBeanstalkPlugin is too noisy when it doesn't.)
  3. Something else?
@chrisradek
Copy link
Contributor

@aapolait
Thanks for bringing this up! I'll do some digging to see if this ever worked and what the expected behavior should be.

@chrisradek
Copy link
Contributor

Closing since this was released in version 2.2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants