Support DD_LOG_LEVEL#7159
Merged
Merged
Conversation
Note that DD_TRACE_DEBUG=true implies a log level of DEBUG, but DD_LOG_LEVEL=DEBUG does not imply DD_TRACE_DEBUG is enabled.
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 53 metrics, 18 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.36.0-SNAPSHOT~714d4849a7, baseline=1.36.0-SNAPSHOT~5ba28c1108
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.077 s) : 0, 1076957
Total [baseline] (10.452 s) : 0, 10452201
Agent [candidate] (1.059 s) : 0, 1059489
Total [candidate] (10.362 s) : 0, 10361729
section appsec
Agent [baseline] (1.181 s) : 0, 1181195
Total [baseline] (10.543 s) : 0, 10542667
Agent [candidate] (1.177 s) : 0, 1176739
Total [candidate] (10.541 s) : 0, 10540701
section iast
Agent [baseline] (1.178 s) : 0, 1177959
Total [baseline] (10.779 s) : 0, 10779016
Agent [candidate] (1.168 s) : 0, 1168339
Total [candidate] (10.748 s) : 0, 10747852
section profiling
Agent [baseline] (1.264 s) : 0, 1263983
Total [baseline] (10.714 s) : 0, 10714088
Agent [candidate] (1.259 s) : 0, 1258567
Total [candidate] (10.741 s) : 0, 10741312
gantt
title petclinic - break down per module: candidate=1.36.0-SNAPSHOT~714d4849a7, baseline=1.36.0-SNAPSHOT~5ba28c1108
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (674.099 ms) : 0, 674099
BytebuddyAgent [candidate] (663.592 ms) : 0, 663592
GlobalTracer [baseline] (308.047 ms) : 0, 308047
GlobalTracer [candidate] (303.137 ms) : 0, 303137
AppSec [baseline] (50.969 ms) : 0, 50969
AppSec [candidate] (49.913 ms) : 0, 49913
Logs Intake [baseline] (427.721 µs) : 0, 428
Logs Intake [candidate] (391.562 µs) : 0, 392
Remote Config [baseline] (672.148 µs) : 0, 672
Remote Config [candidate] (675.732 µs) : 0, 676
Telemetry [baseline] (7.753 ms) : 0, 7753
Telemetry [candidate] (7.537 ms) : 0, 7537
section appsec
BytebuddyAgent [baseline] (675.325 ms) : 0, 675325
BytebuddyAgent [candidate] (673.875 ms) : 0, 673875
GlobalTracer [baseline] (297.458 ms) : 0, 297458
GlobalTracer [candidate] (297.065 ms) : 0, 297065
AppSec [baseline] (152.928 ms) : 0, 152928
AppSec [candidate] (152.802 ms) : 0, 152802
Logs Intake [baseline] (332.164 µs) : 0, 332
Logs Intake [candidate] (332.515 µs) : 0, 333
Remote Config [baseline] (645.737 µs) : 0, 646
Remote Config [candidate] (618.161 µs) : 0, 618
Telemetry [baseline] (9.025 ms) : 0, 9025
Telemetry [candidate] (7.798 ms) : 0, 7798
IAST [baseline] (22.148 ms) : 0, 22148
IAST [candidate] (19.823 ms) : 0, 19823
section iast
BytebuddyAgent [baseline] (784.265 ms) : 0, 784265
BytebuddyAgent [candidate] (782.19 ms) : 0, 782190
GlobalTracer [baseline] (297.498 ms) : 0, 297498
GlobalTracer [candidate] (293.021 ms) : 0, 293021
AppSec [baseline] (47.717 ms) : 0, 47717
AppSec [candidate] (46.709 ms) : 0, 46709
Logs Intake [baseline] (303.102 µs) : 0, 303
Logs Intake [candidate] (300.265 µs) : 0, 300
Remote Config [baseline] (590.932 µs) : 0, 591
Remote Config [candidate] (577.34 µs) : 0, 577
Telemetry [baseline] (9.27 ms) : 0, 9270
Telemetry [candidate] (6.908 ms) : 0, 6908
IAST [baseline] (24.951 ms) : 0, 24951
IAST [candidate] (25.292 ms) : 0, 25292
section profiling
ProfilingAgent [baseline] (96.809 ms) : 0, 96809
ProfilingAgent [candidate] (95.684 ms) : 0, 95684
BytebuddyAgent [baseline] (662.009 ms) : 0, 662009
BytebuddyAgent [candidate] (661.636 ms) : 0, 661636
GlobalTracer [baseline] (388.67 ms) : 0, 388670
GlobalTracer [candidate] (385.839 ms) : 0, 385839
AppSec [baseline] (51.509 ms) : 0, 51509
AppSec [candidate] (50.466 ms) : 0, 50466
Logs Intake [baseline] (338.073 µs) : 0, 338
Logs Intake [candidate] (338.854 µs) : 0, 339
Remote Config [baseline] (749.348 µs) : 0, 749
Remote Config [candidate] (737.712 µs) : 0, 738
Telemetry [baseline] (7.387 ms) : 0, 7387
Telemetry [candidate] (7.359 ms) : 0, 7359
Profiling [baseline] (96.834 ms) : 0, 96834
Profiling [candidate] (95.708 ms) : 0, 95708
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.36.0-SNAPSHOT~714d4849a7, baseline=1.36.0-SNAPSHOT~5ba28c1108
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1068747
Total [baseline] (8.592 s) : 0, 8592172
Agent [candidate] (1.062 s) : 0, 1061744
Total [candidate] (8.563 s) : 0, 8562847
section iast
Agent [baseline] (1.167 s) : 0, 1166749
Total [baseline] (9.037 s) : 0, 9036844
Agent [candidate] (1.177 s) : 0, 1176767
Total [candidate] (9.074 s) : 0, 9074452
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.166 s) : 0, 1166215
Total [baseline] (8.962 s) : 0, 8962013
Agent [candidate] (1.169 s) : 0, 1168711
Total [candidate] (8.969 s) : 0, 8969111
section iast_TELEMETRY_OFF
Agent [baseline] (1.166 s) : 0, 1165697
Total [baseline] (9.046 s) : 0, 9046318
Agent [candidate] (1.181 s) : 0, 1181292
Total [candidate] (9.024 s) : 0, 9024064
gantt
title insecure-bank - break down per module: candidate=1.36.0-SNAPSHOT~714d4849a7, baseline=1.36.0-SNAPSHOT~5ba28c1108
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (669.438 ms) : 0, 669438
BytebuddyAgent [candidate] (664.35 ms) : 0, 664350
GlobalTracer [baseline] (305.564 ms) : 0, 305564
GlobalTracer [candidate] (303.971 ms) : 0, 303971
AppSec [baseline] (50.419 ms) : 0, 50419
AppSec [candidate] (50.316 ms) : 0, 50316
Logs Intake [baseline] (388.435 µs) : 0, 388
Logs Intake [candidate] (407.168 µs) : 0, 407
Remote Config [baseline] (676.965 µs) : 0, 677
Remote Config [candidate] (662.769 µs) : 0, 663
Telemetry [baseline] (7.609 ms) : 0, 7609
Telemetry [candidate] (7.601 ms) : 0, 7601
section iast
BytebuddyAgent [baseline] (776.994 ms) : 0, 776994
BytebuddyAgent [candidate] (784.955 ms) : 0, 784955
GlobalTracer [baseline] (292.999 ms) : 0, 292999
GlobalTracer [candidate] (295.65 ms) : 0, 295650
AppSec [baseline] (46.852 ms) : 0, 46852
AppSec [candidate] (47.067 ms) : 0, 47067
IAST [baseline] (27.29 ms) : 0, 27290
IAST [candidate] (26.283 ms) : 0, 26283
Logs Intake [baseline] (300.973 µs) : 0, 301
Logs Intake [candidate] (298.977 µs) : 0, 299
Remote Config [baseline] (569.731 µs) : 0, 570
Remote Config [candidate] (580.346 µs) : 0, 580
Telemetry [baseline] (8.497 ms) : 0, 8497
Telemetry [candidate] (8.552 ms) : 0, 8552
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (777.56 ms) : 0, 777560
BytebuddyAgent [candidate] (779.084 ms) : 0, 779084
GlobalTracer [baseline] (293.391 ms) : 0, 293391
GlobalTracer [candidate] (293.906 ms) : 0, 293906
AppSec [baseline] (46.522 ms) : 0, 46522
AppSec [candidate] (46.918 ms) : 0, 46918
IAST [baseline] (26.189 ms) : 0, 26189
IAST [candidate] (25.393 ms) : 0, 25393
Logs Intake [baseline] (300.026 µs) : 0, 300
Logs Intake [candidate] (301.249 µs) : 0, 301
Remote Config [baseline] (569.717 µs) : 0, 570
Remote Config [candidate] (577.197 µs) : 0, 577
Telemetry [baseline] (8.38 ms) : 0, 8380
Telemetry [candidate] (9.159 ms) : 0, 9159
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (776.365 ms) : 0, 776365
BytebuddyAgent [candidate] (787.369 ms) : 0, 787369
GlobalTracer [baseline] (293.831 ms) : 0, 293831
GlobalTracer [candidate] (297.339 ms) : 0, 297339
AppSec [baseline] (48.761 ms) : 0, 48761
AppSec [candidate] (50.178 ms) : 0, 50178
IAST [baseline] (24.173 ms) : 0, 24173
IAST [candidate] (23.68 ms) : 0, 23680
Logs Intake [baseline] (300.846 µs) : 0, 301
Logs Intake [candidate] (304.174 µs) : 0, 304
Remote Config [baseline] (558.326 µs) : 0, 558
Remote Config [candidate] (590.978 µs) : 0, 591
Telemetry [baseline] (8.414 ms) : 0, 8414
Telemetry [candidate] (8.294 ms) : 0, 8294
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~714d4849a7, baseline=1.36.0-SNAPSHOT~5ba28c1108
dateFormat X
axisFormat %s
section baseline
no_agent (369.985 µs) : 351, 389
. : milestone, 370,
iast (481.782 µs) : 460, 503
. : milestone, 482,
iast_FULL (554.873 µs) : 534, 576
. : milestone, 555,
iast_GLOBAL (515.18 µs) : 493, 537
. : milestone, 515,
iast_HARDCODED_SECRET_DISABLED (484.548 µs) : 463, 506
. : milestone, 485,
iast_INACTIVE (453.533 µs) : 432, 475
. : milestone, 454,
iast_TELEMETRY_OFF (476.26 µs) : 455, 498
. : milestone, 476,
tracing (441.635 µs) : 421, 462
. : milestone, 442,
section candidate
no_agent (369.436 µs) : 350, 389
. : milestone, 369,
iast (487.678 µs) : 467, 509
. : milestone, 488,
iast_FULL (550.876 µs) : 530, 572
. : milestone, 551,
iast_GLOBAL (507.571 µs) : 486, 529
. : milestone, 508,
iast_HARDCODED_SECRET_DISABLED (478.889 µs) : 458, 500
. : milestone, 479,
iast_INACTIVE (455.537 µs) : 434, 477
. : milestone, 456,
iast_TELEMETRY_OFF (476.182 µs) : 455, 498
. : milestone, 476,
tracing (440.758 µs) : 420, 461
. : milestone, 441,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~714d4849a7, baseline=1.36.0-SNAPSHOT~5ba28c1108
dateFormat X
axisFormat %s
section baseline
no_agent (1.341 ms) : 1321, 1361
. : milestone, 1341,
appsec (1.739 ms) : 1712, 1765
. : milestone, 1739,
appsec_no_iast (1.718 ms) : 1693, 1742
. : milestone, 1718,
iast (1.47 ms) : 1447, 1493
. : milestone, 1470,
profiling (1.555 ms) : 1529, 1581
. : milestone, 1555,
tracing (1.448 ms) : 1424, 1472
. : milestone, 1448,
section candidate
no_agent (1.355 ms) : 1334, 1375
. : milestone, 1355,
appsec (1.73 ms) : 1706, 1754
. : milestone, 1730,
appsec_no_iast (1.718 ms) : 1693, 1742
. : milestone, 1718,
iast (1.483 ms) : 1459, 1508
. : milestone, 1483,
profiling (1.487 ms) : 1463, 1510
. : milestone, 1487,
tracing (1.46 ms) : 1435, 1484
. : milestone, 1460,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~714d4849a7, baseline=1.36.0-SNAPSHOT~5ba28c1108
dateFormat X
axisFormat %s
section baseline
no_agent (1.472 ms) : 1460, 1483
. : milestone, 1472,
appsec (2.203 ms) : 2169, 2237
. : milestone, 2203,
iast (1.958 ms) : 1917, 1998
. : milestone, 1958,
iast_GLOBAL (2.009 ms) : 1969, 2050
. : milestone, 2009,
profiling (1.856 ms) : 1823, 1890
. : milestone, 1856,
tracing (1.839 ms) : 1807, 1871
. : milestone, 1839,
section candidate
no_agent (1.466 ms) : 1454, 1477
. : milestone, 1466,
appsec (2.209 ms) : 2174, 2244
. : milestone, 2209,
iast (1.974 ms) : 1933, 2015
. : milestone, 1974,
iast_GLOBAL (2.008 ms) : 1967, 2049
. : milestone, 2008,
profiling (1.869 ms) : 1835, 1902
. : milestone, 1869,
tracing (1.841 ms) : 1808, 1874
. : milestone, 1841,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~714d4849a7, baseline=1.36.0-SNAPSHOT~5ba28c1108
dateFormat X
axisFormat %s
section baseline
no_agent (15.328 s) : 15328000, 15328000
. : milestone, 15328000,
appsec (14.997 s) : 14997000, 14997000
. : milestone, 14997000,
iast (18.71 s) : 18710000, 18710000
. : milestone, 18710000,
iast_GLOBAL (17.61 s) : 17610000, 17610000
. : milestone, 17610000,
profiling (15.319 s) : 15319000, 15319000
. : milestone, 15319000,
tracing (15.15 s) : 15150000, 15150000
. : milestone, 15150000,
section candidate
no_agent (15.091 s) : 15091000, 15091000
. : milestone, 15091000,
appsec (15.057 s) : 15057000, 15057000
. : milestone, 15057000,
iast (18.807 s) : 18807000, 18807000
. : milestone, 18807000,
iast_GLOBAL (17.76 s) : 17760000, 17760000
. : milestone, 17760000,
profiling (15.518 s) : 15518000, 15518000
. : milestone, 15518000,
tracing (15.008 s) : 15008000, 15008000
. : milestone, 15008000,
|
amarziali
approved these changes
Jun 11, 2024
smola
approved these changes
Jun 11, 2024
Merged
mcculls
added a commit
that referenced
this pull request
Jun 12, 2024
Note that DD_TRACE_DEBUG=true implies a log level of DEBUG, but DD_LOG_LEVEL=DEBUG does not imply DD_TRACE_DEBUG is enabled.
wantsui
added a commit
to DataDog/dd-trace-py
that referenced
this pull request
Jan 27, 2026
#16174) ## Description <!-- Provide an overview of the change and motivation for the change --> Today, the ddtrace logger follows the root logger. If the root logger is in DEBUG mode, then ddtrace will also emit logs and the only way to override that is to set something like this: https://docs.datadoghq.com/tracing/troubleshooting/tracer_debug_logs/?tab=python#review-debug-logs ``` import logging # root logger configuration root_logger = logging.getLogger() root_logger.setLevel(logging.DEBUG) # override the ddtrace configuration to WARNING log level logging.getLogger("ddtrace").setLevel(logging.WARNING) ``` This change introduces a DD_TRACE_LOG_LEVEL setting that follows the logging levels in the logging module: https://docs.python.org/3/library/logging.html#levels . `DD_TRACE_DEBUG` will take precedence if set and set the tracer to debug. However, if DD_TRACE_LOG_LEVEL is used as a standalone, it can control the ddtrace logger setting. Example `DD_TRACE_LOG_LEVEL=CRITICAL` to only get critical logs instead of everything. In startup logs, I have the setting report as `log_level_override` to avoid confusion with the debug mode option someone may be trying to set: ``` - DATADOG TRACER CONFIGURATION - {... 'debug': True, ..... 'log_level_override': None} ``` Addresses APMS-18427 ## Testing <!-- Describe your testing strategy or note what tests are included --> Added tests that assert on the order of DD_TRACE_DEBUG and DD_TRACE_LOG_LEVEL . ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> There really isn't a true "NO LOGS" setting if we follow these [logging levels](https://docs.python.org/3/library/logging.html#levels), so if we accept this PR, we need to avoid setting any critical logs unless it's an exceptional use case. ## Additional Notes <!-- Any other information that would be helpful for reviewers --> There have been various changes to how debug mode can be set over the years. Some questions I think will be asked of the reviewers and here's my answer: 1. Do other tracers have this setting? Yes. Java has DD_LOG_LEVEL: DataDog/dd-trace-java#7159 Node.js has DD_TRACE_LOG_LEVEL: DataDog/dd-trace-js#727 2. If DD_TRACE_DEBUG=debug, how is it different than setting DD_TRACE_LOG_LEVEL=debug? Won't they have the same problems? All DD_TRACE_DEBUG does today is enables debug mode if the user sets it to TRUE: https://github.com/DataDog/dd-trace-py/blob/c173a8a084b0f7f2a8cd081dbf9611208faa48e0/ddtrace/_logger.py#L53-L54. Setting it to "FALSE" has no effect if the root logger has already been configured. **DD_TRACE_LOG_LEVEL** is different in the sense that it allows us to override the log level setting beyond accepting DEBUG mode or accepting whatever the root logger's level was. --------- Co-authored-by: Munir Abdinur <[email protected]> Co-authored-by: Quinna Halim <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Users can now configure the tracer's log level by setting
DD_LOG_LEVELin their environment:They can also use the
-Ddd.log.levelJVM optionMotivation
Make it easier to apply a tracer log level for all Java tracers running in the same environment.
Additional Notes
DD_TRACE_DEBUG=trueimplies a log level ofDEBUG, butDD_LOG_LEVEL=DEBUGdoes not implyDD_TRACE_DEBUGis enabled.Jira ticket: AIT-9801