diff --git a/src/MongoDB.Driver.Core.Extensions.DiagnosticSources/DiagnosticsActivityEventSubscriber.cs b/src/MongoDB.Driver.Core.Extensions.DiagnosticSources/DiagnosticsActivityEventSubscriber.cs index 01abc9d..ec5401e 100644 --- a/src/MongoDB.Driver.Core.Extensions.DiagnosticSources/DiagnosticsActivityEventSubscriber.cs +++ b/src/MongoDB.Driver.Core.Extensions.DiagnosticSources/DiagnosticsActivityEventSubscriber.cs @@ -86,8 +86,6 @@ private void Handle(CommandSucceededEvent @event) { WithReplacedActivityCurrent(activity, () => { - activity.AddTag("otel.status_code", "OK"); - activity.SetStatus(ActivityStatusCode.Ok); activity.Stop(); }); } @@ -101,8 +99,7 @@ private void Handle(CommandFailedEvent @event) { if (activity.IsAllDataRequested) { - activity.AddTag("otel.status_code", "ERROR"); - activity.AddTag("otel.status_description", @event.Failure.Message); + activity.SetStatus(ActivityStatusCode.Error, @event.Failure.Message); activity.AddTag("exception.type", @event.Failure.GetType().FullName); activity.AddTag("exception.message", @event.Failure.Message); activity.AddTag("exception.stacktrace", @event.Failure.StackTrace);