Skip to content

Commit

Permalink
fix(telemetry): sns subject length (#1463)
Browse files Browse the repository at this point in the history
break before reaching 100 characters limit as limit is `<100`
  • Loading branch information
iamKunalGupta authored Mar 11, 2024
1 parent 7d6c489 commit f7a823f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flow/shared/telemetry/sns_message_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ func (s *SNSMessageSenderImpl) SendMessage(ctx context.Context, subject string,
var messageSubjectBuilder strings.Builder
maxSubjectSize := 99
for currentLength, char := range subject {
if currentLength > maxSubjectSize {
break
}
if unicode.IsPrint(char) {
messageSubjectBuilder.WriteRune(char)
} else {
messageSubjectBuilder.WriteRune(' ')
}
if currentLength > maxSubjectSize {
break
}
}
publish, err := s.client.Publish(ctx, &sns.PublishInput{
Message: aws.String(body),
Expand Down

0 comments on commit f7a823f

Please sign in to comment.