ActivityExtensions.SetStatus vs Activity.Status #4703
Replies: 2 comments
-
|
@jamescrosswell If you are using the latest stable version of SDK, you can simply call |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @vishweshbankwar... that makes sense. Maybe worth adding an |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The docs for ActivityExtensions.SetStatus indicate:
And the implementation for that extension method just sets a couple of otel tags on the activity:
There is an
Activity.Statusproperty in .NET 7.This is a bit confusing. The
Activity.Statusof the span/activity that you get from the following code isActivityStatusCode.Unset... not what you'd expect:Is this because the
Activityclass on older versions of the .NET Framework didn't have aStatusfield?I wonder if it makes sense to augment the implementation of
ActivityExtensions.SetStatuswith something like:ToActivityStatusCodecould probably be avoided by writing an implicit conversion operator forOpenTelemetry.Trace.Status.Beta Was this translation helpful? Give feedback.
All reactions