|
40 | 40 | CAPTURE_TRACE_TAG = "_dd.debug.error.trace_captured" |
41 | 41 |
|
42 | 42 | # unique exception id |
43 | | -EXCEPTION_ID_TAG = "_dd.debug.error.exception_id" |
| 43 | +EXCEPTION_HASH_TAG = "_dd.debug.error.exception_hash" |
| 44 | +EXCEPTION_ID_TAG = "_dd.debug.error.exception_capture_id" |
44 | 45 |
|
45 | 46 | # link to matching snapshot for every frame in the traceback |
46 | 47 | FRAME_SNAPSHOT_ID_TAG = "_dd.debug.error.%d.snapshot_id" |
@@ -80,9 +81,8 @@ def exception_chain_ident(chain: ExceptionChain) -> int: |
80 | 81 | return h |
81 | 82 |
|
82 | 83 |
|
83 | | -def limit_exception(chain: ExceptionChain) -> bool: |
| 84 | +def limit_exception(exc_ident: int) -> bool: |
84 | 85 | try: |
85 | | - exc_ident = exception_chain_ident(chain) |
86 | 86 | hg = EXCEPTION_IDENT_LIMITER.get(exc_ident) |
87 | 87 | if hg is None: |
88 | 88 | # We haven't seen this exception yet, or it's been evicted |
@@ -218,7 +218,8 @@ def on_span_exception( |
218 | 218 | # No exceptions to capture |
219 | 219 | return |
220 | 220 |
|
221 | | - if limit_exception(chain): |
| 221 | + exc_ident = exception_chain_ident(chain) |
| 222 | + if limit_exception(exc_ident): |
222 | 223 | # We have seen this exception recently |
223 | 224 | return |
224 | 225 |
|
@@ -272,6 +273,7 @@ def on_span_exception( |
272 | 273 | _tb = _tb.tb_next |
273 | 274 |
|
274 | 275 | span.set_tag_str(DEBUG_INFO_TAG, "true") |
| 276 | + span.set_tag_str(EXCEPTION_HASH_TAG, str(exc_ident)) |
275 | 277 | span.set_tag_str(EXCEPTION_ID_TAG, str(exc_id)) |
276 | 278 |
|
277 | 279 | @classmethod |
|
0 commit comments