getsentry / sentry-docs

Sentry's documentation (and tools to build it)
https://docs.sentry.io
Other
332 stars 1.46k forks source link

DotNet SDK docs incorrect re EnableTracing overrides #9619

Open ericsampson opened 7 months ago

ericsampson commented 7 months ago

Core or SDK?

Platform/SDK

Which part? Which one?

dotnet

Description

EnableTracing A boolean value, if true, transactions and trace data will be generated and captured. This will set the traces-sample-rate to the recommended default of 1.0 if traces-sample-rate is not defined. Note that traces-sample-rate and traces-sampler take precedence over this option.

The last sentence of this paragraph is incorrect from a technical standpoint.

In the current SDK code, it is clear that EnableTracing takes precedence over traces-sample-rate and traces-sampler; which is both what I'd expect, and the opposite of what the docs currently say:

    /// <summary>
    /// Indicates whether the performance feature is enabled, via any combination of
    /// <see cref="EnableTracing"/>, <see cref="TracesSampleRate"/>, or <see cref="TracesSampler"/>.
    /// </summary>
    internal bool IsPerformanceMonitoringEnabled => EnableTracing switch
    {
        false => false,
        null => TracesSampler is not null || TracesSampleRate is > 0.0,
        true => TracesSampler is not null || TracesSampleRate is > 0.0 or null
    };

Suggested Solution

Reword to match the code implementation.

getsantry[bot] commented 7 months ago

Assigning to @getsentry/support for routing ⏲️