Skip to content

Commit

Permalink
Update SetTag to be a no-op if attribute name is null or empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ppittle committed Dec 6, 2024
1 parent d76b00c commit 469ef9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Shared/AWS/AWSSemanticConventions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ private static T Add<T>(this T attributes, Func<AWSSemanticConventionsBase, stri

var attributeName = attributeNameFunc(semanticConventionVersionImpl);

// if attributeName is empty, exit
if (string.IsNullOrEmpty(attributeName))
{
return activity;
}

activity?.SetTag(attributeName, value);

return activity;
Expand Down

0 comments on commit 469ef9d

Please sign in to comment.