From 6d1e0fd27cfd742fd61e9269b41593c05eb5be21 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 16 Aug 2024 16:10:19 -0700 Subject: [PATCH 1/2] Update .NET tracing shim to correctly set span status should fix https://github.com/open-telemetry/opentelemetry.io/issues/5006 --- content/en/docs/languages/net/shim.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/docs/languages/net/shim.md b/content/en/docs/languages/net/shim.md index 80f00fd7db44..5ebc24ed5ed9 100644 --- a/content/en/docs/languages/net/shim.md +++ b/content/en/docs/languages/net/shim.md @@ -371,7 +371,7 @@ 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 +`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: @@ -385,7 +385,7 @@ try } catch (Exception ex) { - span.SetStatus(Status.Error, "Something bad happened!"); + span.SetStatus(new(StatusCode.Error, "Something bad happened!")); } ``` @@ -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) } ``` From 150acc415f1078d068823e7ddea67d27bcdbeb62 Mon Sep 17 00:00:00 2001 From: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com> Date: Sat, 17 Aug 2024 01:17:02 +0000 Subject: [PATCH 2/2] Results from /fix:format --- content/en/docs/languages/net/shim.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/languages/net/shim.md b/content/en/docs/languages/net/shim.md index 5ebc24ed5ed9..94271c13ceb9 100644 --- a/content/en/docs/languages/net/shim.md +++ b/content/en/docs/languages/net/shim.md @@ -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 - -`StatusCode.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: