Skip to content

Commit

Permalink
Fixed Sentry SDK has not been initialised (#2918)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell authored Nov 29, 2023
1 parent 10c752f commit bcb10be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Fixed Sentry SDK has not been initialised when using ASP.NET Core, Serilog and OpenTelemetry ([#2918](https://github.com/getsentry/sentry-dotnet/pull/2918))

## 3.41.2

### Fixes
Expand Down
3 changes: 2 additions & 1 deletion src/Sentry.OpenTelemetry/TracerProviderBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public static TracerProviderBuilder AddSentry(this TracerProviderBuilder tracerP
enrichers.Add(new AspNetCoreEnricher(userFactory));
}
return new SentrySpanProcessor(SentrySdk.CurrentHub, enrichers);
var hub = services.GetRequiredService<IHub>();
return new SentrySpanProcessor(hub, enrichers);
});
}
}

0 comments on commit bcb10be

Please sign in to comment.