diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5dfa58384b..37cff669b7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -10,17 +10,21 @@ body: options: - Sentry - Sentry.AspNetCore + - Sentry.AspNetCore.Blazor.WebAssembly - Sentry.AspNetCore.Grpc - Sentry.AspNet + - Sentry.Azure.Functions.Worker - Sentry.DiagnosticSource - Sentry.EntityFramework - Sentry.Extensions.Logging - Sentry.Google.Cloud.Functions - - Sentry.Log4net + - Sentry.Hangfire + - Sentry.Log4Net - Sentry.Maui - - Sentry.Nlog + - Sentry.NLog + - Sentry.OpenTelemetry + - Sentry.Profiling - Sentry.Serilog - - Sentry.Tunnel - Other validations: required: true diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 8f571c6ff0..9e451a282e 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -67,7 +67,7 @@ runs: distribution: ${{ runner.os == 'Windows' && runner.arch == 'ARM64' && 'microsoft' || 'temurin' }} java-version: '11' - - name: Install Mono + - name: Install Mono (macOS) if: runner.os == 'macOS' shell: bash # Attempt to install Mono, allowing it to fail silently @@ -76,12 +76,20 @@ runs: brew install mono || true brew link --overwrite mono + - name: Install Mono (Ubuntu) + if: ${{ runner.os == 'Linux' && !matrix.container }} + shell: bash + run: | + sudo apt install -y mono-devel + # restore perms for actions/setup-dotnet + sudo chmod -R a+rw /usr/share/dotnet + - name: Install .NET SDK uses: actions/setup-dotnet@v4 with: dotnet-version: | 8.0.x - 9.0.301 + 9.0.304 - name: Install .NET Workloads shell: bash diff --git a/.github/alpine/Dockerfile b/.github/alpine/Dockerfile index d2d4fd8520..6718812e71 100644 --- a/.github/alpine/Dockerfile +++ b/.github/alpine/Dockerfile @@ -5,7 +5,7 @@ FROM ${BASE} RUN apk update # common -RUN apk add bash build-base cmake curl git icu lsb-release-minimal nodejs npm sudo tar wget +RUN apk add bash build-base cmake curl git gpg icu lsb-release-minimal nodejs npm sudo tar wget # sentry-native RUN apk add curl-dev docker-cli libunwind-dev libunwind-static linux-headers openssl-dev zlib-dev xz-dev xz-static diff --git a/.github/alpine/setup-node.sh b/.github/alpine/setup-node.sh index bde0d9d300..f0e942f58a 100755 --- a/.github/alpine/setup-node.sh +++ b/.github/alpine/setup-node.sh @@ -1,12 +1,12 @@ #!/bin/sh -[ -n "$1" ] || { echo "Usage: $0 "; exit 1; } - # A workaround for "JavaScript Actions in Alpine containers are only supported on x64 Linux runners." # https://github.com/actions/runner/blob/8a9b96806d12343f7d123c669e29c629138023dd/src/Runner.Worker/Handlers/StepHost.cs#L283-L290 if [ "$(uname -m)" != "x86_64" ]; then - mkdir -p $1 - ln -s /usr/bin/node $1 - ln -s /usr/bin/npm $1 + for node in /__e/node*; do + mkdir -p $node/bin + ln -s /usr/bin/node $node/bin/node + ln -s /usr/bin/npm $node/bin/npm + done sed -i 's/ID=alpine/ID=unknown/' /usr/lib/os-release fi diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index b871bf31c6..207f8e2c1f 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -23,7 +23,7 @@ jobs: packages: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: docker/login-action@v3 with: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d438557fce..1bb59a1678 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed + - os: ubuntu-22.04 rid: linux-x64 - os: ubuntu-22.04-arm rid: linux-arm64 @@ -33,6 +33,7 @@ jobs: image: ghcr.io/getsentry/sentry-dotnet-alpine:3.21 volumes: - /tmp/node20:/__e/node20 + - /tmp/node24:/__e/node24 - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 rid: macos # universal (osx-arm64 + osx-x64) - os: windows-latest @@ -44,10 +45,10 @@ jobs: - name: Initialize Alpine Linux if: ${{ contains(matrix.container.image, 'alpine') }} run: | - curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin /__e/node20/bin/ + curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - run: git submodule update --init modules/sentry-native @@ -81,7 +82,7 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed + - os: ubuntu-22.04 rid: linux-x64 slnf: Sentry-CI-Build-Linux.slnf - os: ubuntu-22.04-arm @@ -101,6 +102,7 @@ jobs: image: ghcr.io/getsentry/sentry-dotnet-alpine:3.21 volumes: - /tmp/node20:/__e/node20 + - /tmp/node24:/__e/node24 - /var/run/docker.sock:/var/run/docker.sock - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 rid: macos # universal (osx-arm64 + osx-x64) @@ -116,14 +118,14 @@ jobs: - name: Initialize Alpine Linux if: ${{ contains(matrix.container.image, 'alpine') }} run: | - curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin /__e/node20/bin/ + curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin - name: Cancel Previous Runs if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # Tag: 0.12.1 - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive fetch-depth: 2 # default is 1 and codecov needs > 1 @@ -223,7 +225,9 @@ jobs: run: dotnet test ${{ matrix.slnf }} -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage" - name: Upload code coverage - uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload build and test outputs if: failure() @@ -247,7 +251,7 @@ jobs: - name: Sparse checkout if: env.CI_PUBLISHING_BUILD == 'true' - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: # We only check out what is absolutely necessary to reduce a chance of local files impacting # integration tests, e.g. Directory.Build.props, nuget.config, ... @@ -274,7 +278,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive @@ -327,7 +331,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive @@ -357,7 +361,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive fetch-depth: 2 # default is 1 and codecov needs > 1 @@ -396,7 +400,7 @@ jobs: if: ${{ !startsWith(github.ref_name, 'release/') }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5a73102373..225ac38054 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -27,7 +27,7 @@ jobs: uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # Tag: 0.12.1 - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive @@ -35,7 +35,7 @@ jobs: uses: ./.github/actions/environment - name: Initialize CodeQL - uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # pin@v2 + uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # pin@v2 with: languages: csharp @@ -49,6 +49,6 @@ jobs: run: dotnet build Sentry-CI-CodeQL.slnf --no-restore --nologo - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # pin@v2 + uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # pin@v2 with: category: '/language:csharp' diff --git a/.github/workflows/device-tests-android.yml b/.github/workflows/device-tests-android.yml index d58729dea9..b97936f3e2 100644 --- a/.github/workflows/device-tests-android.yml +++ b/.github/workflows/device-tests-android.yml @@ -26,7 +26,7 @@ jobs: uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # Tag: 0.12.1 - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive @@ -73,7 +73,7 @@ jobs: sudo udevadm trigger --name-match=kvm - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Download test app artifact uses: actions/download-artifact@v5 @@ -82,7 +82,7 @@ jobs: path: bin - name: Setup Gradle - uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # pin@v3 + uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # pin@v3 # Cached AVD setup per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md diff --git a/.github/workflows/device-tests-ios.yml b/.github/workflows/device-tests-ios.yml index 3474a210c5..c56226bdb6 100644 --- a/.github/workflows/device-tests-ios.yml +++ b/.github/workflows/device-tests-ios.yml @@ -23,7 +23,7 @@ jobs: uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # Tag: 0.12.1 - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index b0cf8ecf90..ede195cf6a 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -15,7 +15,7 @@ jobs: runs-on: macos-15 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31f6df0b26..6cc72a9ad8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,12 +20,12 @@ jobs: steps: - name: Get auth token id: token - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 with: app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} - name: Check out current commit (${{ github.sha }}) - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: token: ${{ steps.token.outputs.token }} fetch-depth: 0 diff --git a/.github/workflows/vulnerabilities.yml b/.github/workflows/vulnerabilities.yml index d7f1d994f5..8197efdd86 100644 --- a/.github/workflows/vulnerabilities.yml +++ b/.github/workflows/vulnerabilities.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive diff --git a/CHANGELOG.md b/CHANGELOG.md index 8afbbc57ff..141222b598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,59 @@ # Changelog +## 5.15.1 + +### Fixes + +- Fail when building Blazor WASM with Profiling. We don't support profiling in Blazor WebAssembly projects. ([#4512](https://github.com/getsentry/sentry-dotnet/pull/4512)) +- Do not overwrite user IP if it is set manually in ASP.NET sdk ([#4513](https://github.com/getsentry/sentry-dotnet/pull/4513)) +- Fix `SentryOptions.Native.SuppressSignalAborts` and `SuppressExcBadAccess` on iOS ([#4521](https://github.com/getsentry/sentry-dotnet/pull/4521)) + +### Dependencies + +- Bump Cocoa SDK from v8.55.1 to v8.56.0 ([#4528](https://github.com/getsentry/sentry-dotnet/pull/4528)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8560) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.55.1...8.56.0) +- Bump CLI from v2.53.0 to v2.54.0 ([#4541](https://github.com/getsentry/sentry-dotnet/pull/4541)) + - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2540) + - [diff](https://github.com/getsentry/sentry-cli/compare/2.53.0...2.54.0) +- Bump Native SDK from v0.10.1 to v0.11.0 ([#4542](https://github.com/getsentry/sentry-dotnet/pull/4542)) + - [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0110) + - [diff](https://github.com/getsentry/sentry-native/compare/0.10.1...0.11.0) + +## 5.15.0 + +### Features + +- Experimental _Structured Logs_: + - Redesign SDK Logger APIs to allow usage of `params` ([#4451](https://github.com/getsentry/sentry-dotnet/pull/4451)) + - Shorten the `key` names of `Microsoft.Extensions.Logging` attributes ([#4450](https://github.com/getsentry/sentry-dotnet/pull/4450)) + +### Fixes + +- Experimental _Structured Logs_: + - Remove `IDisposable` from `SentryStructuredLogger`. Disposal is intended through the owning `IHub` instance ([#4424](https://github.com/getsentry/sentry-dotnet/pull/4424)) + - Ensure all buffered logs are sent to Sentry when the application terminates unexpectedly ([#4425](https://github.com/getsentry/sentry-dotnet/pull/4425)) + - `InvalidOperationException` potentially thrown during a race condition, especially in concurrent high-volume logging scenarios ([#4428](https://github.com/getsentry/sentry-dotnet/pull/4428)) +- Blocking calls are no longer treated as unhandled crashes ([#4458](https://github.com/getsentry/sentry-dotnet/pull/4458)) +- Only apply Session Replay masks to specific control types when necessary to avoid performance issues in MAUI apps with complex UIs ([#4445](https://github.com/getsentry/sentry-dotnet/pull/4445)) +- De-duplicate Java.Lang.RuntimeException on Android ([#4509](https://github.com/getsentry/sentry-dotnet/pull/4509)) +- Upload linked PDB to fix symbolication for Mac Catalyst ([#4503](https://github.com/getsentry/sentry-dotnet/pull/4503)) + +### Dependencies + +- Bump sentry-cocoa from 8.39.0 to 8.55.1 ([#4442](https://github.com/getsentry/sentry-dotnet/pull/4442), [#4483](https://github.com/getsentry/sentry-dotnet/pull/4483), [#4485](https://github.com/getsentry/sentry-dotnet/pull/4485)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8551) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.39.0...8.55.1) +- Bump Native SDK from v0.9.1 to v0.10.1 ([#4436](https://github.com/getsentry/sentry-dotnet/pull/4436), [#4492](https://github.com/getsentry/sentry-dotnet/pull/4492)) + - [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0101) + - [diff](https://github.com/getsentry/sentry-native/compare/0.9.1...0.10.1) +- Bump CLI from v2.52.0 to v2.53.0 ([#4486](https://github.com/getsentry/sentry-dotnet/pull/4486)) + - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2530) + - [diff](https://github.com/getsentry/sentry-cli/compare/2.52.0...2.53.0) +- Bump Java SDK from v8.6.0 to v8.21.1 ([#4496](https://github.com/getsentry/sentry-dotnet/pull/4496), [#4502](https://github.com/getsentry/sentry-dotnet/pull/4502), [#4508](https://github.com/getsentry/sentry-dotnet/pull/4508)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8211) + - [diff](https://github.com/getsentry/sentry-java/compare/8.6.0...8.21.1) + ## 5.14.1 ### Fixes @@ -9,9 +63,9 @@ ### Dependencies -- Bump CLI from v2.50.2 to v2.51.1 ([#4419](https://github.com/getsentry/sentry-dotnet/pull/4419), [#4435](https://github.com/getsentry/sentry-dotnet/pull/4435)) - - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2511) - - [diff](https://github.com/getsentry/sentry-cli/compare/2.50.2...2.51.1) +- Bump CLI from v2.50.2 to v2.52.0 ([#4419](https://github.com/getsentry/sentry-dotnet/pull/4419), [#4435](https://github.com/getsentry/sentry-dotnet/pull/4435), [#4444](https://github.com/getsentry/sentry-dotnet/pull/4444)) + - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2520) + - [diff](https://github.com/getsentry/sentry-cli/compare/2.50.2...2.52.0) ## 5.14.0 @@ -161,7 +215,7 @@ ### Fixes - Revert "Bump Cocoa SDK from v8.39.0 to v8.46.0 (#4103)" ([#4202](https://github.com/getsentry/sentry-dotnet/pull/4202)) - - IMPORTANT: Fixes multiple issues running versions 5.6.x and 5.7.x of the Sentry SDK for .NET on iOS (initialising the SDK and sending data to Sentry) + - IMPORTANT: Fixes multiple issues running versions 5.6.x and 5.7.x of the Sentry SDK for .NET on iOS (initialising the SDK and sending data to Sentry) ### Dependencies diff --git a/Directory.Build.props b/Directory.Build.props index 73293414ee..a74738d5cd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 5.14.1 + 5.15.1 13 true true @@ -48,7 +48,7 @@ --> $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) - 12.2 + 13.0 15.0 21.0 10.0.17763.0 @@ -86,7 +86,7 @@ - 2.51.1 + 2.54.0 $(MSBuildThisFileDirectory)tools\sentry-cli\$(SentryCLIVersion)\ diff --git a/Directory.Build.targets b/Directory.Build.targets index 7593967e09..b01536755f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -10,7 +10,7 @@ --> $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) - 12.2 + 13.0 15.0 21.0 10.0.17763.0 diff --git a/README.md b/README.md index da7fb8c6e8..25d47bc58a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ _Bad software is everywhere, and we're tired of it. Sentry is on a mission to he Sentry SDK for .NET =========== -[![build](https://github.com/getsentry/sentry-dotnet/workflows/build/badge.svg?branch=main)](https://github.com/getsentry/sentry-dotnet/actions?query=branch%3Amain) +[![build](https://github.com/getsentry/sentry-dotnet/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dotnet/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/getsentry/sentry-dotnet/branch/main/graph/badge.svg)](https://codecov.io/gh/getsentry/sentry-dotnet) [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) @@ -25,6 +25,7 @@ Sentry SDK for .NET | **Sentry.Azure.Functions.Worker** | [![Downloads](https://img.shields.io/nuget/dt/Sentry.Azure.Functions.Worker.svg)](https://www.nuget.org/packages/Sentry.Azure.Functions.Worker) | [![NuGet](https://img.shields.io/nuget/v/Sentry.Azure.Functions.Worker.svg)](https://www.nuget.org/packages/Sentry.Azure.Functions.Worker) | [![NuGet](https://img.shields.io/nuget/vpre/Sentry.Azure.Functions.Worker.svg)](https://www.nuget.org/packages/Sentry.Azure.Functions.Worker) | [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dotnet/guides/azure-functions-worker/) | | **Sentry.DiagnosticSource** | [![Downloads](https://img.shields.io/nuget/dt/Sentry.DiagnosticSource.svg)](https://www.nuget.org/packages/Sentry.DiagnosticSource) | [![NuGet](https://img.shields.io/nuget/v/Sentry.DiagnosticSource.svg)](https://www.nuget.org/packages/Sentry.DiagnosticSource) | [![NuGet](https://img.shields.io/nuget/vpre/Sentry.DiagnosticSource.svg)](https://www.nuget.org/packages/Sentry.DiagnosticSource) | [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dotnet/performance/instrumentation/automatic-instrumentation/#diagnosticsource-integration) | | **Sentry.EntityFramework** | [![Downloads](https://img.shields.io/nuget/dt/Sentry.EntityFramework.svg)](https://www.nuget.org/packages/Sentry.EntityFramework) | [![NuGet](https://img.shields.io/nuget/v/Sentry.EntityFramework.svg)](https://www.nuget.org/packages/Sentry.EntityFramework) | [![NuGet](https://img.shields.io/nuget/vpre/Sentry.EntityFramework.svg)](https://www.nuget.org/packages/Sentry.EntityFramework) | [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dotnet/guides/entityframework) | +| **Sentry.Extensions.Logging** | [![Downloads](https://img.shields.io/nuget/dt/Sentry.Extensions.Logging.svg)](https://www.nuget.org/packages/Sentry.Extensions.Logging) | [![NuGet](https://img.shields.io/nuget/v/Sentry.Extensions.Logging.svg)](https://www.nuget.org/packages/Sentry.Extensions.Logging) | [![NuGet](https://img.shields.io/nuget/vpre/Sentry.Extensions.Logging.svg)](https://www.nuget.org/packages/Sentry.Extensions.Logging) | [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dotnet/guides/extensions-logging/) | | **Sentry.Google.Cloud.Functions** | [![Downloads](https://img.shields.io/nuget/dt/Sentry.Google.Cloud.Functions.svg)](https://www.nuget.org/packages/Sentry.Google.Cloud.Functions) | [![NuGet](https://img.shields.io/nuget/v/Sentry.Google.Cloud.Functions.svg)](https://www.nuget.org/packages/Sentry.Google.Cloud.Functions) | [![NuGet](https://img.shields.io/nuget/vpre/Sentry.Google.Cloud.Functions.svg)](https://www.nuget.org/packages/Sentry.Google.Cloud.Functions) | [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dotnet/guides/google-cloud-functions/) | | **Sentry.Hangfire** | [![Downloads](https://img.shields.io/nuget/dt/Sentry.Hangfire.svg)](https://www.nuget.org/packages/Sentry.Hangfire) | [![NuGet](https://img.shields.io/nuget/v/Sentry.Profiling.svg)](https://www.nuget.org/packages/Sentry.Hangfire) | [![NuGet](https://img.shields.io/nuget/vpre/Sentry.Hangfire.svg)](https://www.nuget.org/packages/Sentry.Hangfire) | [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dotnet/crons/hangfire/) | | **Sentry.Log4Net** | [![Downloads](https://img.shields.io/nuget/dt/Sentry.Log4Net.svg)](https://www.nuget.org/packages/Sentry.Log4Net) | [![NuGet](https://img.shields.io/nuget/v/Sentry.Log4Net.svg)](https://www.nuget.org/packages/Sentry.Log4Net) | [![NuGet](https://img.shields.io/nuget/vpre/Sentry.Log4Net.svg)](https://www.nuget.org/packages/Sentry.Log4Net) | [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dotnet/guides/log4net) | diff --git a/benchmarks/Sentry.Benchmarks/BenchmarkDotNet.Artifacts/results/Sentry.Benchmarks.StructuredLogBatchProcessorBenchmarks-report-github.md b/benchmarks/Sentry.Benchmarks/BenchmarkDotNet.Artifacts/results/Sentry.Benchmarks.StructuredLogBatchProcessorBenchmarks-report-github.md index befa791365..8461170b2c 100644 --- a/benchmarks/Sentry.Benchmarks/BenchmarkDotNet.Artifacts/results/Sentry.Benchmarks.StructuredLogBatchProcessorBenchmarks-report-github.md +++ b/benchmarks/Sentry.Benchmarks/BenchmarkDotNet.Artifacts/results/Sentry.Benchmarks.StructuredLogBatchProcessorBenchmarks-report-github.md @@ -1,6 +1,6 @@ ``` -BenchmarkDotNet v0.13.12, macOS 15.5 (24F74) [Darwin 24.5.0] +BenchmarkDotNet v0.13.12, macOS 15.6 (24G84) [Darwin 24.6.0] Apple M3 Pro, 1 CPU, 12 logical and 12 physical cores .NET SDK 9.0.301 [Host] : .NET 8.0.14 (8.0.1425.11118), Arm64 RyuJIT AdvSIMD @@ -8,11 +8,17 @@ Apple M3 Pro, 1 CPU, 12 logical and 12 physical cores ``` -| Method | BatchCount | OperationsPerInvoke | Mean | Error | StdDev | Gen0 | Allocated | -|---------------- |----------- |-------------------- |------------:|---------:|---------:|-------:|----------:| -| **EnqueueAndFlush** | **10** | **100** | **1,774.5 ns** | **7.57 ns** | **6.71 ns** | **0.6104** | **5 KB** | -| **EnqueueAndFlush** | **10** | **200** | **3,468.5 ns** | **11.16 ns** | **10.44 ns** | **1.2207** | **10 KB** | -| **EnqueueAndFlush** | **10** | **1000** | **17,259.7 ns** | **51.92 ns** | **46.02 ns** | **6.1035** | **50 KB** | -| **EnqueueAndFlush** | **100** | **100** | **857.5 ns** | **4.21 ns** | **3.73 ns** | **0.1469** | **1.2 KB** | -| **EnqueueAndFlush** | **100** | **200** | **1,681.4 ns** | **1.74 ns** | **1.63 ns** | **0.2937** | **2.41 KB** | -| **EnqueueAndFlush** | **100** | **1000** | **8,302.2 ns** | **12.00 ns** | **10.64 ns** | **1.4648** | **12.03 KB** | +| Method | BatchCount | OperationsPerInvoke | Mean | Error | StdDev | Gen0 | Allocated | +|------------------------- |----------- |-------------------- |-------------:|------------:|------------:|-------:|----------:| +| **EnqueueAndFlush** | **10** | **100** | **1,793.4 ns** | **13.75 ns** | **12.86 ns** | **0.6104** | **5 KB** | +| EnqueueAndFlush_Parallel | 10 | 100 | 18,550.8 ns | 368.24 ns | 889.34 ns | 1.1292 | 9.16 KB | +| **EnqueueAndFlush** | **10** | **200** | **3,679.8 ns** | **18.65 ns** | **16.53 ns** | **1.2207** | **10 KB** | +| EnqueueAndFlush_Parallel | 10 | 200 | 41,246.4 ns | 508.07 ns | 475.25 ns | 1.7090 | 14.04 KB | +| **EnqueueAndFlush** | **10** | **1000** | **17,239.1 ns** | **62.50 ns** | **58.46 ns** | **6.1035** | **50 KB** | +| EnqueueAndFlush_Parallel | 10 | 1000 | 192,059.3 ns | 956.92 ns | 895.11 ns | 4.3945 | 37.52 KB | +| **EnqueueAndFlush** | **100** | **100** | **866.7 ns** | **1.99 ns** | **1.77 ns** | **0.1469** | **1.2 KB** | +| EnqueueAndFlush_Parallel | 100 | 100 | 6,714.8 ns | 100.75 ns | 94.24 ns | 0.5569 | 4.52 KB | +| **EnqueueAndFlush** | **100** | **200** | **1,714.5 ns** | **3.20 ns** | **3.00 ns** | **0.2937** | **2.41 KB** | +| EnqueueAndFlush_Parallel | 100 | 200 | 43,842.8 ns | 860.74 ns | 1,718.99 ns | 0.9155 | 7.51 KB | +| **EnqueueAndFlush** | **100** | **1000** | **8,537.8 ns** | **9.80 ns** | **9.17 ns** | **1.4648** | **12.03 KB** | +| EnqueueAndFlush_Parallel | 100 | 1000 | 313,421.4 ns | 6,159.27 ns | 6,846.01 ns | 1.9531 | 18.37 KB | diff --git a/benchmarks/Sentry.Benchmarks/StructuredLogBatchProcessorBenchmarks.cs b/benchmarks/Sentry.Benchmarks/StructuredLogBatchProcessorBenchmarks.cs index 336d726926..9085068cce 100644 --- a/benchmarks/Sentry.Benchmarks/StructuredLogBatchProcessorBenchmarks.cs +++ b/benchmarks/Sentry.Benchmarks/StructuredLogBatchProcessorBenchmarks.cs @@ -1,5 +1,4 @@ using BenchmarkDotNet.Attributes; -using NSubstitute; using Sentry.Extensibility; using Sentry.Internal; @@ -30,22 +29,10 @@ public void Setup() }; var batchInterval = Timeout.InfiniteTimeSpan; - - var clientReportRecorder = Substitute.For(); - clientReportRecorder - .When(static recorder => recorder.RecordDiscardedEvent(Arg.Any(), Arg.Any(), Arg.Any())) - .Throw(); - - var diagnosticLogger = Substitute.For(); - diagnosticLogger - .When(static logger => logger.IsEnabled(Arg.Any())) - .Throw(); - diagnosticLogger - .When(static logger => logger.Log(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any())) - .Throw(); + var clientReportRecorder = new NullClientReportRecorder(); _hub = new Hub(options, DisabledHub.Instance); - _batchProcessor = new StructuredLogBatchProcessor(_hub, BatchCount, batchInterval, clientReportRecorder, diagnosticLogger); + _batchProcessor = new StructuredLogBatchProcessor(_hub, BatchCount, batchInterval, clientReportRecorder, null); _log = new SentryLog(DateTimeOffset.Now, SentryId.Empty, SentryLogLevel.Trace, "message"); } @@ -59,6 +46,16 @@ public void EnqueueAndFlush() _batchProcessor.Flush(); } + [Benchmark] + public void EnqueueAndFlush_Parallel() + { + _ = Parallel.For(0, OperationsPerInvoke, (int i) => + { + _batchProcessor.Enqueue(_log); + }); + _batchProcessor.Flush(); + } + [GlobalCleanup] public void Cleanup() { @@ -66,3 +63,21 @@ public void Cleanup() _hub.Dispose(); } } + +file sealed class NullClientReportRecorder : IClientReportRecorder +{ + public void RecordDiscardedEvent(DiscardReason reason, DataCategory category, int quantity = 1) + { + // no-op + } + + public ClientReport GenerateClientReport() + { + throw new UnreachableException(); + } + + public void Load(ClientReport report) + { + throw new UnreachableException(); + } +} diff --git a/global.json b/global.json index 54b78446d6..9cd89532c5 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "9.0.301", - "workloadVersion": "9.0.301", + "version": "9.0.304", + "workloadVersion": "9.0.304", "rollForward": "disable", "allowPrerelease": false } diff --git a/modules/sentry-cocoa.properties b/modules/sentry-cocoa.properties index 799f17ac06..d4dde9863e 100644 --- a/modules/sentry-cocoa.properties +++ b/modules/sentry-cocoa.properties @@ -1,2 +1,2 @@ -version = 8.39.0 +version = 8.56.0 repo = https://github.com/getsentry/sentry-cocoa diff --git a/modules/sentry-native b/modules/sentry-native index a64d5bd8ee..3bd091313a 160000 --- a/modules/sentry-native +++ b/modules/sentry-native @@ -1 +1 @@ -Subproject commit a64d5bd8ee130f2cda196b6fa7d9b65bfa6d32e2 +Subproject commit 3bd091313ae97be90be62696a2babe591a988eb8 diff --git a/samples/Sentry.Samples.Console.Basic/Program.cs b/samples/Sentry.Samples.Console.Basic/Program.cs index f1ae39b6ff..6b1815bf93 100644 --- a/samples/Sentry.Samples.Console.Basic/Program.cs +++ b/samples/Sentry.Samples.Console.Basic/Program.cs @@ -37,7 +37,7 @@ // This option tells Sentry to capture 100% of traces. You still need to start transactions and spans. options.TracesSampleRate = 1.0; - // This option enables Sentry Logs created via SentrySdk.Logger. + // This option enables Sentry Logs created via SentrySdk.Experimental.Logger. options.Experimental.EnableLogs = true; options.Experimental.SetBeforeSendLog(static log => { @@ -94,7 +94,8 @@ async Task SecondFunction() SentrySdk.CaptureException(exception); span.Finish(exception); - SentrySdk.Experimental.Logger.LogError("Error with message: {0}", [exception.Message], static log => log.SetAttribute("method", nameof(SecondFunction))); + SentrySdk.Experimental.Logger.LogError(static log => log.SetAttribute("method", nameof(SecondFunction)), + "Error with message: {0}", exception.Message); } span.Finish(); @@ -108,7 +109,8 @@ async Task ThirdFunction() // Simulate doing some work await Task.Delay(100); - SentrySdk.Experimental.Logger.LogFatal("Crash imminent!", [], static log => log.SetAttribute("suppress", true)); + SentrySdk.Experimental.Logger.LogFatal(static log => log.SetAttribute("suppress", true), + "Crash imminent!"); // This is an example of an unhandled exception. It will be captured automatically. throw new InvalidOperationException("Something happened that crashed the app!"); diff --git a/samples/Sentry.Samples.Maui/MauiProgram.cs b/samples/Sentry.Samples.Maui/MauiProgram.cs index 909851b7d4..1a8a6a30a7 100644 --- a/samples/Sentry.Samples.Maui/MauiProgram.cs +++ b/samples/Sentry.Samples.Maui/MauiProgram.cs @@ -45,15 +45,18 @@ public static MauiApp CreateMauiApp() options.AddCommunityToolkitIntegration(); #if __ANDROID__ - // Currently experimental support is only available on Android + // Currently, experimental support is only available on Android options.Native.ExperimentalOptions.SessionReplay.OnErrorSampleRate = 1.0; options.Native.ExperimentalOptions.SessionReplay.SessionSampleRate = 1.0; // Mask all images and text by default. This can be overridden for individual view elements via the // sentry:SessionReplay.Mask XML attribute (see MainPage.xaml for an example) options.Native.ExperimentalOptions.SessionReplay.MaskAllImages = true; options.Native.ExperimentalOptions.SessionReplay.MaskAllText = true; - // Alternatively the masking behaviour for entire classes of VisualElements can be configured here as + // Alternatively, the masking behaviour for entire classes of VisualElements can be configured here as // an exception to the default behaviour. + // WARNING: In apps with complex user interfaces, consisting of hundreds of visual controls on a single + // page, this option may cause performance issues. In such cases, consider applying the + // sentry:SessionReplay.Mask="Unmask" attribute to individual controls instead. options.Native.ExperimentalOptions.SessionReplay.UnmaskControlsOfType