Skip to content

Commit 0a070a6

Browse files
authored
authorizer trace context (#256)
* authorizer spans checkin * authorizer spans checkin * fix integration tests * reformatting * tests reformat * add httpapi case * formatting fixes * fixing http api caching cases * support websocket cases * reformat tests * encode authorizer injected data and other fixes * format fixes * fix token-type authorizer span's startTime * more precise on the parent span finish time * fix the authorizer span's start time * fix httpapi finish time case * fix .vscode/settings.json * finish_time accuracey update to nanosecond * test_no_error_with_nonetype_headers fix * fix test_no_error_with_nonetype_headers * add decode_authorizer_context option and no zero-length span for httpapi case * format and unittest fix * lint tests * small refactor and reformat * add an unittest case for the encoding part and fix some bugs * Addressing comments.
1 parent 33efc63 commit 0a070a6

13 files changed

+1057
-56
lines changed

datadog_lambda/constants.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,15 @@ class XrayDaemon(object):
4242
XRAY_TRACE_ID_HEADER_NAME = "_X_AMZN_TRACE_ID"
4343
XRAY_DAEMON_ADDRESS = "AWS_XRAY_DAEMON_ADDRESS"
4444
FUNCTION_NAME_HEADER_NAME = "AWS_LAMBDA_FUNCTION_NAME"
45+
46+
47+
class Headers(object):
48+
Parent_Span_Finish_Time = "x-datadog-parent-span-finish-time"
49+
50+
# For one request from the client, the event.requestContext.requestIds in the authorizer lambda
51+
# invocation and the main function invocation are IDENTICAL. Therefore we can use it to tell
52+
# whether current invocation is the actual original authorizing request or a cached request.
53+
Authorizing_Request_Id = "x-datadog-authorizing-requestid"
54+
55+
# injected by the HTTPPropagator.inject but no use
56+
TAGS_HEADER_TO_DELETE = "x-datadog-tags"

0 commit comments

Comments
 (0)