You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain scenarios, it is useful to completely suppress logging by setting the samplingRate to zero. However, the current code prevents this by taking the default value when samplingRate is set to zero, as shown in the following segment:
To address this, we need to modify the code to allow samplingRate to be set to zero without reverting to the default value. This change will provide greater flexibility in controlling logging behavior.
The text was updated successfully, but these errors were encountered:
@gunzip I agree that this should be possible. Looks like the current implementation contains an oversight regarding 0 being falsy. I'll update this and link the PR to this issue.
@gunzip Working on getting a fix in at the moment. I am curious though what scenario you rely on this 0 sampling rate for. Is this for testing scenarios? Or some other use case?
Yes, exactly. I'm doing some tests to compute AI overhead at different levels of sampling. Moreover it's useful when you have a setup for staging slots, ie. using some sticky setting.
Consider also that the current README states:
Setting samplingPercentage to 100 (the default) means all data will be sent, and 0 means nothing will be sent.
When in reality you currently obtain a defaut to 100% sampling, which of course increase costs.
In certain scenarios, it is useful to completely suppress logging by setting the
samplingRate
to zero. However, the current code prevents this by taking the default value whensamplingRate
is set to zero, as shown in the following segment:https://github.com/microsoft/ApplicationInsights-node.js/blob/main/src/shared/configuration/config.ts#L112
To address this, we need to modify the code to allow samplingRate to be set to zero without reverting to the default value. This change will provide greater flexibility in controlling logging behavior.
The text was updated successfully, but these errors were encountered: