Skip to content

Commit

Permalink
Adding fix for span creation npe
Browse files Browse the repository at this point in the history
Signed-off-by: Nishchay Malhotra <nishcha@amazon.com>
  • Loading branch information
nishchay21 committed Mar 27, 2024
1 parent 5c4128b commit 47bef14
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ private Span createOtelSpan(SpanCreationContext spanCreationContext, Span parent
private void addInferredAttribute(Span newSpan, SpanCreationContext spanCreationContext) {
// If the current context has this attribute we need to add the same to the span as well.
if (Baggage.current().getEntryValue(TracerContextStorage.INFERRED_SAMPLER) != null
|| spanCreationContext.getAttributes().getAttributesMap().containsKey(TracerContextStorage.INFERRED_SAMPLER)) {
|| (spanCreationContext.getAttributes() != null
&& spanCreationContext.getAttributes().getAttributesMap().containsKey(TracerContextStorage.INFERRED_SAMPLER))) {
newSpan.addAttribute(TracerContextStorage.INFERRED_SAMPLER, true);
}
}
Expand Down

0 comments on commit 47bef14

Please sign in to comment.