Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update .NET tracing shim to correctly set span status #5050

Merged
merged 3 commits into from
Aug 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/en/docs/languages/net/shim.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ using var span = tracer.StartActiveSpan("another-span", links: links);

A [status](/docs/concepts/signals/traces/#span-status) can be set on a span,
typically used to specify that a span has not completed successfully -
`Status.Error`. In rare scenarios, you could override the `Error` status with
`Ok`, but don't set `Ok` on successfully-completed spans.
`StatusCode.Error`. In rare scenarios, you could override the `Error` status
with `Ok`, but don't set `Ok` on successfully-completed spans.

The status can be set at any time before the span is finished:

Expand All @@ -385,7 +385,7 @@ try
}
catch (Exception ex)
{
span.SetStatus(Status.Error, "Something bad happened!");
span.SetStatus(new(StatusCode.Error, "Something bad happened!"));
}
```

Expand All @@ -403,7 +403,7 @@ try
}
catch (Exception ex)
{
span.SetStatus(Status.Error, "Something bad happened!");
span.SetStatus(new(StatusCode.Error, "Something bad happened!"));
span.RecordException(ex)
}
```
Expand Down