Skip to content

Commit bc68d72

Browse files
committed
Merge branch 'main' into 3773-host_appbuilder
2 parents f2855ce + c6a5d4a commit bc68d72

34 files changed

+350
-169
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @bruno-garcia @jamescrosswell
1+
* @aritchie @jamescrosswell

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- name: Get auth token
2222
id: token
23-
uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
23+
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
2424
with:
2525
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
2626
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Changelog
22

3-
## Unreleased
3+
## 5.1.1
44

55
### Fixes
66

7+
- Emit transaction.data inside contexts.trace.data ([#3936](https://github.com/getsentry/sentry-dotnet/pull/3936))
78
- Native SIGSEGV errors resulting from managed NullReferenceExceptions are now suppressed on Android ([#3903](https://github.com/getsentry/sentry-dotnet/pull/3903))
89
- OTel activities that are marked as not recorded are no longer sent to Sentry ([#3890](https://github.com/getsentry/sentry-dotnet/pull/3890))
910
- Fixed envelopes with oversized attachments getting stuck in __processing ([#3938](https://github.com/getsentry/sentry-dotnet/pull/3938))
10-
- Unknown stack frames in profiles on .NET 8+ ([#3942](https://github.com/getsentry/sentry-dotnet/pull/3942))
11-
- Deduplicate profiling stack frames ([#3941](https://github.com/getsentry/sentry-dotnet/pull/3941))
11+
- OperatingSystem will now return macOS as OS name instead of 'Darwin' as well as the proper version. ([#2710](https://github.com/getsentry/sentry-dotnet/pull/3956))
1212
- Ignore null value on CocoaScopeObserver.SetTag ([#3948](https://github.com/getsentry/sentry-dotnet/pull/3948))
1313
- Add Azure Function UseSentry overloads for easier wire ups ([#3971](https://github.com/getsentry/sentry-dotnet/pull/3971))
14+
- Deduplicate profiling stack frames ([#3969](https://github.com/getsentry/sentry-dotnet/pull/3969))
1415

1516
## 5.1.0
1617

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<VersionPrefix>5.1.0</VersionPrefix>
4+
<VersionPrefix>5.1.1</VersionPrefix>
55
<LangVersion>13</LangVersion>
66
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

src/Sentry.Profiling/SampleProfilerSession.cs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace Sentry.Profiling;
1212
internal class SampleProfilerSession : IDisposable
1313
{
1414
private readonly EventPipeSession _session;
15+
private readonly TraceLogEventSource _eventSource;
1516
private readonly SampleProfilerTraceEventParser _sampleEventParser;
1617
private readonly IDiagnosticLogger? _logger;
1718
private readonly SentryStopwatch _stopwatch;
@@ -22,22 +23,22 @@ private SampleProfilerSession(SentryStopwatch stopwatch, EventPipeSession sessio
2223
{
2324
_session = session;
2425
_logger = logger;
25-
EventSource = eventSource;
26-
_sampleEventParser = new SampleProfilerTraceEventParser(EventSource);
26+
_eventSource = eventSource;
27+
_sampleEventParser = new SampleProfilerTraceEventParser(_eventSource);
2728
_stopwatch = stopwatch;
2829
_processing = processing;
2930
}
3031

3132
// Exposed only for benchmarks.
3233
internal static EventPipeProvider[] Providers = new[]
3334
{
34-
new EventPipeProvider(ClrTraceEventParser.ProviderName, EventLevel.Verbose, (long) (
35-
ClrTraceEventParser.Keywords.Jit
36-
| ClrTraceEventParser.Keywords.NGen
37-
| ClrTraceEventParser.Keywords.Loader
38-
| ClrTraceEventParser.Keywords.Binder
39-
| ClrTraceEventParser.Keywords.JittedMethodILToNativeMap
40-
)),
35+
// Note: all events we need issued by "DotNETRuntime" provider are at "EventLevel.Informational"
36+
// see https://learn.microsoft.com/en-us/dotnet/fundamentals/diagnostics/runtime-events
37+
// TODO replace Keywords.Default with a subset. Currently it is:
38+
// Default = GC | Type | GCHeapSurvivalAndMovement | Binder | Loader | Jit | NGen | SupressNGen
39+
// | StopEnumeration | Security | AppDomainResourceManagement | Exception | Threading | Contention | Stack | JittedMethodILToNativeMap
40+
// | ThreadTransfer | GCHeapAndTypeNames | Codesymbols | Compilation,
41+
new EventPipeProvider(ClrTraceEventParser.ProviderName, EventLevel.Informational, (long) ClrTraceEventParser.Keywords.Default),
4142
new EventPipeProvider(SampleProfilerTraceEventParser.ProviderName, EventLevel.Informational),
4243
// new EventPipeProvider(TplEtwProviderTraceEventParser.ProviderName, EventLevel.Informational, (long) TplEtwProviderTraceEventParser.Keywords.Default)
4344
};
@@ -47,14 +48,11 @@ private SampleProfilerSession(SentryStopwatch stopwatch, EventPipeSession sessio
4748
// need a large buffer if we're connecting righ away. Leaving it too large increases app memory usage.
4849
internal static int CircularBufferMB = 16;
4950

50-
// Exposed for tests
51-
internal TraceLogEventSource EventSource { get; }
52-
5351
public SampleProfilerTraceEventParser SampleEventParser => _sampleEventParser;
5452

5553
public TimeSpan Elapsed => _stopwatch.Elapsed;
5654

57-
public TraceLog TraceLog => EventSource.TraceLog;
55+
public TraceLog TraceLog => _eventSource.TraceLog;
5856

5957
// default is false, set 1 for true.
6058
private static int _throwOnNextStartupForTests = 0;
@@ -112,15 +110,15 @@ public async Task WaitForFirstEventAsync(CancellationToken cancellationToken = d
112110
{
113111
var tcs = new TaskCompletionSource();
114112
var cb = (TraceEvent _) => { tcs.TrySetResult(); };
115-
EventSource.AllEvents += cb;
113+
_eventSource.AllEvents += cb;
116114
try
117115
{
118116
// Wait for the first event to be processed.
119117
await tcs.Task.WaitAsync(cancellationToken).ConfigureAwait(false);
120118
}
121119
finally
122120
{
123-
EventSource.AllEvents -= cb;
121+
_eventSource.AllEvents -= cb;
124122
}
125123
}
126124

@@ -134,7 +132,7 @@ public void Stop()
134132
_session.Stop();
135133
_processing.Wait();
136134
_session.Dispose();
137-
EventSource.Dispose();
135+
_eventSource.Dispose();
138136
}
139137
catch (Exception ex)
140138
{

src/Sentry.Profiling/Sentry.Profiling.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<ItemGroup>
1616
<ProjectReference Include="..\..\src\Sentry\Sentry.csproj" />
17-
<PackageReference Include="Microsoft.Diagnostics.NETCore.Client" Version="0.2.553101" />
17+
<PackageReference Include="Microsoft.Diagnostics.NETCore.Client" Version="0.2.510501" />
1818
<!-- This triggers the build of this project and its dependencies. We don't need all of them but this is the easiest way -->
1919
<!-- to make sure the project builds/cleans etc in tandem with this. Packaging copies the 2 DLLs we need below -->
2020
<ProjectReference Include="../../modules/perfview/src/TraceEvent/TraceEvent.csproj" PrivateAssets="all" />

src/Sentry/IHasData.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Sentry;
2+
3+
/// <summary>
4+
/// Implemented by objects that contain a map of untyped additional metadata.
5+
/// </summary>
6+
public interface IHasData
7+
{
8+
/// <summary>
9+
/// An arbitrary mapping of additional metadata to store with the event.
10+
/// </summary>
11+
IReadOnlyDictionary<string, object?> Data { get; }
12+
13+
/// <summary>
14+
/// Sets an extra.
15+
/// </summary>
16+
void SetData(string key, object? value);
17+
}

src/Sentry/ISpanData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Sentry;
55
/// <summary>
66
/// Immutable data belonging to a span.
77
/// </summary>
8-
public interface ISpanData : ITraceContext, IHasTags, IHasExtra
8+
public interface ISpanData : ITraceContext, IHasData, IHasTags, IHasExtra
99
{
1010
/// <summary>
1111
/// Start timestamp.

src/Sentry/Internal/Enricher.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,15 @@ public void Apply(IEventLike eventLike)
4545
} catch {
4646
eventLike.Contexts.OperatingSystem.RawDescription = Environment.OSVersion.VersionString;
4747
}
48+
4849
#else
4950
eventLike.Contexts.OperatingSystem.RawDescription = RuntimeInformation.OSDescription;
51+
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
52+
{
53+
// works for catalyst and net9 base
54+
eventLike.Contexts.OperatingSystem.Name = "macOS";
55+
eventLike.Contexts.OperatingSystem.Version = Environment.OSVersion.Version.ToString(); // reports macOS version (ie. 15.3.0)
56+
}
5057
#endif
5158
}
5259
}

src/Sentry/Internal/NoOpSpan.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ protected NoOpSpan()
1919
public bool? IsSampled => default;
2020
public IReadOnlyDictionary<string, string> Tags => ImmutableDictionary<string, string>.Empty;
2121
public IReadOnlyDictionary<string, object?> Extra => ImmutableDictionary<string, object?>.Empty;
22+
public IReadOnlyDictionary<string, object?> Data => ImmutableDictionary<string, object?>.Empty;
2223
public DateTimeOffset StartTimestamp => default;
2324
public DateTimeOffset? EndTimestamp => default;
2425
public bool IsFinished => default;
@@ -71,6 +72,10 @@ public void SetExtra(string key, object? value)
7172
{
7273
}
7374

75+
public void SetData(string key, object? value)
76+
{
77+
}
78+
7479
public SentryTraceHeader GetTraceHeader() => SentryTraceHeader.Empty;
7580

7681
public IReadOnlyDictionary<string, Measurement> Measurements => ImmutableDictionary<string, Measurement>.Empty;

0 commit comments

Comments
 (0)