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.
SentryOptions.EnableMetricshas 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 returnstrueand the setter ignores the value. The property is still onversion7.Code that sets
EnableMetrics = falsecompiles 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 toSetBeforeSendMetric. 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 coversEnableMetricsonly.Scope
These places on
version7still 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.SentryAPI approval snapshots list the property for every target framework.The
EnableMetricsinsrc/Sentry.Bindings.Cocoa/ApiDefinition.csbelongs to the native Cocoa SDK. That file is generated, and this issue doesn't touch it.Acceptance criteria
SentryOptions.EnableMetricsandBindableSentryOptions.EnableMetricsno longer exist."EnableMetrics"key in itsSentryconfiguration section still starts. Checked before merging; no permanent test, since the property no longer exists.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.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.