datadog_lambda 6.105.0__tar.gz → 6.106.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-6.105.0 → datadog_lambda-6.106.0}/PKG-INFO +1 -1
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/metric.py +16 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/tracing.py +11 -7
- datadog_lambda-6.106.0/datadog_lambda/version.py +1 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/pyproject.toml +1 -1
- datadog_lambda-6.105.0/datadog_lambda/version.py +0 -1
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/LICENSE +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/LICENSE-3rdparty.csv +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/NOTICE +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/README.md +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/__init__.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/api.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/cold_start.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/constants.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/dogstatsd.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/extension.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/handler.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/logger.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/module_name.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/patch.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/span_pointers.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/stats_writer.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/statsd_writer.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/tag_object.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/tags.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/thread_stats_writer.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/trigger.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/wrapper.py +0 -0
- {datadog_lambda-6.105.0 → datadog_lambda-6.106.0}/datadog_lambda/xray.py +0 -0
|
@@ -55,6 +55,22 @@ def lambda_metric(metric_name, value, timestamp=None, tags=None, force_async=Fal
|
|
|
55
55
|
Note that if the extension is present, it will override the DD_FLUSH_TO_LOG value
|
|
56
56
|
and always use the layer to send metrics to the extension
|
|
57
57
|
"""
|
|
58
|
+
if not metric_name or not isinstance(metric_name, str):
|
|
59
|
+
logger.warning(
|
|
60
|
+
"Ignoring metric submission. Invalid metric name: %s", metric_name
|
|
61
|
+
)
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
float(value)
|
|
66
|
+
except (ValueError, TypeError):
|
|
67
|
+
logger.warning(
|
|
68
|
+
"Ignoring metric submission for metric '%s' because the value is not numeric: %r",
|
|
69
|
+
metric_name,
|
|
70
|
+
value,
|
|
71
|
+
)
|
|
72
|
+
return
|
|
73
|
+
|
|
58
74
|
flush_to_logs = os.environ.get("DD_FLUSH_TO_LOG", "").lower() == "true"
|
|
59
75
|
tags = [] if tags is None else list(tags)
|
|
60
76
|
tags.append(dd_lambda_layer_tag)
|
|
@@ -385,21 +385,24 @@ def _parse_high_64_bits(trace_tags: str) -> str:
|
|
|
385
385
|
|
|
386
386
|
def _generate_sfn_parent_id(context: dict) -> int:
|
|
387
387
|
"""
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
Generates a stable parent span ID for a downstream Lambda invoked by a Step Function. The
|
|
389
|
+
upstream Step Function execution context is used to infer the parent's span ID, ensuring trace
|
|
390
|
+
continuity.
|
|
390
391
|
|
|
391
|
-
|
|
392
|
-
|
|
392
|
+
`RetryCount` and `RedriveCount` are appended only when both are nonzero to maintain
|
|
393
|
+
compatibility with older Lambda layers that did not include these fields.
|
|
393
394
|
"""
|
|
394
395
|
execution_id = context.get("Execution").get("Id")
|
|
395
396
|
redrive_count = context.get("Execution").get("RedriveCount", 0)
|
|
396
397
|
state_name = context.get("State").get("Name")
|
|
397
398
|
state_entered_time = context.get("State").get("EnteredTime")
|
|
399
|
+
retry_count = context.get("State").get("RetryCount", 0)
|
|
398
400
|
|
|
399
|
-
|
|
401
|
+
include_counts = not (retry_count == 0 and redrive_count == 0)
|
|
402
|
+
counts_suffix = f"#{retry_count}#{redrive_count}" if include_counts else ""
|
|
400
403
|
|
|
401
404
|
return _deterministic_sha256_hash(
|
|
402
|
-
f"{execution_id}#{state_name}#{state_entered_time}{
|
|
405
|
+
f"{execution_id}#{state_name}#{state_entered_time}{counts_suffix}",
|
|
403
406
|
HIGHER_64_BITS,
|
|
404
407
|
)
|
|
405
408
|
|
|
@@ -1368,8 +1371,9 @@ def create_function_execution_span(
|
|
|
1368
1371
|
if parent_span:
|
|
1369
1372
|
span.parent_id = parent_span.span_id
|
|
1370
1373
|
if span_pointers:
|
|
1374
|
+
root_span = parent_span if parent_span else span
|
|
1371
1375
|
for span_pointer_description in span_pointers:
|
|
1372
|
-
|
|
1376
|
+
root_span._add_span_pointer(
|
|
1373
1377
|
pointer_kind=span_pointer_description.pointer_kind,
|
|
1374
1378
|
pointer_direction=span_pointer_description.pointer_direction,
|
|
1375
1379
|
pointer_hash=span_pointer_description.pointer_hash,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "6.106.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "6.105.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
|