diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md index 5e348666eef..d4bf9c4ac26 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md @@ -2,6 +2,16 @@ ## Unreleased +* Added support for Activity Status and StatusDescription which were + added to Activity from `System.Diagnostics.DiagnosticSource` version 6.0. + Prior to version 6.0, setting the status of an Activity was provided by the + .NET OpenTelemetry API via the `Activity.SetStatus` extension method in the + `OpenTelemetry.Trace` namespace. Internally, this extension method added the + status as tags on the Activity: `otel.status_code` and `otel.status_description`. + Therefore, to maintain backward compatibility, the exporter falls back to using + these tags to infer status. + ([#3100](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3100)) + * Fixed OTLP metric exporter to default to a periodic 60 second export cycle. A bug was introduced in #2717 that caused the OTLP metric export to default to a manual export cycle (i.e., requiring an explicit flush). A workaround diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs index a5bd1c90f88..330e0b140d7 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs @@ -178,7 +178,7 @@ internal static OtlpTrace.Span ToOtlpSpan(this Activity activity) otlpTags.Tags.Return(); } - otlpSpan.Status = ToOtlpStatus(ref otlpTags); + otlpSpan.Status = activity.ToOtlpStatus(ref otlpTags); EventEnumerationState otlpEvents = default; activity.EnumerateEvents(ref otlpEvents); @@ -237,24 +237,42 @@ internal static OtlpCommon.KeyValue ToOtlpAttribute(this KeyValuePair