Skip to content

Commit 6abb3f3

Browse files
committed
update test data
1 parent 3bfc1e7 commit 6abb3f3

File tree

2 files changed

+27
-30
lines changed

2 files changed

+27
-30
lines changed

datadog_lambda/tracing.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ def _deterministic_sha256_hash(s: str, part: str) -> int:
372372

373373
def _parse_high_64_bits(trace_tags: str) -> str:
374374
"""
375-
Parse a list of trace tags such as [_dd.p.tid=66bcb5eb00000000,_dd.p.dm=-0] and return the value of the _dd.p.tid
376-
tag or an empty string if not found.
375+
Parse a list of trace tags such as [_dd.p.tid=66bcb5eb00000000,_dd.p.dm=-0] and return the
376+
value of the _dd.p.tid tag or an empty string if not found.
377377
"""
378378
if trace_tags:
379379
for tag in trace_tags.split(","):
@@ -395,11 +395,11 @@ def _generate_sfn_parent_id(context: dict) -> int:
395395

396396
def _generate_sfn_trace_id(execution_id: str, part: str):
397397
"""
398-
Take the SHA-256 hash of the execution_id to calculate the trace ID. If the high 64 bits are specified, we take
399-
those bits and use hex to encode it. We also remove the first two characters as they will be '0x in the hex string.
398+
Take the SHA-256 hash of the execution_id to calculate the trace ID. If the high 64 bits are
399+
specified, we take those bits and use hex to encode it. We also remove the first two characters
400+
as they will be '0x in the hex string.
400401
401402
We care about full 128 bits because they will break up into traditional traceID and _dd.p.tid tag.
402-
https://github.com/DataDog/dd-trace-py/blob/3e34d21cb9b5e1916e549047158cb119317b96ab/ddtrace/propagation/http.py#L232-L240
403403
"""
404404
if part == HIGHER_64_BITS:
405405
return hex(_deterministic_sha256_hash(execution_id, part))[2:]
@@ -416,7 +416,8 @@ def extract_context_from_step_functions(event, lambda_context):
416416
2. Root is a SFN, and we use its executionARN to calculate the traceID
417417
We calculate the parentID the same in both cases by using the parent SFN's context object.
418418
419-
Otherwise, we're dealing with the legacy case where we only have the parent SFN's context object.
419+
Otherwise, we're dealing with the legacy case where we only have the parent SFN's context
420+
object.
420421
"""
421422
try:
422423
meta = {}
Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
{
2-
"Records": [
3-
{
4-
"_datadog": {
5-
"Execution": {
6-
"Id": "arn:aws:states:ca-central-1:425362996713:execution:MyStateMachine-wsx8chv4d:1356a963-42a5-48b0-ba3f-73bde559a50c",
7-
"StartTime": "2024-11-13T16:46:47.715Z",
8-
"Name": "1356a963-42a5-48b0-ba3f-73bde559a50c",
9-
"RoleArn": "arn:aws:iam::425362996713:role/service-role/StepFunctions-MyStateMachine-wsx8chv4d-role-1su0fkfd3",
10-
"RedriveCount": 0
11-
},
12-
"StateMachine": {
13-
"Id": "arn:aws:states:ca-central-1:425362996713:stateMachine:MyStateMachine-wsx8chv4d",
14-
"Name": "MyStateMachine-wsx8chv4d"
15-
},
16-
"State": {
17-
"Name": "Lambda Invoke",
18-
"EnteredTime": "2024-11-13T16:46:47.740Z",
19-
"RetryCount": 0
20-
},
21-
"RootExecutionId": "arn:aws:states:ca-central-1:425362996713:execution:MyStateMachine-wsx8chv4d:1356a963-42a5-48b0-ba3f-73bde559a50c",
22-
"serverless-version": "v2"
23-
}
24-
}
25-
]
2+
"_datadog": {
3+
"Execution": {
4+
"Id": "arn:aws:states:ca-central-1:425362996713:execution:MyStateMachine-wsx8chv4d:1356a963-42a5-48b0-ba3f-73bde559a50c",
5+
"StartTime": "2024-11-13T16:46:47.715Z",
6+
"Name": "1356a963-42a5-48b0-ba3f-73bde559a50c",
7+
"RoleArn": "arn:aws:iam::425362996713:role/service-role/StepFunctions-MyStateMachine-wsx8chv4d-role-1su0fkfd3",
8+
"RedriveCount": 0
9+
},
10+
"StateMachine": {
11+
"Id": "arn:aws:states:ca-central-1:425362996713:stateMachine:MyStateMachine-wsx8chv4d",
12+
"Name": "MyStateMachine-wsx8chv4d"
13+
},
14+
"State": {
15+
"Name": "Lambda Invoke",
16+
"EnteredTime": "2024-11-13T16:46:47.740Z",
17+
"RetryCount": 0
18+
},
19+
"RootExecutionId": "arn:aws:states:ca-central-1:425362996713:execution:MyStateMachine-wsx8chv4d:1356a963-42a5-48b0-ba3f-73bde559a50c",
20+
"serverless-version": "v2"
21+
}
2622
}

0 commit comments

Comments
 (0)