Skip to content

Commit

Permalink
Add a comment to RabbitMQ StackTrace tag (#2163)
Browse files Browse the repository at this point in the history
We are logging the full exception.ToString() in the exception.stacktrace tag. Add a comment why this code is correct.
  • Loading branch information
eerhardt authored Feb 12, 2024
1 parent eb08a4a commit b057088
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ private static IConnection CreateConnection(IConnectionFactory factory, int retr
if (connectAttemptActivity is not null)
{
connectAttemptActivity.AddTag("exception.message", ex.Message);
// Note that "exception.stacktrace" is the full exception detail, not just the StackTrace property.
// See https://opentelemetry.io/docs/specs/semconv/attributes-registry/exception/
// and https://github.com/open-telemetry/opentelemetry-specification/pull/697#discussion_r453662519
connectAttemptActivity.AddTag("exception.stacktrace", ex.ToString());
connectAttemptActivity.AddTag("exception.type", ex.GetType().FullName);
connectAttemptActivity.SetStatus(ActivityStatusCode.Error);
Expand Down

0 comments on commit b057088

Please sign in to comment.