Commit a6e1ac3
Konstantin Khlopkov
fix(span_processor): guard span_formatter debug call behind isEnabledFor check
The method evaluates inside an f-string
passed to , which causes full span serialization
on every span end, regardless of the effective log level. This is a
measurable per-span CPU cost.
Because Python f-strings are evaluated before being handed to the
logger, the formatting runs unconditionally even when DEBUG logging is
disabled.
Guard the debug call with
so the expensive only runs when DEBUG level is
actually enabled.
Resolves: langfuse/langfuse#153391 parent 4c5b5e6 commit a6e1ac3
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
221 | | - | |
222 | | - | |
223 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| |||
0 commit comments