File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -389,20 +389,20 @@ def _generate_sfn_parent_id(context: dict) -> int:
389
389
upstream Step Function execution context is used to infer the parent's span ID, ensuring trace
390
390
continuity.
391
391
392
- `RetryCount` and `RedriveCount` are appended only when nonzero to maintain compatibility with
393
- older Lambda layers that did not include these fields
392
+ `RetryCount` and `RedriveCount` are appended only when both are nonzero to maintain
393
+ compatibility with older Lambda layers that did not include these fields.
394
394
"""
395
395
execution_id = context .get ("Execution" ).get ("Id" )
396
- retry_count = context .get ("Execution" ).get ("RetryCount" , 0 )
397
396
redrive_count = context .get ("Execution" ).get ("RedriveCount" , 0 )
398
397
state_name = context .get ("State" ).get ("Name" )
399
398
state_entered_time = context .get ("State" ).get ("EnteredTime" )
399
+ retry_count = context .get ("State" ).get ("RetryCount" , 0 )
400
400
401
- retry_postfix = "" if retry_count == 0 else f"# { retry_count } "
402
- redrive_postfix = " " if redrive_count == 0 else f"# { redrive_count } "
401
+ include_counts = not ( retry_count == 0 and redrive_count == 0 )
402
+ counts_suffix = f"# { retry_count } # { redrive_count } " if include_counts else " "
403
403
404
404
return _deterministic_sha256_hash (
405
- f"{ execution_id } #{ state_name } #{ state_entered_time } { retry_postfix } { redrive_postfix } " ,
405
+ f"{ execution_id } #{ state_name } #{ state_entered_time } { counts_suffix } " ,
406
406
HIGHER_64_BITS ,
407
407
)
408
408
You can’t perform that action at this time.
0 commit comments