-
Notifications
You must be signed in to change notification settings - Fork 545
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
feat(opentelemetry-sampler-aws-xray): add x-ray remote sampler #1443
feat(opentelemetry-sampler-aws-xray): add x-ray remote sampler #1443
Conversation
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.
Mostly minor comments, skeleton looks good though!
packages/opentelemetry-remote-sampler-aws-xray/src/remote-sampler.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-remote-sampler-aws-xray/src/remote-sampler.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-remote-sampler-aws-xray/src/remote-sampler.ts
Outdated
Show resolved
Hide resolved
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.
Thanks for contributing this component.
Left comments on the PR, please write if anything is not clear.
Please also add yourself as the component owner in this file. This means you will be responsible to review and maintain this component in the future.
packages/opentelemetry-remote-sampler-aws-xray/test/AWSXRayRemoteSampler.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-remote-sampler-aws-xray/test/AWSXRayRemoteSampler.test.ts
Outdated
Show resolved
Hide resolved
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1443 +/- ##
==========================================
- Coverage 96.13% 96.08% -0.06%
==========================================
Files 14 15 +1
Lines 906 945 +39
Branches 197 203 +6
==========================================
+ Hits 871 908 +37
- Misses 35 37 +2
|
packages/opentelemetry-sampler-aws-xray/test/remote-sampler.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-sampler-aws-xray/test/remote-sampler.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-sampler-aws-xray/test/remote-sampler.test.ts
Outdated
Show resolved
Hide resolved
private _endpoint: string; | ||
|
||
constructor(samplerConfig: AWSXRaySamplerConfig) { | ||
this._pollingInterval = |
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.
maybe add some sanity check to avoid negative or terrible small values?
|
||
// fetch sampling rules every polling interval | ||
private getAndUpdateSamplingRules(): void { | ||
setInterval(async () => { |
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.
Does this work reliable in AWS lambda where the runtime simply freezes the process once the handler returned?
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.
AWS Lambda does not support remote sampling, it uses a fixed sampling rate
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.
Maybe mention this incompatibility in the readme.
At least from the package name it's not clear to me that AWS lambda is unsupported.
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.
Sure! I added a note in the readme to indicate that AWS Lambda does not support remote sampling
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.
I'm not too familiar with sampling, but the skeleton looks good. 🙂
Looking forward to the follow-up PRs.
d4a9127
to
e1ff849
Compare
e1ff849
to
0cc5d27
Compare
…loating promise warning
Which problem is this PR solving?
Short description of the changes
opentelemetry-sampler-aws-xray
package to vend this new component since all AWS components in this repo have been split into their own packages.AWSXRayRemoteSampler
skeleton class, which will have more logic added in the next PR for matching sampling rules.shouldSample
andtoString
methods have been implemented, but currently return values that will be updated in coming PRs.AWSXRayRemoteSampler
allows for specifying a polling interval and will fetch sampling rules periodically using that interval using thesetInterval
function.remote-sampler.types.ts
file houses all the interfaces / data models that the X-Ray remote sampler uses. All interfaces will be defined in this file and additional interfaces will also be added there.