Repository navigation
Description
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.cshas the property and theObsoleteEnableMetricsmessage.src/Sentry/BindableSentryOptions.cshas the bindable property and its line inApplyTo.test/Sentry.Tests/SentryMetricEmitterTests.Options.cshasEnableMetrics_IsObsoleteAndAlwaysEnabled.- The
SentryAPI 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.EnableMetricsandBindableSentryOptions.EnableMetricsno longer exist.- An app with a leftover
"EnableMetrics"key in itsSentryconfiguration 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 returningnullfromSetBeforeSendMetric. - The .NET metrics options page in sentry-docs no longer documents
EnableMetricsonce 7.0 ships. The page isplatform-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
linear-code commentedon Oct 6, 2026
NET-840
test: drop the test for a leftover EnableMetrics configuration key
feat!: remove SentryOptions.EnableMetrics (#5690)