Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .generated.NoMobile.sln
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "integration-test", "integra
integration-test\pester.ps1 = integration-test\pester.ps1
integration-test\ios.Tests.ps1 = integration-test\ios.Tests.ps1
integration-test\msbuild.Tests.ps1 = integration-test\msbuild.Tests.ps1
integration-test\android.Tests.ps1 = integration-test\android.Tests.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net4-console", "net4-console", "{33793113-C7B5-434D-B5C1-6CA1A9587842}"
Expand All @@ -290,6 +291,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Extensions.AI", "src
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Extensions.AI.Tests", "test\Sentry.Extensions.AI.Tests\Sentry.Extensions.AI.Tests.csproj", "{28D6E004-DC64-464F-91BE-BC0B3A8E543F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.AspNetCore.Blazor.WebAssembly.Tests", "test\Sentry.AspNetCore.Blazor.WebAssembly.Tests\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj", "{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1357,6 +1360,18 @@ Global
{28D6E004-DC64-464F-91BE-BC0B3A8E543F}.Release|x64.Build.0 = Release|Any CPU
{28D6E004-DC64-464F-91BE-BC0B3A8E543F}.Release|x86.ActiveCfg = Release|Any CPU
{28D6E004-DC64-464F-91BE-BC0B3A8E543F}.Release|x86.Build.0 = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|x64.ActiveCfg = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|x64.Build.0 = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|x86.ActiveCfg = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|x86.Build.0 = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|Any CPU.Build.0 = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|x64.ActiveCfg = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|x64.Build.0 = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|x86.ActiveCfg = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1457,5 +1472,6 @@ Global
{3D91128A-5695-4BAE-B939-5F5F7C56A679} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
{AE461926-00B8-4FDD-A41D-3C83C2D9A045} = {230B9384-90FD-4551-A5DE-1A5C197F25B6}
{28D6E004-DC64-464F-91BE-BC0B3A8E543F} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Features

- Add navigation breadcrumbs for Blazor WebAssembly ([#4907](https://github.com/getsentry/sentry-dotnet/pull/4907))
- Add _experimental_ support for [Sentry trace-connected Metrics](https://docs.sentry.io/product/explore/metrics/) ([#4834](https://github.com/getsentry/sentry-dotnet/pull/4834))
- Extended `SentryThread` by `Main` to allow indication whether the thread is considered the current main thread ([#4807](https://github.com/getsentry/sentry-dotnet/pull/4807))

Expand Down
1 change: 1 addition & 0 deletions Sentry-CI-Build-Linux-NoMobile.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"src\\Sentry.Serilog\\Sentry.Serilog.csproj",
"src\\Sentry\\Sentry.csproj",
"test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
"test\\Sentry.AspNetCore.Blazor.WebAssembly.Tests\\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj",
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
Expand Down
1 change: 1 addition & 0 deletions Sentry-CI-Build-Linux.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"src\\Sentry\\Sentry.csproj",
"test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
"test\\Sentry.Android.AssemblyReader.Tests\\Sentry.Android.AssemblyReader.Tests.csproj",
"test\\Sentry.AspNetCore.Blazor.WebAssembly.Tests\\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj",
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
Expand Down
1 change: 1 addition & 0 deletions Sentry-CI-Build-Windows-arm64.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"src\\Sentry\\Sentry.csproj",
"test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
"test\\Sentry.AspNet.Tests\\Sentry.AspNet.Tests.csproj",
"test\\Sentry.AspNetCore.Blazor.WebAssembly.Tests\\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj",
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
Expand Down
1 change: 1 addition & 0 deletions Sentry-CI-Build-Windows.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"src\\Sentry\\Sentry.csproj",
"test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
"test\\Sentry.AspNet.Tests\\Sentry.AspNet.Tests.csproj",
"test\\Sentry.AspNetCore.Blazor.WebAssembly.Tests\\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj",
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
Expand Down
1 change: 1 addition & 0 deletions Sentry-CI-Build-macOS.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"src\\Sentry\\Sentry.csproj",
"test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
"test\\Sentry.Android.AssemblyReader.Tests\\Sentry.Android.AssemblyReader.Tests.csproj",
"test\\Sentry.AspNetCore.Blazor.WebAssembly.Tests\\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj",
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
Expand Down
15 changes: 15 additions & 0 deletions Sentry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Extensions.AI", "src
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Extensions.AI.Tests", "test\Sentry.Extensions.AI.Tests\Sentry.Extensions.AI.Tests.csproj", "{28D6E004-DC64-464F-91BE-BC0B3A8E543F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.AspNetCore.Blazor.WebAssembly.Tests", "test\Sentry.AspNetCore.Blazor.WebAssembly.Tests\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj", "{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1358,6 +1360,18 @@ Global
{28D6E004-DC64-464F-91BE-BC0B3A8E543F}.Release|x64.Build.0 = Release|Any CPU
{28D6E004-DC64-464F-91BE-BC0B3A8E543F}.Release|x86.ActiveCfg = Release|Any CPU
{28D6E004-DC64-464F-91BE-BC0B3A8E543F}.Release|x86.Build.0 = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|x64.ActiveCfg = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|x64.Build.0 = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|x86.ActiveCfg = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Debug|x86.Build.0 = Debug|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|Any CPU.Build.0 = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|x64.ActiveCfg = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|x64.Build.0 = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|x86.ActiveCfg = Release|Any CPU
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1458,5 +1472,6 @@ Global
{3D91128A-5695-4BAE-B939-5F5F7C56A679} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
{AE461926-00B8-4FDD-A41D-3C83C2D9A045} = {230B9384-90FD-4551-A5DE-1A5C197F25B6}
{28D6E004-DC64-464F-91BE-BC0B3A8E543F} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
{705223D7-FEE3-485B-8DFB-3F9B29DAC6CA} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions SentryAspNetCore.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"src\\Sentry.Serilog\\Sentry.Serilog.csproj",
"src\\Sentry\\Sentry.csproj",
"test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
"test\\Sentry.AspNetCore.Blazor.WebAssembly.Tests\\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj",
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
Expand Down
1 change: 1 addition & 0 deletions SentryNoMobile.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"src\\Sentry\\Sentry.csproj",
"test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
"test\\Sentry.AspNet.Tests\\Sentry.AspNet.Tests.csproj",
"test\\Sentry.AspNetCore.Blazor.WebAssembly.Tests\\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj",
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
Expand Down
1 change: 1 addition & 0 deletions SentryNoSamples.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
"test\\Sentry.Android.AssemblyReader.Tests\\Sentry.Android.AssemblyReader.Tests.csproj",
"test\\Sentry.AspNet.Tests\\Sentry.AspNet.Tests.csproj",
"test\\Sentry.AspNetCore.Blazor.WebAssembly.Tests\\Sentry.AspNetCore.Blazor.WebAssembly.Tests.csproj",
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Options;
using Sentry.Extensibility;

namespace Sentry.AspNetCore.Blazor.WebAssembly.Internal;

internal sealed class BlazorWasmOptionsSetup : IConfigureOptions<SentryBlazorOptions>
{
private readonly NavigationManager _navigationManager;
private readonly IHub _hub;
private bool _initialized;

public BlazorWasmOptionsSetup(NavigationManager navigationManager)
: this(navigationManager, HubAdapter.Instance)
{
}

internal BlazorWasmOptionsSetup(NavigationManager navigationManager, IHub hub)
{
_navigationManager = navigationManager;
_hub = hub;
}

public void Configure(SentryBlazorOptions options)
{
ArgumentNullException.ThrowIfNull(options);

if (_initialized)
{
return;
}
_initialized = true;

var previousUrl = _navigationManager.Uri;

// Set the initial scope request URL
_hub.ConfigureScope(scope =>
{
scope.Request.Url = ToRelativePath(previousUrl);
});

_navigationManager.LocationChanged += (_, args) =>
{
var from = ToRelativePath(previousUrl);
var to = ToRelativePath(args.Location);

_hub.AddBreadcrumb(
new Breadcrumb(
type: "navigation",
category: "navigation",
data: new Dictionary<string, string>
{
{ "from", from },
{ "to", to }
}));

_hub.ConfigureScope(scope =>
{
scope.Request.Url = to;
});

previousUrl = args.Location;
};
}

private string ToRelativePath(string url)
{
var relative = _navigationManager.ToBaseRelativePath(url);
return "/" + relative;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<ProjectReference Include="..\Sentry\Sentry.csproj" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Sentry.AspNetCore.Blazor.WebAssembly.Tests" PublicKey="$(SentryPublicKey)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.3" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Sentry;
using Sentry.AspNetCore.Blazor.WebAssembly.Internal;
using Sentry.Extensions.Logging;

// ReSharper disable once CheckNamespace - Discoverability
Expand Down Expand Up @@ -30,6 +33,8 @@ public static WebAssemblyHostBuilder UseSentry(this WebAssemblyHostBuilder build
blazorOptions.IsGlobalModeEnabled = true;
});

builder.Services.AddSingleton<IConfigureOptions<SentryBlazorOptions>, BlazorWasmOptionsSetup>();

return builder;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Sentry/Sentry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
<InternalsVisibleTo Include="Sentry.Android.AssemblyReader.Tests" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.AspNet" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.AspNet.Tests" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.AspNetCore.Blazor.WebAssembly" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.AspNetCore" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.AspNetCore.Grpc" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.AspNetCore.Grpc.Tests" PublicKey="$(SentryPublicKey)" />
Expand Down
Loading
Loading