datadog_lambda 8.120.0__tar.gz → 8.122.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/PKG-INFO +3 -2
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/asm.py +3 -1
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/tracing.py +18 -6
- datadog_lambda-8.122.0/datadog_lambda/version.py +1 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/wrapper.py +10 -2
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/pyproject.toml +6 -3
- datadog_lambda-8.120.0/datadog_lambda/version.py +0 -1
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/LICENSE +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/LICENSE-3rdparty.csv +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/NOTICE +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/README.md +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/__init__.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/api.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/cold_start.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/config.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/constants.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/dogstatsd.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/extension.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/handler.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/logger.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/metric.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/module_name.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/patch.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/span_pointers.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/stats_writer.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/statsd_writer.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/tag_object.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/tags.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/thread_stats_writer.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/trigger.py +0 -0
- {datadog_lambda-8.120.0 → datadog_lambda-8.122.0}/datadog_lambda/xray.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: datadog_lambda
|
|
3
|
-
Version: 8.
|
|
3
|
+
Version: 8.122.0
|
|
4
4
|
Summary: The Datadog AWS Lambda Library
|
|
5
5
|
Home-page: https://github.com/DataDog/datadog-lambda-python
|
|
6
6
|
License: Apache-2.0
|
|
@@ -20,7 +20,8 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
20
20
|
Provides-Extra: dev
|
|
21
21
|
Requires-Dist: botocore (>=1.34.0,<2.0.0) ; extra == "dev"
|
|
22
22
|
Requires-Dist: datadog (>=0.51.0,<1.0.0)
|
|
23
|
-
Requires-Dist: ddtrace (>=3.
|
|
23
|
+
Requires-Dist: ddtrace (>=3.19.1,<4) ; python_version >= "3.8" and python_version < "3.10"
|
|
24
|
+
Requires-Dist: ddtrace (>=4.1.1,<5) ; python_version >= "3.10"
|
|
24
25
|
Requires-Dist: flake8 (>=5.0.4,<6.0.0) ; extra == "dev"
|
|
25
26
|
Requires-Dist: pytest (>=8.0.0,<9.0.0) ; extra == "dev"
|
|
26
27
|
Requires-Dist: pytest-benchmark (>=4.0,<5.0) ; extra == "dev"
|
|
@@ -223,7 +223,9 @@ def get_asm_blocked_response(
|
|
|
223
223
|
content = ""
|
|
224
224
|
else:
|
|
225
225
|
content_type = blocked.get("content-type", "application/json")
|
|
226
|
-
content = http_utils._get_blocked_template(
|
|
226
|
+
content = http_utils._get_blocked_template(
|
|
227
|
+
content_type, blocked.get("block_id", "default")
|
|
228
|
+
)
|
|
227
229
|
|
|
228
230
|
response = {
|
|
229
231
|
"statusCode": blocked.get("status_code", 403),
|
|
@@ -927,6 +927,7 @@ def create_inferred_span_from_lambda_function_url_event(event, context):
|
|
|
927
927
|
InferredSpanInfo.set_tags(tags, tag_source="self", synchronicity="sync")
|
|
928
928
|
if span:
|
|
929
929
|
span.set_tags(tags)
|
|
930
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
930
931
|
span.start_ns = int(request_time_epoch * 1e6)
|
|
931
932
|
return span
|
|
932
933
|
|
|
@@ -1047,6 +1048,7 @@ def create_inferred_span_from_api_gateway_websocket_event(
|
|
|
1047
1048
|
span = tracer.trace("aws.apigateway.websocket", **args)
|
|
1048
1049
|
if span:
|
|
1049
1050
|
span.set_tags(tags)
|
|
1051
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1050
1052
|
span.start_ns = int(
|
|
1051
1053
|
finish_time_ns
|
|
1052
1054
|
if finish_time_ns is not None
|
|
@@ -1061,6 +1063,8 @@ def create_inferred_span_from_api_gateway_event(
|
|
|
1061
1063
|
event, context, decode_authorizer_context: bool = True
|
|
1062
1064
|
):
|
|
1063
1065
|
request_context = event.get("requestContext")
|
|
1066
|
+
identity = request_context.get("identity")
|
|
1067
|
+
|
|
1064
1068
|
domain = request_context.get("domainName", "")
|
|
1065
1069
|
api_id = request_context.get("apiId")
|
|
1066
1070
|
service_name = determine_service_name(
|
|
@@ -1072,11 +1076,11 @@ def create_inferred_span_from_api_gateway_event(
|
|
|
1072
1076
|
resource_path = _get_resource_path(event, request_context)
|
|
1073
1077
|
resource = f"{method} {resource_path}"
|
|
1074
1078
|
tags = {
|
|
1075
|
-
"operation_name": "aws.apigateway.rest",
|
|
1076
1079
|
"http.url": http_url,
|
|
1077
1080
|
"endpoint": path,
|
|
1078
1081
|
"http.method": method,
|
|
1079
1082
|
"resource_names": resource,
|
|
1083
|
+
"http.useragent": identity.get("userAgent"),
|
|
1080
1084
|
"span.kind": "server",
|
|
1081
1085
|
"apiid": api_id,
|
|
1082
1086
|
"apiname": api_id,
|
|
@@ -1091,7 +1095,7 @@ def create_inferred_span_from_api_gateway_event(
|
|
|
1091
1095
|
args = {
|
|
1092
1096
|
"service": service_name,
|
|
1093
1097
|
"resource": resource,
|
|
1094
|
-
"span_type": "
|
|
1098
|
+
"span_type": "web",
|
|
1095
1099
|
}
|
|
1096
1100
|
tracer.set_tags(_dd_origin)
|
|
1097
1101
|
upstream_authorizer_span = None
|
|
@@ -1103,6 +1107,7 @@ def create_inferred_span_from_api_gateway_event(
|
|
|
1103
1107
|
span = tracer.trace("aws.apigateway", **args)
|
|
1104
1108
|
if span:
|
|
1105
1109
|
span.set_tags(tags)
|
|
1110
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1106
1111
|
# start time pushed by the inserted authorizer span
|
|
1107
1112
|
span.start_ns = int(
|
|
1108
1113
|
finish_time_ns
|
|
@@ -1140,13 +1145,12 @@ def create_inferred_span_from_http_api_event(
|
|
|
1140
1145
|
resource_path = _get_resource_path(event, request_context)
|
|
1141
1146
|
resource = f"{method} {resource_path}"
|
|
1142
1147
|
tags = {
|
|
1143
|
-
"operation_name": "aws.httpapi",
|
|
1144
1148
|
"endpoint": path,
|
|
1145
1149
|
"http.url": http_url,
|
|
1146
1150
|
"http.method": http.get("method"),
|
|
1147
1151
|
"http.protocol": http.get("protocol"),
|
|
1148
1152
|
"http.source_ip": http.get("sourceIp"),
|
|
1149
|
-
"http.
|
|
1153
|
+
"http.useragent": http.get("userAgent"),
|
|
1150
1154
|
"resource_names": resource,
|
|
1151
1155
|
"request_id": context.aws_request_id,
|
|
1152
1156
|
"apiid": api_id,
|
|
@@ -1167,10 +1171,11 @@ def create_inferred_span_from_http_api_event(
|
|
|
1167
1171
|
Headers.Parent_Span_Finish_Time
|
|
1168
1172
|
)
|
|
1169
1173
|
span = tracer.trace(
|
|
1170
|
-
"aws.httpapi", service=service_name, resource=resource, span_type="
|
|
1174
|
+
"aws.httpapi", service=service_name, resource=resource, span_type="web"
|
|
1171
1175
|
)
|
|
1172
1176
|
if span:
|
|
1173
1177
|
span.set_tags(tags)
|
|
1178
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1174
1179
|
span.start_ns = int(inferred_span_start_ns)
|
|
1175
1180
|
return span
|
|
1176
1181
|
|
|
@@ -1237,6 +1242,7 @@ def create_inferred_span_from_sqs_event(event, context):
|
|
|
1237
1242
|
)
|
|
1238
1243
|
if span:
|
|
1239
1244
|
span.set_tags(tags)
|
|
1245
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1240
1246
|
span.start = start_time
|
|
1241
1247
|
if upstream_span:
|
|
1242
1248
|
span.parent_id = upstream_span.span_id
|
|
@@ -1278,6 +1284,7 @@ def create_inferred_span_from_sns_event(event, context):
|
|
|
1278
1284
|
)
|
|
1279
1285
|
if span:
|
|
1280
1286
|
span.set_tags(tags)
|
|
1287
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1281
1288
|
span.start = dt.replace(tzinfo=timezone.utc).timestamp()
|
|
1282
1289
|
return span
|
|
1283
1290
|
|
|
@@ -1313,6 +1320,7 @@ def create_inferred_span_from_kinesis_event(event, context):
|
|
|
1313
1320
|
)
|
|
1314
1321
|
if span:
|
|
1315
1322
|
span.set_tags(tags)
|
|
1323
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1316
1324
|
span.start = request_time_epoch
|
|
1317
1325
|
return span
|
|
1318
1326
|
|
|
@@ -1345,6 +1353,7 @@ def create_inferred_span_from_dynamodb_event(event, context):
|
|
|
1345
1353
|
)
|
|
1346
1354
|
if span:
|
|
1347
1355
|
span.set_tags(tags)
|
|
1356
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1348
1357
|
|
|
1349
1358
|
span.start = int(request_time_epoch)
|
|
1350
1359
|
return span
|
|
@@ -1381,6 +1390,7 @@ def create_inferred_span_from_s3_event(event, context):
|
|
|
1381
1390
|
)
|
|
1382
1391
|
if span:
|
|
1383
1392
|
span.set_tags(tags)
|
|
1393
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1384
1394
|
span.start = dt.replace(tzinfo=timezone.utc).timestamp()
|
|
1385
1395
|
return span
|
|
1386
1396
|
|
|
@@ -1421,10 +1431,11 @@ def create_inferred_span_from_eventbridge_event(event, context):
|
|
|
1421
1431
|
)
|
|
1422
1432
|
if span:
|
|
1423
1433
|
span.set_tags(tags)
|
|
1434
|
+
span.set_metric(InferredSpanInfo.METRIC, 1.0)
|
|
1424
1435
|
span.start = dt.replace(tzinfo=timezone.utc).timestamp()
|
|
1425
1436
|
|
|
1426
1437
|
# Since inferred span will later parent Lambda, preserve Lambda's current parent
|
|
1427
|
-
if dd_trace_context
|
|
1438
|
+
if dd_trace_context and getattr(dd_trace_context, "span_id", None):
|
|
1428
1439
|
span.parent_id = dd_trace_context.span_id
|
|
1429
1440
|
|
|
1430
1441
|
return span
|
|
@@ -1512,6 +1523,7 @@ class InferredSpanInfo(object):
|
|
|
1512
1523
|
BASE_NAME = "_inferred_span"
|
|
1513
1524
|
SYNCHRONICITY = f"{BASE_NAME}.synchronicity"
|
|
1514
1525
|
TAG_SOURCE = f"{BASE_NAME}.tag_source"
|
|
1526
|
+
METRIC = f"_dd.{BASE_NAME}"
|
|
1515
1527
|
|
|
1516
1528
|
@staticmethod
|
|
1517
1529
|
def set_tags(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "8.122.0"
|
|
@@ -346,8 +346,16 @@ class _LambdaDecorator(object):
|
|
|
346
346
|
if status_code:
|
|
347
347
|
self.inferred_span.set_tag("http.status_code", status_code)
|
|
348
348
|
|
|
349
|
-
if self.trigger_tags
|
|
350
|
-
self.
|
|
349
|
+
if self.trigger_tags:
|
|
350
|
+
route = self.trigger_tags.get("http.route")
|
|
351
|
+
if route:
|
|
352
|
+
self.inferred_span.set_tag("http.route", route)
|
|
353
|
+
|
|
354
|
+
event_source_arn = self.trigger_tags.get(
|
|
355
|
+
"function_trigger.event_source_arn"
|
|
356
|
+
)
|
|
357
|
+
if event_source_arn:
|
|
358
|
+
self.inferred_span.set_tag("dd_resource_key", event_source_arn)
|
|
351
359
|
|
|
352
360
|
if config.service:
|
|
353
361
|
self.inferred_span.set_tag("peer.service", config.service)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "datadog_lambda"
|
|
3
|
-
version = "8.
|
|
3
|
+
version = "8.122.0"
|
|
4
4
|
description = "The Datadog AWS Lambda Library"
|
|
5
5
|
authors = ["Datadog, Inc. <dev@datadoghq.com>"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -29,7 +29,10 @@ classifiers = [
|
|
|
29
29
|
python = ">=3.8.0,<4"
|
|
30
30
|
datadog = ">=0.51.0,<1.0.0"
|
|
31
31
|
wrapt = "^1.11.2"
|
|
32
|
-
ddtrace =
|
|
32
|
+
ddtrace = [
|
|
33
|
+
{version = ">=3.19.1,<4", python = ">=3.8,<3.10"},
|
|
34
|
+
{version = ">=4.1.1,<5", python = ">=3.10"}
|
|
35
|
+
]
|
|
33
36
|
ujson = ">=5.9.0"
|
|
34
37
|
botocore = { version = "^1.34.0", optional = true }
|
|
35
38
|
requests = { version ="^2.22.0", optional = true }
|
|
@@ -51,4 +54,4 @@ requires = ["poetry-core>=1.0.0"]
|
|
|
51
54
|
build-backend = "poetry.core.masonry.api"
|
|
52
55
|
|
|
53
56
|
[tool.pytest.ini_options]
|
|
54
|
-
addopts = "--benchmark-disable --benchmark-autosave"
|
|
57
|
+
addopts = "--benchmark-disable --benchmark-autosave"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "8.120.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|