-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathconstants.py
More file actions
53 lines (40 loc) · 1.66 KB
/
constants.py
File metadata and controls
53 lines (40 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019 Datadog, Inc.
# Datadog trace sampling priority
class SamplingPriority(object):
USER_REJECT = -1
AUTO_REJECT = 0
AUTO_KEEP = 1
USER_KEEP = 2
# Datadog trace headers
class TraceHeader(object):
TRACE_ID = "x-datadog-trace-id"
PARENT_ID = "x-datadog-parent-id"
SAMPLING_PRIORITY = "x-datadog-sampling-priority"
TAGS = "x-datadog-tags"
# X-Ray subsegment to save Datadog trace metadata
class XraySubsegment(object):
NAME = "datadog-metadata"
TRACE_KEY = "trace"
LAMBDA_FUNCTION_TAGS_KEY = "lambda_function_tags"
NAMESPACE = "datadog"
# TraceContextSource of datadog context. The DD_MERGE_XRAY_TRACES
# feature uses this to determine when to use X-Ray as the parent
# trace.
class TraceContextSource(object):
XRAY = "xray"
EVENT = "event"
DDTRACE = "ddtrace"
# X-Ray deamon
class XrayDaemon(object):
XRAY_TRACE_ID_HEADER_NAME = "_X_AMZN_TRACE_ID"
XRAY_DAEMON_ADDRESS = "AWS_XRAY_DAEMON_ADDRESS"
FUNCTION_NAME_HEADER_NAME = "AWS_LAMBDA_FUNCTION_NAME"
class Headers(object):
Parent_Span_Finish_Time = "x-datadog-parent-span-finish-time"
# For one request from the client, the event.requestContext.requestIds in the authorizer lambda
# invocation and the main function invocation are IDENTICAL. Therefore we can use it to tell
# whether current invocation is the actual original authorizing request or a cached request.
Authorizing_Request_Id = "x-datadog-authorizing-requestid"