Skip to content
Merged
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## Features

- The _Metrics_ APIs are now stable: removed `Experimental` from `SentrySdk` and `SentryOptions` ([#2615](https://github.com/getsentry/sentry-unity/pull/2615))

### Dependencies

- Bump Cocoa SDK from v9.7.0 to v9.8.0 ([#2596](https://github.com/getsentry/sentry-unity/pull/2596))
Expand All @@ -16,6 +20,9 @@
- Bump CLI from v3.3.3 to v3.3.5 ([#2604](https://github.com/getsentry/sentry-unity/pull/2604), [#2614](https://github.com/getsentry/sentry-unity/pull/2614))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#335)
- [diff](https://github.com/getsentry/sentry-cli/compare/3.3.3...3.3.5)
- Bump .NET SDK from v6.2.0 to v6.3.0 ([#2615](https://github.com/getsentry/sentry-unity/pull/2615))
- [changelog](https://github.com/getsentry/sentry-dotnet/blob/main/CHANGELOG.md#630)
- [diff](https://github.com/getsentry/sentry-dotnet/compare/6.2.0...6.3.0)

## 4.1.2

Expand Down
4 changes: 4 additions & 0 deletions src/Sentry.Unity.Android/AndroidJavaScopeObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ public override void UnsetUserImpl() =>

public override void SetTraceImpl(SentryId traceId, SpanId spanId) =>
_sentryJava.SetTrace(traceId, spanId);

public override void AddAttachmentImpl(SentryAttachment attachment) { }

public override void ClearAttachmentsImpl() { }
}
4 changes: 4 additions & 0 deletions src/Sentry.Unity.Native/NativeScopeObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public override void SetUserImpl(SentryUser user)
public override void SetTraceImpl(SentryId traceId, SpanId spanId) =>
C.sentry_set_trace(traceId.ToString(), spanId.ToString());

public override void AddAttachmentImpl(SentryAttachment attachment) { }

public override void ClearAttachmentsImpl() { }

private static string GetTimestamp(DateTimeOffset timestamp) =>
// "o": Using ISO 8601 to make sure the timestamp makes it to the bridge correctly.
// https://docs.microsoft.com/en-gb/dotnet/standard/base-types/standard-date-and-time-format-strings#Roundtrip
Expand Down
4 changes: 4 additions & 0 deletions src/Sentry.Unity.iOS/NativeScopeObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ internal static string GetTimestamp(DateTimeOffset timestamp) =>
// https://docs.microsoft.com/en-gb/dotnet/standard/base-types/standard-date-and-time-format-strings#Roundtrip
timestamp.ToString("o");

public override void AddAttachmentImpl(SentryAttachment attachment) { }

public override void ClearAttachmentsImpl() { }

internal static int GetBreadcrumbLevel(BreadcrumbLevel breadcrumbLevel) =>
// https://github.com/getsentry/sentry-cocoa/blob/50f955aeb214601dd62b5dae7abdaddc8a1f24d9/Sources/Sentry/Public/SentryDefines.h#L99-L105
breadcrumbLevel switch
Expand Down
16 changes: 16 additions & 0 deletions src/Sentry.Unity/ScopeObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,20 @@ public void SetTrace(SentryId traceId, SpanId spanId)
}

public abstract void SetTraceImpl(SentryId traceId, SpanId spanId);

public void AddAttachment(SentryAttachment attachment)
{
_options.LogDebug("{0} Scope Sync - Adding attachment", _name);
AddAttachmentImpl(attachment);
}

public abstract void AddAttachmentImpl(SentryAttachment attachment);

public void ClearAttachments()
{
_options.LogDebug("{0} Scope Sync - Clearing attachments", _name);
ClearAttachmentsImpl();
}

public abstract void ClearAttachmentsImpl();
}
2 changes: 1 addition & 1 deletion src/Sentry.Unity/ScriptableSentryUnityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ internal SentryUnityOptions ToSentryUnityOptions(
AddBreadcrumbsWithStructuredLogs = AddBreadcrumbsWithStructuredLogs
};

options.Experimental.EnableMetrics = EnableMetrics;
options.EnableMetrics = EnableMetrics;

// By default, the cacheDirectoryPath gets set on known platforms. We're overwriting this behaviour here.
if (!EnableOfflineCaching)
Expand Down
32 changes: 5 additions & 27 deletions src/Sentry.Unity/SentrySdk.Dotnet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ public static partial class SentrySdk
/// </summary>
/// <remarks>
/// Use this property to access structured logging functionality. Logs are only sent when
/// <see cref="SentryUnityOptions.Experimental"/>'s <see cref="SentryOptions.SentryExperimentalOptions.EnableLogs"/>
/// is set to true.
/// <see cref="SentryOptions.EnableLogs"/> is set to true.
/// </remarks>
/// <seealso href="https://develop.sentry.dev/sdk/telemetry/logs/"/>
public static SentryStructuredLogger Logger { [DebuggerStepThrough] get => Sentry.SentrySdk.Logger; }
Expand Down Expand Up @@ -548,32 +547,11 @@ public static void ResumeSession()
public static void CauseCrash(CrashType crashType) => Sentry.SentrySdk.CauseCrash(crashType);

/// <summary>
/// Sentry features that are currently in an experimental state.
/// Gets the metric emitter for emitting counters, gauges, and distributions connected to traces.
/// </summary>
/// <remarks>
/// Experimental features are subject to binary, source and behavioral breaking changes in future updates.
/// </remarks>
public static ExperimentalSentrySdk Experimental { get; } = new();

/// <summary>
/// Sentry features that are currently in an experimental state.
/// </summary>
/// <remarks>
/// Experimental features are subject to binary, source and behavioral breaking changes in future updates.
/// </remarks>
public sealed class ExperimentalSentrySdk
public static SentryMetricEmitter Metrics
{
internal ExperimentalSentrySdk()
{
}

/// <summary>
/// Gets the metric emitter for emitting counters, gauges, and distributions connected to traces.
/// </summary>
public SentryMetricEmitter Metrics
{
[DebuggerStepThrough]
get => Sentry.SentrySdk.Experimental.Metrics;
}
[DebuggerStepThrough]
get => Sentry.SentrySdk.Metrics;
}
}
2 changes: 1 addition & 1 deletion src/sentry-dotnet
Submodule sentry-dotnet updated 105 files
Loading