Skip to content

Remove SentryOptions.EnableMetrics #5675

Description

@ric-oliv

SentryOptions.EnableMetrics has had no effect since 6.10.0. getsentry/sentry-dotnet#5509 marked it [Obsolete] with a message saying it "will be removed in version 7.0.0". The getter always returns true and the setter ignores the value. The property is still on version7.

Code that sets EnableMetrics = false compiles today with only an obsolete warning, and the SDK still sends metrics. Removing the property turns that into a build error, so users find out and move to SetBeforeSendMetric. getsentry/sentry-javascript#23309, getsentry/sentry-cocoa#8873 and getsentry/sentry-python#5048 track the same option in the JavaScript, Cocoa and Python SDKs. JavaScript has removed it. Cocoa and Python have deprecated it and will remove it in their next major. SDK-1533 lists the .NET removal as pending.

#5642 removes SentryOptions.EnableLogs, so this issue covers EnableMetrics only.

Scope

These places on version7 still have the property:

  • src/Sentry/SentryOptions.cs has the property and the ObsoleteEnableMetrics message.
  • src/Sentry/BindableSentryOptions.cs has the bindable property and its line in ApplyTo.
  • test/Sentry.Tests/SentryMetricEmitterTests.Options.cs has EnableMetrics_IsObsoleteAndAlwaysEnabled.
  • The Sentry API approval snapshots list the property for every target framework.

The EnableMetrics in src/Sentry.Bindings.Cocoa/ApiDefinition.cs belongs to the native Cocoa SDK. That file is generated, and this issue doesn't touch it.

Acceptance criteria

  • SentryOptions.EnableMetrics and BindableSentryOptions.EnableMetrics no longer exist.
  • An app with a leftover "EnableMetrics" key in its Sentry configuration section still starts. Checked before merging; no permanent test, since the property no longer exists.
  • The PR title starts with feat!:, so the changelog lists the removal under breaking changes. The PR description tells users to delete the setting and to drop metrics by returning null from SetBeforeSendMetric.
  • The .NET metrics options page in sentry-docs no longer documents EnableMetrics once 7.0 ships. The page is platform-includes/metrics/options/dotnet.mdx. It already says the option is ignored since 6.10.0 and will be removed in 7.0.0, which is right for 6.x users, so the change waits for the 7.0 docs. A docs PR fixes this, or a follow-up issue tracks it.

Activity

  1. self-assigned this
    on Oct 6, 2026
  2. linear-code commented on Oct 6, 2026

    @linear-code
  3. added
    .NETPull requests that update .net code
    Breaking ChangeBinary/Source/Behavioral Breaking Changes.
    Next MajorChanges scheduled for the next Major release.
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

.NETPull requests that update .net codeBreaking ChangeBinary/Source/Behavioral Breaking Changes.Next MajorChanges scheduled for the next Major release.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions