Skip to content

Commit

Permalink
convert message key to string
Browse files Browse the repository at this point in the history
  • Loading branch information
simaoribeiro committed Oct 17, 2023
1 parent 5a90dce commit ec7a491
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ private static IEnumerable<string> ExtractTraceContextIntoBasicProperties(IMessa

private static void SetConsumerTags(IMessageContext context, Activity activity)
{
var messageKey = Encoding.UTF8.GetString(context.Message.Key as byte[]);

activity.SetTag(ActivitySourceAccessor.AttributeMessagingOperation, ProcessString);
activity.SetTag(AttributeMessagingSourceName, context.ConsumerContext.Topic);
activity.SetTag(AttributeMessagingKafkaConsumerGroup, context.ConsumerContext.GroupId);
activity.SetTag(ActivitySourceAccessor.AttributeMessagingKafkaMessageKey, context.Message.Key);
activity.SetTag(ActivitySourceAccessor.AttributeMessagingKafkaMessageKey, messageKey);
activity.SetTag(ActivitySourceAccessor.AttributeMessagingKafkaMessageOffset, context.ConsumerContext.Offset);
activity.SetTag(AttributeMessagingKafkaSourcePartition, context.ConsumerContext.Partition);
}
Expand Down

0 comments on commit ec7a491

Please sign in to comment.