File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
incubator/opentelemetry-sampler-aws-xray/src Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ export class _AWSXRayRemoteSampler implements Sampler {
125125 ? samplerConfig . endpoint
126126 : DEFAULT_AWS_PROXY_ENDPOINT ;
127127 this . fallbackSampler = new FallbackSampler ( ) ;
128+ // TODO: Use clientId for retrieving Sampling Targets
128129 this . clientId = _AWSXRayRemoteSampler . generateClientId ( ) ;
129130 this . ruleCache = new RuleCache ( samplerConfig . resource ) ;
130131
@@ -161,16 +162,23 @@ export class _AWSXRayRemoteSampler implements Sampler {
161162 ) ;
162163 }
163164
164- const matchedRule : SamplingRuleApplier | undefined =
165- this . ruleCache . getMatchedRule ( attributes ) ;
166- if ( matchedRule ) {
167- return matchedRule . shouldSample (
168- context ,
169- traceId ,
170- spanName ,
171- spanKind ,
172- attributes ,
173- links
165+ try {
166+ const matchedRule : SamplingRuleApplier | undefined =
167+ this . ruleCache . getMatchedRule ( attributes ) ;
168+ if ( matchedRule ) {
169+ return matchedRule . shouldSample (
170+ context ,
171+ traceId ,
172+ spanName ,
173+ spanKind ,
174+ attributes ,
175+ links
176+ ) ;
177+ }
178+ } catch ( e : unknown ) {
179+ this . samplerDiag . debug (
180+ 'Unexpected error occurred when trying to match or applying a sampling rule' ,
181+ e
174182 ) ;
175183 }
176184
You can’t perform that action at this time.
0 commit comments