Skip to content

Commit 079e478

Browse files
authored
fix(profiling): reduce lock profiler log spam (#11377)
The lock profiler would log a warning if it couldn't determine a name for a lock, and it would try determining a name multiple times for the same lock. This lead to excessive log spam. Downgrade this to a debug log and only try to determine the name once.
1 parent b18a73c commit 079e478

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ddtrace/profiling/collector/_lock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def _find_self_name(self, var_dict: typing.Dict):
269269

270270
# Get lock acquire/release call location and variable name the lock is assigned to
271271
def _maybe_update_self_name(self):
272-
if self._self_name:
272+
if self._self_name is not None:
273273
return
274274
try:
275275
# We expect the call stack to be like this:
@@ -298,7 +298,7 @@ def _maybe_update_self_name(self):
298298

299299
if not self._self_name:
300300
self._self_name = ""
301-
LOG.warning(
301+
LOG.debug(
302302
"Failed to get lock variable name, we only support local/global variables and their attributes."
303303
)
304304

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
profiling: The lock profiler would log a warning if it couldn't determine a
5+
name for a lock, and it would try determining a name multiple times for
6+
the same lock. This lead to excessive log spam. Downgrade this to a
7+
debug log and only try to determine the name once.

0 commit comments

Comments
 (0)