Skip to content

Commit 9148ca9

Browse files
committed
Merge branch 'main' into update-sample-tfms
2 parents d591f4d + 0e30c90 commit 9148ca9

File tree

19 files changed

+66
-60
lines changed

19 files changed

+66
-60
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ body:
4848
attributes:
4949
label: .NET Version
5050
description: If using .NET Core, please copy the output of 'dotnet --version' here
51-
placeholder: 9.0.200 ← should look like this
51+
placeholder: 10.0.100 ← should look like this
5252
validations:
5353
required: true
5454

@@ -81,11 +81,13 @@ body:
8181
label: Development Environment
8282
description: What development environment are you using
8383
options:
84-
- Visual Studio v17.x
84+
- Visual Studio v18.x
8585
- Visual Studio Code (Windows)
86-
- Visual Studio Code (MacOS)
87-
- Rider 2024 (Windows)
88-
- Rider 2024 (MacOS)
86+
- Visual Studio Code (macOS)
87+
- Visual Studio Code (Linux)
88+
- Rider 2025.x (Windows)
89+
- Rider 2025.x (macOS)
90+
- Rider 2025.x (Linux)
8991
- Other
9092
validations:
9193
required: true

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,10 @@ jobs:
265265
path: src
266266

267267
- name: Integration test
268-
# # Note that when upgsading .NET versions, linux-musl may need special handling... see comments below
268+
# # Note that when upgrading .NET versions, linux-musl may need special handling... see comments below
269269
# if: ${{ (matrix.rid != 'linux-musl-x64') && (matrix.rid != 'linux-musl-arm64') }}
270+
# TODO: Re-enable once we have resolved https://github.com/getsentry/sentry-dotnet/issues/4788
271+
if: ${{ (matrix.rid != 'linux-musl-x64') }}
270272
uses: getsentry/github-workflows/sentry-cli/integration-test/@a5e409bd5bad4c295201cdcfe862b17c50b29ab7 # v2.14.1
271273
with:
272274
path: integration-test

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: ./.github/actions/environment
3636

3737
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
38+
uses: github/codeql-action/init@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5
3939
with:
4040
languages: csharp
4141

@@ -49,6 +49,6 @@ jobs:
4949
run: dotnet build Sentry-CI-CodeQL.slnf --no-restore --nologo
5050

5151
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
52+
uses: github/codeql-action/analyze@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5
5353
with:
5454
category: '/language:csharp'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Remove `SentryLoggingOptions.ExperimentalLogging.MinimumLogLevel`. _Structured Logs_ can now be configured via the `"Sentry"` logging provider (e.g. in `appsettings.json` and `appsettings.{HostEnvironment}.json`) ([#4700](https://github.com/getsentry/sentry-dotnet/pull/4700))
88
- All logging provider types are _internal_ now in order to ensure configuration as intended ([#4700](https://github.com/getsentry/sentry-dotnet/pull/4700))
9+
- Rename `SentryLog.ParentSpanId` to `SentryLog.SpanId` reflecting the protocol change ([#4778](https://github.com/getsentry/sentry-dotnet/pull/4778))
910

1011
### Features
1112

samples/Sentry.Samples.Console.Basic/Program.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ async Task SecondFunction()
9191
{
9292
// This is an example of capturing a handled exception.
9393
SentrySdk.CaptureException(exception);
94-
span.Finish(exception);
9594

95+
// This is an example of capturing a structured log.
9696
SentrySdk.Logger.LogError(static log => log.SetAttribute("method", nameof(SecondFunction)),
9797
"Error with message: {0}", exception.Message);
98+
99+
span.Finish(exception);
98100
}
99101
finally
100102
{
@@ -112,9 +114,10 @@ async Task ThirdFunction()
112114
// Simulate doing some work
113115
await Task.Delay(100);
114116

117+
// This is an example of a structured log that is filtered via the 'SetBeforeSendLog' delegate above.
115118
SentrySdk.Logger.LogFatal(static log => log.SetAttribute("suppress", true),
116119
"Crash imminent!");
117120

118-
// This is an example of an unhandled exception. It will be captured automatically.
121+
// This is an example of an unhandled exception. It will be captured automatically.
119122
throw new InvalidOperationException("Something happened that crashed the app!");
120123
}

samples/Sentry.Samples.OpenTelemetry.AzureFunctions/Program.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
using Microsoft.Extensions.DependencyInjection;
12
using Microsoft.Extensions.Hosting;
23
using Microsoft.Extensions.Logging;
3-
using OpenTelemetry;
44
using OpenTelemetry.Trace;
55
using Sentry.OpenTelemetry;
66

7-
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
8-
.AddSentry() // <-- Configure OpenTelemetry to send traces to Sentry
9-
.AddHttpClientInstrumentation() // From OpenTelemetry.Instrumentation.Http... adds automatic tracing for outgoing HTTP requests
10-
.Build();
11-
127
var host = new HostBuilder()
138
.ConfigureFunctionsWorkerDefaults()
9+
.ConfigureServices(services =>
10+
{
11+
services.AddOpenTelemetry().WithTracing(builder =>
12+
{
13+
builder
14+
.AddSentry() // <-- Configure OpenTelemetry to send traces to Sentry
15+
.AddHttpClientInstrumentation(); // From OpenTelemetry.Instrumentation.Http... adds automatic tracing for outgoing HTTP requests
16+
});
17+
})
1418
.ConfigureLogging(logging =>
1519
{
1620
logging.AddSentry(options =>

samples/Sentry.Samples.OpenTelemetry.AzureFunctions/Sentry.Samples.OpenTelemetry.AzureFunctions.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.3.0" />
1111
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
1212
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.7" />
13-
<PackageReference Include="OpenTelemetry" Version="1.13.0" />
14-
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.13.0" />
13+
<PackageReference Include="OpenTelemetry" Version="1.14.0" />
14+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
15+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0" />
1516
</ItemGroup>
1617

1718
<ItemGroup>

src/Sentry.Extensions.Logging/SentryStructuredLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
8484
{
8585
Template = template,
8686
Parameters = parameters.DrainToImmutable(),
87-
ParentSpanId = spanId,
87+
SpanId = spanId,
8888
};
8989

9090
log.SetDefaultAttributes(_options, _sdk);

src/Sentry.Serilog/SentrySink.Structured.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ private static void CaptureStructuredLog(IHub hub, SentryOptions options, LogEve
1414
{
1515
Template = template,
1616
Parameters = parameters,
17-
ParentSpanId = spanId,
17+
SpanId = spanId,
1818
};
1919

2020
log.SetDefaultAttributes(options, Sdk);

src/Sentry/Internal/DefaultSentryStructuredLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private protected override void CaptureLog(SentryLogLevel level, string template
5555
{
5656
Template = template,
5757
Parameters = @params,
58-
ParentSpanId = spanId,
58+
SpanId = spanId,
5959
};
6060

6161
try

0 commit comments

Comments
 (0)