-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tracing): only apply rate limits when trace sample rules are set [except for ASM Standalone] [backport 2.14] #10941
Conversation
…[except for ASM Standalone] (#10764) Aligns the implementation of DD_TRACE_RATE_LIMIT with the java, dotnet and nodejs tracers: https://docs.datadoghq.com/tracing/trace_collection/library_config/java/#configuration-options. Linked to: https://github.com/DataDog/dd-trace-py/pull/10830/files. ## Changes - When tracing is enabled only apply DD_TRACE_RATE_LIMIT if a trace sampling rules or a trace sample rate is set. Otherwise trace rate limiting should be handled by the Datadog Agent. - [backwards compatibility] When ASM is enabled in standalone mode, rate limiting of 1 trace per second should be applied to ALL spans. All rate limited spans should have priority category of USER. - When spans are rate limited set `_dd.limit_psr` to the effective rate limit. Previously this tag was only set is DD_TRACE_RATE_LIMIT != 100. This restriction is not found in the spec. ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Zachary Groves <32471391+ZStriker19@users.noreply.github.com> Co-authored-by: erikayasuda <153395705+erikayasuda@users.noreply.github.com> (cherry picked from commit afb6f2f)
Datadog ReportBranch report: ✅ 0 Failed, 1286 Passed, 0 Skipped, 35m 35.72s Total duration (43.93s time saved) |
BenchmarksBenchmark execution time: 2024-10-04 00:06:37 Comparing candidate commit f976379 in PR branch Found 3 performance improvements and 0 performance regressions! Performance is the same for 353 metrics, 48 unstable metrics. scenario:span-start-finish
scenario:span-start-finish-telemetry
scenario:span-start-finish-traceid128
|
|
Backport afb6f2f from #10764 to 2.14.
Aligns the implementation of DD_TRACE_RATE_LIMIT with the java, dotnet and nodejs tracers: https://docs.datadoghq.com/tracing/trace_collection/library_config/java/#configuration-options.
Linked to: https://github.com/DataDog/dd-trace-py/pull/10830/files.
Changes
_dd.limit_psr
to the effective rate limit. Previously this tag was only set is DD_TRACE_RATE_LIMIT != 100. This restriction is not found in the spec.Checklist
Reviewer Checklist