Skip to content

Commit

Permalink
fix typo stringValue (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Czechh authored Jan 7, 2021
1 parent a90a045 commit e2c6b66
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datadog_lambda/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def extract_context_from_sqs_event_or_context(event, lambda_context):
try:
first_record = event["Records"][0]
msg_attributes = first_record.get("messageAttributes", {})
dd_json_data = msg_attributes.get("_datadog", {}).get("StringValue", r"{}")
dd_json_data = msg_attributes.get("_datadog", {}).get("stringValue", r"{}")
dd_data = json.loads(dd_json_data)
trace_id = dd_data.get(TraceHeader.TRACE_ID)
parent_id = dd_data.get(TraceHeader.PARENT_ID)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/input_events/sqs.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"messageAttributes": {
"_datadog": {
"StringValue": "{\"x-datadog-trace-id\":\"666\",\"x-datadog-parent-id\":\"777\",\"x-datadog-sampling-priority\":\"1\"}"
"stringValue": "{\"x-datadog-trace-id\":\"666\",\"x-datadog-parent-id\":\"777\",\"x-datadog-sampling-priority\":\"1\"}"
}
},
"md5OfBody": "e4e68fb7bd0e697a0ae8f1bb342846b3",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_with_sqs_distributed_datadog_trace_data(self):
},
"messageAttributes": {
"_datadog": {
"StringValue": json.dumps(
"stringValue": json.dumps(
{
TraceHeader.TRACE_ID: "123",
TraceHeader.PARENT_ID: "321",
Expand Down

0 comments on commit e2c6b66

Please sign in to comment.