Skip to content

Commit 5c0509e

Browse files
committed
Merge branch 'main' into logs/ref-traceid-parentspanid
2 parents a80bd4f + 0c6ca6a commit 5c0509e

14 files changed

+20
-151
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
- In MAUI Android apps, generate and inject UUID to APK and upload ProGuard mapping to Sentry with the UUID ([#4532](https://github.com/getsentry/sentry-dotnet/pull/4532))
1616
- Fixed WASM0001 warning when building Blazor WebAssembly projects ([#4519](https://github.com/getsentry/sentry-dotnet/pull/4519))
1717

18+
### API Changes
19+
20+
- Remove `ExperimentalAttribute` from all _Structured Logs_ APIs, and remove `Experimental` property from `SentrySdk`, but keep `Experimental` property on `SentryOptions` ([#4567](https://github.com/getsentry/sentry-dotnet/pull/4567))
21+
1822
### Dependencies
1923

2024
- Bump Cocoa SDK from v8.56.0 to v8.56.2 ([#4555](https://github.com/getsentry/sentry-dotnet/pull/4555), [#4572](https://github.com/getsentry/sentry-dotnet/pull/4572))

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// This option tells Sentry to capture 100% of traces. You still need to start transactions and spans.
3838
options.TracesSampleRate = 1.0;
3939

40-
// This option enables Sentry Logs created via SentrySdk.Experimental.Logger.
40+
// This option enables Sentry Logs created via SentrySdk.Logger.
4141
options.Experimental.EnableLogs = true;
4242
options.Experimental.SetBeforeSendLog(static log =>
4343
{
@@ -73,7 +73,7 @@ async Task FirstFunction()
7373
var httpClient = new HttpClient(messageHandler, true);
7474
var html = await httpClient.GetStringAsync("https://example.com/");
7575
WriteLine(html);
76-
SentrySdk.Experimental.Logger.LogInfo("HTTP Request completed.");
76+
SentrySdk.Logger.LogInfo("HTTP Request completed.");
7777
}
7878

7979
async Task SecondFunction()
@@ -94,7 +94,7 @@ async Task SecondFunction()
9494
SentrySdk.CaptureException(exception);
9595
span.Finish(exception);
9696

97-
SentrySdk.Experimental.Logger.LogError(static log => log.SetAttribute("method", nameof(SecondFunction)),
97+
SentrySdk.Logger.LogError(static log => log.SetAttribute("method", nameof(SecondFunction)),
9898
"Error with message: {0}", exception.Message);
9999
}
100100

@@ -109,7 +109,7 @@ async Task ThirdFunction()
109109
// Simulate doing some work
110110
await Task.Delay(100);
111111

112-
SentrySdk.Experimental.Logger.LogFatal(static log => log.SetAttribute("suppress", true),
112+
SentrySdk.Logger.LogFatal(static log => log.SetAttribute("suppress", true),
113113
"Crash imminent!");
114114

115115
// This is an example of an unhandled exception. It will be captured automatically.

src/Sentry/Extensibility/DisabledHub.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ public void CaptureUserFeedback(UserFeedback userFeedback)
257257

258258
/// <summary>
259259
/// Disabled Logger.
260-
/// <para>This API is experimental and it may change in the future.</para>
261260
/// </summary>
262-
[Experimental(Infrastructure.DiagnosticId.ExperimentalFeature)]
263261
public SentryStructuredLogger Logger => DisabledSentryStructuredLogger.Instance;
264262
}

src/Sentry/Extensibility/HubAdapter.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ private HubAdapter() { }
3434

3535
/// <summary>
3636
/// Forwards the call to <see cref="SentrySdk"/>.
37-
/// <para>This API is experimental and it may change in the future.</para>
3837
/// </summary>
39-
[Experimental(DiagnosticId.ExperimentalFeature)]
40-
public SentryStructuredLogger Logger { [DebuggerStepThrough] get => SentrySdk.Experimental.Logger; }
38+
public SentryStructuredLogger Logger { [DebuggerStepThrough] get => SentrySdk.Logger; }
4139

4240
/// <summary>
4341
/// Forwards the call to <see cref="SentrySdk"/>.

src/Sentry/IHub.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public interface IHub : ISentryClient, ISentryScopeManager
1919

2020
/// <summary>
2121
/// Creates and sends logs to Sentry.
22-
/// <para>This API is experimental and it may change in the future.</para>
2322
/// </summary>
2423
/// <remarks>
2524
/// Available options:
@@ -28,7 +27,6 @@ public interface IHub : ISentryClient, ISentryScopeManager
2827
/// <item><see cref="Sentry.SentryOptions.SentryExperimentalOptions.SetBeforeSendLog(System.Func{SentryLog, SentryLog})"/></item>
2928
/// </list>
3029
/// </remarks>
31-
[Experimental(Infrastructure.DiagnosticId.ExperimentalFeature)]
3230
public SentryStructuredLogger Logger { get; }
3331

3432
/// <summary>

src/Sentry/SentryLog.cs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
namespace Sentry;
77

88
/// <summary>
9-
/// Represents the Sentry Log protocol.
10-
/// <para>This API is experimental and it may change in the future.</para>
9+
/// Represents a Sentry Structured Log.
1110
/// </summary>
12-
[Experimental(DiagnosticId.ExperimentalFeature)]
11+
/// <remarks>
12+
/// Sentry Docs: <see href="https://docs.sentry.io/product/explore/logs/"/>.
13+
/// Sentry Developer Documentation: <see href="https://develop.sentry.dev/sdk/telemetry/logs/"/>.
14+
/// Sentry .NET SDK Docs: <see href="https://docs.sentry.io/platforms/dotnet/logs/"/>.
15+
/// </remarks>
1316
[DebuggerDisplay(@"SentryLog \{ Level = {Level}, Message = '{Message}' \}")]
1417
public sealed class SentryLog
1518
{
@@ -28,59 +31,44 @@ internal SentryLog(DateTimeOffset timestamp, SentryId traceId, SentryLogLevel le
2831

2932
/// <summary>
3033
/// The timestamp of the log.
31-
/// <para>This API is experimental and it may change in the future.</para>
3234
/// </summary>
3335
/// <remarks>
3436
/// Sent as seconds since the Unix epoch.
3537
/// </remarks>
36-
[Experimental(DiagnosticId.ExperimentalFeature)]
3738
public required DateTimeOffset Timestamp { get; init; }
3839

3940
/// <summary>
4041
/// The trace id of the log.
41-
/// <para>This API is experimental and it may change in the future.</para>
4242
/// </summary>
43-
[Experimental(DiagnosticId.ExperimentalFeature)]
4443
public required SentryId TraceId { get; init; }
4544

4645
/// <summary>
4746
/// The severity level of the log.
48-
/// <para>This API is experimental and it may change in the future.</para>
4947
/// </summary>
50-
[Experimental(DiagnosticId.ExperimentalFeature)]
5148
public required SentryLogLevel Level { get; init; }
5249

5350
/// <summary>
5451
/// The formatted log message.
55-
/// <para>This API is experimental and it may change in the future.</para>
5652
/// </summary>
57-
[Experimental(DiagnosticId.ExperimentalFeature)]
5853
public required string Message { get; init; }
5954

6055
/// <summary>
6156
/// The parameterized template string.
62-
/// <para>This API is experimental and it may change in the future.</para>
6357
/// </summary>
64-
[Experimental(DiagnosticId.ExperimentalFeature)]
6558
public string? Template { get; init; }
6659

6760
/// <summary>
6861
/// The parameters to the template string.
69-
/// <para>This API is experimental and it may change in the future.</para>
7062
/// </summary>
71-
[Experimental(DiagnosticId.ExperimentalFeature)]
7263
public ImmutableArray<KeyValuePair<string, object>> Parameters { get; init; }
7364

7465
/// <summary>
7566
/// The span id of the span that was active when the log was collected.
76-
/// <para>This API is experimental and it may change in the future.</para>
7767
/// </summary>
78-
[Experimental(DiagnosticId.ExperimentalFeature)]
7968
public SpanId? ParentSpanId { get; init; }
8069

8170
/// <summary>
8271
/// Gets the attribute value associated with the specified key.
83-
/// <para>This API is experimental and it may change in the future.</para>
8472
/// </summary>
8573
/// <remarks>
8674
/// Returns <see langword="true"/> if the <see cref="SentryLog"/> contains an attribute with the specified key and it's value is not <see langword="null"/>.
@@ -129,7 +117,6 @@ internal SentryLog(DateTimeOffset timestamp, SentryId traceId, SentryLogLevel le
129117
/// </list>
130118
/// </remarks>
131119
/// <seealso href="https://develop.sentry.dev/sdk/telemetry/logs/"/>
132-
[Experimental(DiagnosticId.ExperimentalFeature)]
133120
public bool TryGetAttribute(string key, [NotNullWhen(true)] out object? value)
134121
{
135122
if (_attributes.TryGetValue(key, out var attribute) && attribute.Value is not null)
@@ -156,9 +143,7 @@ internal bool TryGetAttribute(string key, [NotNullWhen(true)] out string? value)
156143

157144
/// <summary>
158145
/// Set a key-value pair of data attached to the log.
159-
/// <para>This API is experimental and it may change in the future.</para>
160146
/// </summary>
161-
[Experimental(DiagnosticId.ExperimentalFeature)]
162147
public void SetAttribute(string key, object value)
163148
{
164149
_attributes[key] = new SentryAttribute(value);

src/Sentry/SentryLogLevel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using Sentry.Extensibility;
2-
using Sentry.Infrastructure;
32

43
namespace Sentry;
54

65
/// <summary>
76
/// The severity of the structured log.
8-
/// <para>This API is experimental and it may change in the future.</para>
97
/// </summary>
108
/// <remarks>
119
/// The named constants use the value of the lowest severity number per severity level:
@@ -41,7 +39,6 @@ namespace Sentry;
4139
/// </list>
4240
/// </remarks>
4341
/// <seealso href="https://develop.sentry.dev/sdk/telemetry/logs/"/>
44-
[Experimental(DiagnosticId.ExperimentalFeature)]
4542
public enum SentryLogLevel
4643
{
4744
/// <summary>

src/Sentry/SentryOptions.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,6 @@ internal static List<StringOrRegex> GetDefaultInAppExclude() =>
18701870
/// <remarks>
18711871
/// This and related experimental APIs may change in the future.
18721872
/// </remarks>
1873-
[Experimental(DiagnosticId.ExperimentalFeature)]
18741873
public SentryExperimentalOptions Experimental { get; set; } = new();
18751874

18761875
/// <summary>
@@ -1879,7 +1878,6 @@ internal static List<StringOrRegex> GetDefaultInAppExclude() =>
18791878
/// <remarks>
18801879
/// This and related experimental APIs may change in the future.
18811880
/// </remarks>
1882-
[Experimental(DiagnosticId.ExperimentalFeature)]
18831881
public sealed class SentryExperimentalOptions
18841882
{
18851883
internal SentryExperimentalOptions()
@@ -1889,7 +1887,6 @@ internal SentryExperimentalOptions()
18891887
/// <summary>
18901888
/// When set to <see langword="true"/>, logs are sent to Sentry.
18911889
/// Defaults to <see langword="false"/>.
1892-
/// <para>This API is experimental and it may change in the future.</para>
18931890
/// </summary>
18941891
/// <seealso href="https://develop.sentry.dev/sdk/telemetry/logs/"/>
18951892
public bool EnableLogs { get; set; } = false;
@@ -1901,7 +1898,6 @@ internal SentryExperimentalOptions()
19011898
/// <summary>
19021899
/// Sets a callback function to be invoked before sending the log to Sentry.
19031900
/// When the delegate throws an <see cref="Exception"/> during invocation, the log will not be captured.
1904-
/// <para>This API is experimental and it may change in the future.</para>
19051901
/// </summary>
19061902
/// <remarks>
19071903
/// It can be used to modify the log object before being sent to Sentry.

src/Sentry/SentrySdk.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -284,18 +284,8 @@ public void Dispose()
284284
/// </summary>
285285
public static bool IsEnabled { [DebuggerStepThrough] get => CurrentHub.IsEnabled; }
286286

287-
/// <summary>
288-
/// Experimental Sentry SDK features.
289-
/// </summary>
290-
/// <remarks>
291-
/// This and related experimental APIs may change in the future.
292-
/// </remarks>
293-
[Experimental(DiagnosticId.ExperimentalFeature)]
294-
public static class Experimental
295-
{
296-
/// <inheritdoc cref="IHub.Logger" />
297-
public static SentryStructuredLogger Logger { [DebuggerStepThrough] get => CurrentHub.Logger; }
298-
}
287+
/// <inheritdoc cref="IHub.Logger" />
288+
public static SentryStructuredLogger Logger { [DebuggerStepThrough] get => CurrentHub.Logger; }
299289

300290
/// <summary>
301291
/// Creates a new scope that will terminate when disposed.

0 commit comments

Comments
 (0)