diff --git a/Dockerfile b/Dockerfile index 40726556..610fef38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN find . -name 'libddwaf.so' -delete RUN rm -rf ./python/lib/$runtime/site-packages/urllib3* RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/*.so RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so -RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/libdd_wrapper.so +RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/libdd_wrapper*.so RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/ddup/_ddup.*.so RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/stack_v2/_stack_v2.*.so RUN find . -name "*.dist-info" -type d | xargs rm -rf diff --git a/ci/datasources/regions.yaml b/ci/datasources/regions.yaml index 9f12a011..93816ce9 100644 --- a/ci/datasources/regions.yaml +++ b/ci/datasources/regions.yaml @@ -11,6 +11,7 @@ regions: - code: "ap-southeast-2" - code: "ap-southeast-3" - code: "ap-southeast-4" + - code: "ap-southeast-5" - code: "ap-northeast-1" - code: "ap-northeast-2" - code: "ap-northeast-3" diff --git a/datadog_lambda/metric.py b/datadog_lambda/metric.py index 44f8e377..d312e3bb 100644 --- a/datadog_lambda/metric.py +++ b/datadog_lambda/metric.py @@ -125,6 +125,7 @@ def flush_stats(lambda_context=None): lambda_stats.flush() if extension_thread_stats is not None: + tags = None if lambda_context is not None: tags = get_enhanced_metrics_tags(lambda_context) split_arn = lambda_context.invoked_function_arn.split(":") diff --git a/datadog_lambda/span_pointers.py b/datadog_lambda/span_pointers.py new file mode 100644 index 00000000..4c33975f --- /dev/null +++ b/datadog_lambda/span_pointers.py @@ -0,0 +1,91 @@ +from itertools import chain +import logging +from typing import List + +from ddtrace._trace.utils_botocore.span_pointers import ( + _aws_s3_object_span_pointer_description, +) +from ddtrace._trace._span_pointer import _SpanPointerDirection +from ddtrace._trace._span_pointer import _SpanPointerDescription +from datadog_lambda.trigger import EventTypes + + +logger = logging.getLogger(__name__) + + +def calculate_span_pointers( + event_source, + event, +) -> List[_SpanPointerDescription]: + try: + if event_source.equals(EventTypes.S3): + return _calculate_s3_span_pointers_for_event(event) + + except Exception as e: + logger.warning( + "failed to calculate span pointers for event: %s", + str(e), + ) + + return [] + + +def _calculate_s3_span_pointers_for_event(event) -> List[_SpanPointerDescription]: + # Example event: + # https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html + + return list( + chain.from_iterable( + _calculate_s3_span_pointers_for_event_record(record) + for record in event.get("Records", []) + ) + ) + + +def _calculate_s3_span_pointers_for_event_record( + record, +) -> List[_SpanPointerDescription]: + # Event types: + # https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-event-types-and-destinations.html + + if record.get("eventName").startswith("ObjectCreated:"): + s3_information = record.get("s3", None) + if s3_information is not None: + return _calculate_s3_span_pointers_for_object_created_s3_information( + s3_information + ) + + return [] + + +def _calculate_s3_span_pointers_for_object_created_s3_information( + s3_information, +) -> List[_SpanPointerDescription]: + try: + bucket = s3_information["bucket"]["name"] + key = s3_information["object"]["key"] + etag = s3_information["object"]["eTag"] + + except KeyError as e: + logger.warning( + "missing s3 information required to make a span pointer: %s", + str(e), + ) + return [] + + try: + return [ + _aws_s3_object_span_pointer_description( + pointer_direction=_SpanPointerDirection.UPSTREAM, + bucket=bucket, + key=key, + etag=etag, + ) + ] + + except Exception as e: + logger.warning( + "failed to generate S3 span pointer: %s", + str(e), + ) + return [] diff --git a/datadog_lambda/tracing.py b/datadog_lambda/tracing.py index 64a19ccd..0aded4de 100644 --- a/datadog_lambda/tracing.py +++ b/datadog_lambda/tracing.py @@ -407,6 +407,14 @@ def extract_context_from_step_functions(event, lambda_context): return extract_context_from_lambda_context(lambda_context) +def is_legacy_lambda_step_function(event): + """ + Check if the event is a step function that called a legacy lambda + """ + event = event.get("Payload", {}) + return "Execution" in event and "StateMachine" in event and "State" in event + + def extract_context_custom_extractor(extractor, event, lambda_context): """ Extract Datadog trace context using a custom trace extractor function @@ -1251,6 +1259,7 @@ def create_function_execution_span( merge_xray_traces, trigger_tags, parent_span=None, + span_pointers=None, ): tags = None if context: @@ -1288,6 +1297,14 @@ def create_function_execution_span( span.set_tags(tags) if parent_span: span.parent_id = parent_span.span_id + if span_pointers: + for span_pointer_description in span_pointers: + span._add_span_pointer( + pointer_kind=span_pointer_description.pointer_kind, + pointer_direction=span_pointer_description.pointer_direction, + pointer_hash=span_pointer_description.pointer_hash, + extra_attributes=span_pointer_description.extra_attributes, + ) return span diff --git a/datadog_lambda/version.py b/datadog_lambda/version.py index d29698b5..54fd99d2 100644 --- a/datadog_lambda/version.py +++ b/datadog_lambda/version.py @@ -1 +1 @@ -__version__ = "6.98.0" +__version__ = "6.99.0" diff --git a/datadog_lambda/wrapper.py b/datadog_lambda/wrapper.py index ed3d92b4..2632d22e 100644 --- a/datadog_lambda/wrapper.py +++ b/datadog_lambda/wrapper.py @@ -30,6 +30,7 @@ ) from datadog_lambda.module_name import modify_module_name from datadog_lambda.patch import patch_all +from datadog_lambda.span_pointers import calculate_span_pointers from datadog_lambda.tracing import ( extract_dd_trace_context, create_dd_dummy_metadata_subsegment, @@ -44,6 +45,7 @@ is_authorizer_response, tracer, propagator, + is_legacy_lambda_step_function, ) from datadog_lambda.trigger import ( extract_trigger_tags, @@ -277,6 +279,8 @@ def _before(self, event, context): self.response = None set_cold_start(init_timestamp_ns) submit_invocations_metric(context) + if is_legacy_lambda_step_function(event): + event = event["Payload"] self.trigger_tags = extract_trigger_tags(event, context) # Extract Datadog trace context and source from incoming requests dd_context, trace_context_source, event_source = extract_dd_trace_context( @@ -304,14 +308,15 @@ def _before(self, event, context): event, context, event_source, self.decode_authorizer_context ) self.span = create_function_execution_span( - context, - self.function_name, - is_cold_start(), - is_proactive_init(), - trace_context_source, - self.merge_xray_traces, - self.trigger_tags, + context=context, + function_name=self.function_name, + is_cold_start=is_cold_start(), + is_proactive_init=is_proactive_init(), + trace_context_source=trace_context_source, + merge_xray_traces=self.merge_xray_traces, + trigger_tags=self.trigger_tags, parent_span=self.inferred_span, + span_pointers=calculate_span_pointers(event_source, event), ) else: set_correlation_ids() diff --git a/poetry.lock b/poetry.lock index 6a8bda88..e9557200 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,37 +1,18 @@ # This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. -[[package]] -name = "attrs" -version = "24.2.0" -description = "Classes Without Boilerplate" -optional = false -python-versions = ">=3.7" -files = [ - {file = "attrs-24.2.0-py3-none-any.whl", hash = "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2"}, - {file = "attrs-24.2.0.tar.gz", hash = "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346"}, -] - -[package.extras] -benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"] -tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] - [[package]] name = "boto3" -version = "1.34.156" +version = "1.35.31" description = "The AWS SDK for Python" optional = true python-versions = ">=3.8" files = [ - {file = "boto3-1.34.156-py3-none-any.whl", hash = "sha256:cbbd453270b8ce94ef9da60dfbb6f9ceeb3eeee226b635aa9ec44b1def98cc96"}, - {file = "boto3-1.34.156.tar.gz", hash = "sha256:b33e9a8f8be80d3053b8418836a7c1900410b23a30c7cb040927d601a1082e68"}, + {file = "boto3-1.35.31-py3-none-any.whl", hash = "sha256:2e9af74d10d8af7610a8d8468d2914961f116912a024fce17351825260385a52"}, + {file = "boto3-1.35.31.tar.gz", hash = "sha256:8c593af260c4ea3eb6f079c09908f94494ca2222aa4e40a7ff490fab1cee8b39"}, ] [package.dependencies] -botocore = ">=1.34.156,<1.35.0" +botocore = ">=1.35.31,<1.36.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -40,13 +21,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.156" +version = "1.35.31" description = "Low-level, data-driven core of boto 3." optional = true python-versions = ">=3.8" files = [ - {file = "botocore-1.34.156-py3-none-any.whl", hash = "sha256:c48f8c8996216dfdeeb0aa6d3c0f2c7ae25234766434a2ea3e57bdc08494bdda"}, - {file = "botocore-1.34.156.tar.gz", hash = "sha256:5d1478c41ab9681e660b3322432fe09c4055759c317984b7b8d3af9557ff769a"}, + {file = "botocore-1.35.31-py3-none-any.whl", hash = "sha256:4cee814875bc78656aef4011d3d6b2231e96f53ea3661ee428201afb579d5c31"}, + {file = "botocore-1.35.31.tar.gz", hash = "sha256:f7bfa910cf2cbcc8c2307c1cf7b93495d614c2d699883417893e0a337fe4eb63"}, ] [package.dependencies] @@ -58,7 +39,7 @@ urllib3 = [ ] [package.extras] -crt = ["awscrt (==0.21.2)"] +crt = ["awscrt (==0.21.5)"] [[package]] name = "bytecode" @@ -74,40 +55,15 @@ files = [ [package.dependencies] typing-extensions = {version = "*", markers = "python_version < \"3.10\""} -[[package]] -name = "cattrs" -version = "23.2.3" -description = "Composable complex class support for attrs and dataclasses." -optional = false -python-versions = ">=3.8" -files = [ - {file = "cattrs-23.2.3-py3-none-any.whl", hash = "sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108"}, - {file = "cattrs-23.2.3.tar.gz", hash = "sha256:a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f"}, -] - -[package.dependencies] -attrs = ">=23.1.0" -exceptiongroup = {version = ">=1.1.1", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.1.0,<4.6.3 || >4.6.3", markers = "python_version < \"3.11\""} - -[package.extras] -bson = ["pymongo (>=4.4.0)"] -cbor2 = ["cbor2 (>=5.4.6)"] -msgpack = ["msgpack (>=1.0.5)"] -orjson = ["orjson (>=3.9.2)"] -pyyaml = ["pyyaml (>=6.0)"] -tomlkit = ["tomlkit (>=0.11.8)"] -ujson = ["ujson (>=5.7.0)"] - [[package]] name = "certifi" -version = "2024.7.4" +version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, - {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, ] [[package]] @@ -222,119 +178,98 @@ files = [ [[package]] name = "datadog" -version = "0.49.1" +version = "0.50.1" description = "The Datadog Python library" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ - {file = "datadog-0.49.1-py2.py3-none-any.whl", hash = "sha256:4a56d57490ea699a0dfd9253547485a57b4120e93489defadcf95c66272374d6"}, - {file = "datadog-0.49.1.tar.gz", hash = "sha256:4cb7a7991af6cadb868fe450cd456473e65f11fc678b7d7cf61044ff1c6074d8"}, + {file = "datadog-0.50.1-py2.py3-none-any.whl", hash = "sha256:eb101abee34fe6c1121558fd5ea48f592eb661604abb7914c4f693d8ad25a515"}, + {file = "datadog-0.50.1.tar.gz", hash = "sha256:579d4db54bd6ef918c5250217edb15b80b7b11582b8e24fce43702768c3f2e2d"}, ] [package.dependencies] requests = ">=2.6.0" -[[package]] -name = "ddsketch" -version = "3.0.1" -description = "Distributed quantile sketches" -optional = false -python-versions = ">=3.7" -files = [ - {file = "ddsketch-3.0.1-py3-none-any.whl", hash = "sha256:6d047b455fe2837c43d366ff1ae6ba0c3166e15499de8688437a75cea914224e"}, - {file = "ddsketch-3.0.1.tar.gz", hash = "sha256:aa8f20b2965e61731ca4fee2ca9c209f397f5bbb23f9d192ec8bd7a2f5bd9824"}, -] - -[package.dependencies] -six = "*" - -[package.extras] -serialization = ["protobuf (>=3.0.0)"] - [[package]] name = "ddtrace" -version = "2.10.4" +version = "2.14.1" description = "Datadog APM client library" optional = false python-versions = ">=3.7" files = [ - {file = "ddtrace-2.10.4-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:a7c5604654682aa0f5a717d93d36d1a1737cda4ca107c272ca477acf8c6fe076"}, - {file = "ddtrace-2.10.4-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:a0d9c6f0d91a97c71596787df80e0ecc582d42a584679a587b8e3e6fa8e5aa54"}, - {file = "ddtrace-2.10.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70c9c6452bb052e26ce6799024205c37ac76b3554d31b5ede7df90e00d7bbbb4"}, - {file = "ddtrace-2.10.4-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a764002f486794760817396095376f4cfb88b5571b5b6c75ae8a27cf3609d881"}, - {file = "ddtrace-2.10.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b87219b9f49828357fa70fcb2a2cb18981896d44175fc687b65ff906c663f26"}, - {file = "ddtrace-2.10.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:65fe081b385e43b86d061dbfda9582308287f17c3f1ad2fe38305765079dd825"}, - {file = "ddtrace-2.10.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d8903c4eb54b6b690abe138275811492bc288791f488f39c1d779e279b06d312"}, - {file = "ddtrace-2.10.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:39b2b08a96f2715fa57d441fcd2ba4b49eee4d23fa8d162032f98ec5a652b74c"}, - {file = "ddtrace-2.10.4-cp310-cp310-win32.whl", hash = "sha256:f364f0b2ec96cad163a6943dcb9ec6c3262da6d261a0c2057a4524bee8b07166"}, - {file = "ddtrace-2.10.4-cp310-cp310-win_amd64.whl", hash = "sha256:dc6b0179f169e3b7424441e0af55a08795491e35ab9e9586a8970e66a11ac14f"}, - {file = "ddtrace-2.10.4-cp311-cp311-macosx_12_0_universal2.whl", hash = "sha256:7a4f9d6ec5cb9cbb0fbfdb3b47873e160716fbc7a98c863d6e6a260b882ef18f"}, - {file = "ddtrace-2.10.4-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:9d69c965bd4c7448d4a6dbb92736c7bc16c4bd3168ec1a5ee31afbb02be9b846"}, - {file = "ddtrace-2.10.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f84810d4f4423864c41efb1586aa573b074a9179aa2b4416a3d249aec91f679"}, - {file = "ddtrace-2.10.4-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7775e90338ee8d8e0c65a92edb88f9a477977cad7b27436581a2b9368440960b"}, - {file = "ddtrace-2.10.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb0e72eb97e0cc18ffa4e5f7bb34c7738c0af1aa05f26e72c9e4467266061442"}, - {file = "ddtrace-2.10.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3f003822488bca7f8d2c245a80adce02118fba76e567f3818b042fd7ef132d57"}, - {file = "ddtrace-2.10.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:beb9a9a9adc8627a1b6487f2b350b418c5188d5b9c83be19a15403e708c62280"}, - {file = "ddtrace-2.10.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:41880b06ea7720b75df6d1703190e0bb0e5eb478c1ffcec6711a1a5c44503596"}, - {file = "ddtrace-2.10.4-cp311-cp311-win32.whl", hash = "sha256:b538db5512aac530d46bd2f438324d4c6cb950363d865c264dcd5f844a3c56ad"}, - {file = "ddtrace-2.10.4-cp311-cp311-win_amd64.whl", hash = "sha256:45c98313d0572d7dd3a493d5b53ccb5798691dbe785e0245dc057cd30939cbb2"}, - {file = "ddtrace-2.10.4-cp312-cp312-macosx_12_0_universal2.whl", hash = "sha256:3d9f90f84a83d53c9c363b3c3673606b1066f4ea0d09edf4d5684ed1a64bf131"}, - {file = "ddtrace-2.10.4-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:2cfc3737fd79e13ba786b29e7fb5d9a48899779d1f62bb13cfc9065df43dd049"}, - {file = "ddtrace-2.10.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ee686cd9c311e204a2c40e8102b17a7fe2226e9a29a99585f0bcf515527b6f9"}, - {file = "ddtrace-2.10.4-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b5cd07d2e9b6148067bec473982a95c724049eeae036d9156df677ea4b181483"}, - {file = "ddtrace-2.10.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e001982c0b01dc6905103be11d00c81ff743e28cc42eb6484f422f2cc2b1d6db"}, - {file = "ddtrace-2.10.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:f6626f79264e0bce443864b4582de7983080e772942f3f5db08f1ff0262f8371"}, - {file = "ddtrace-2.10.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a6fded075f195e7c922a43c2fd13243e25272cafd866853f6e9a9ce4ac647721"}, - {file = "ddtrace-2.10.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:872259fdc12448f6e8b7cfe7b20e58467847c2ef579962134772b41909858b0e"}, - {file = "ddtrace-2.10.4-cp312-cp312-win32.whl", hash = "sha256:2c19868446d0a9ea9473847b335bdcfc69e9adc9fea7469c1ecbbb2decc8ab2e"}, - {file = "ddtrace-2.10.4-cp312-cp312-win_amd64.whl", hash = "sha256:826586f0d3f7363f1c406d4caeb3b8a0db84348c0b9f12e1e61c29d79a03b26e"}, - {file = "ddtrace-2.10.4-cp37-cp37m-macosx_12_0_x86_64.whl", hash = "sha256:001f626335a6bbe7bacbc11b545956fc82c00eb8993831fc5dc7e5898e01bc10"}, - {file = "ddtrace-2.10.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a5179e4d66061cf566c622a8f099497c50ea9e57f4f6bc1dfa0fc25dd6f5111"}, - {file = "ddtrace-2.10.4-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3dae175bcd1e3634db576059dfdc76f304212e31794d45351ed643f3c32a3913"}, - {file = "ddtrace-2.10.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64db1467c4aaa55c828daa9db380737608959ed9a5f883bd53db5acd95c1d7c6"}, - {file = "ddtrace-2.10.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:e21ce02e8f5c415f94748ac6ad406ba4f0f1e84a5416a14e14772495af98ac5a"}, - {file = "ddtrace-2.10.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:9e4a69b60dd60da6dbee88599560903af71f34b9891ab9f0e71a33ac210b71de"}, - {file = "ddtrace-2.10.4-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:41f865c1babe7a8b48e1393251ac91b6a0d856a6544e3c2da01981c342dcc750"}, - {file = "ddtrace-2.10.4-cp37-cp37m-win32.whl", hash = "sha256:15e766fdb525065e03c370ef511cb86f861712c46f34f82290fd0bb8a1ffb724"}, - {file = "ddtrace-2.10.4-cp37-cp37m-win_amd64.whl", hash = "sha256:32cdefb83ff9426a701ad8eb507d54d277526037b1a9e69366f8c03928980939"}, - {file = "ddtrace-2.10.4-cp38-cp38-macosx_12_0_universal2.whl", hash = "sha256:445725d19d95a7526c46678f364b1a107d3c5be7ab10f0f78edc362a2d258c56"}, - {file = "ddtrace-2.10.4-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:ab923631245e40b55474f3c86e5c44fb324e3dc8d99ce58d66ba972ed4a2f92e"}, - {file = "ddtrace-2.10.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:032e46dbad09668d7dc8ebaa70772ea326b41101cc8200394d7a8cf246f43aca"}, - {file = "ddtrace-2.10.4-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:41a621029079780420bfeffac559bed963808844d8aecbdab62c1e2294ece299"}, - {file = "ddtrace-2.10.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e731f76657caa42c6d773ce6ec0674c9ac5c5e01ddd8ada96f48ff8f1267e562"}, - {file = "ddtrace-2.10.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:30b9ef3fd8ccba20d671a0f33330202d563988e33fc382a9d5ffa586a46dbe1b"}, - {file = "ddtrace-2.10.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:9402df23b894f32eb92cd20531f1c336824f4b82c56167baf2666bd6c42cba09"}, - {file = "ddtrace-2.10.4-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:9aa7015bc6375705e5fb2ee7eb1ca4be6298dcc976d5c066e2afecc0c6dbb498"}, - {file = "ddtrace-2.10.4-cp38-cp38-win32.whl", hash = "sha256:16f7a843fc8fcec9a49ca4f164353a88a1370f90f1b42a094bd22cf082a9b3c2"}, - {file = "ddtrace-2.10.4-cp38-cp38-win_amd64.whl", hash = "sha256:b855914ddeb8a80ec63f830cb5ac1e1a4cb3b11b9cb03dcb056da1924d4a28a3"}, - {file = "ddtrace-2.10.4-cp39-cp39-macosx_12_0_universal2.whl", hash = "sha256:75b0d8d6980f76dac1e9d56800c343b9cd3c5504ec8d821deaa3a52e3eccb11e"}, - {file = "ddtrace-2.10.4-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:8b1b9c2da530f6da01624ea5f5a9121198d96fa06c59d9b20dd1540122c19889"}, - {file = "ddtrace-2.10.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02f1e292a45fed6bce8289241877c825279fb981f773ad3a82205523a27a8458"}, - {file = "ddtrace-2.10.4-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a08d40f0fd126ad09916fccee0f85c20395907aa7961900d5ad67bfcd6d12afd"}, - {file = "ddtrace-2.10.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ff8a5648db09d9c2736f88a3eb641a665bec0adbd24db4bfd8cb00a9cc84200"}, - {file = "ddtrace-2.10.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a3409973b9bfe7c1c3ed568ce78a80b760bad8bb964983835b6b90d787166f11"}, - {file = "ddtrace-2.10.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9b0db4567b7dce7339c29d302da6430917d5c4ffd9eb8cca76c54dd870b61205"}, - {file = "ddtrace-2.10.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:c987c5ff4863b9acf2de8eb395dbf06dad928cd8d962618823809ae778702ad9"}, - {file = "ddtrace-2.10.4-cp39-cp39-win32.whl", hash = "sha256:f9c2e5c551c48b07b416d4dba73011c04d462b024ad4b7dfe38e65dcc9bde6b3"}, - {file = "ddtrace-2.10.4-cp39-cp39-win_amd64.whl", hash = "sha256:40f5c918fefb83a27bfd6665cb96a8a2ae264c1b01d2b8c54e3bfacd04de4c44"}, - {file = "ddtrace-2.10.4.tar.gz", hash = "sha256:d55a4e45b98d0f16adaefb6d95dc942bfadc9e9651ca884f5f70f8f098f6a893"}, + {file = "ddtrace-2.14.1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:45006561033362ae3bf8619e4e23b5f044c1d85ab75f60bfada9cb26b50f3136"}, + {file = "ddtrace-2.14.1-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:ec918f63a49f426f0b8507ed045752d31a4fbac6058861dab37e59ea21ec14e6"}, + {file = "ddtrace-2.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6dbef64063312afac39fe3c46aa848e0191b741a31664ce994445c76beb49aa5"}, + {file = "ddtrace-2.14.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aff1e0749d8bda9e7ec68a3d7c847a02fc6cca8f8a0444c7d33d8c11d6cb9d28"}, + {file = "ddtrace-2.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9cec95ed8e442efdab682e54b4d200d100c028207a2597fc0e879518f08495b2"}, + {file = "ddtrace-2.14.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:33d0437a4a4e71ae1defb58d940d3efddb3372201bc5ae0ecb960bc5b1684453"}, + {file = "ddtrace-2.14.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:66e07bca5bcdb16231bdaf6f848b9d2ab677ab6569185cf33ffceac1406123fb"}, + {file = "ddtrace-2.14.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:6257295f04950773929ab2586a6b1193015dffdf2e1f915decfb8cce99e7be3e"}, + {file = "ddtrace-2.14.1-cp310-cp310-win32.whl", hash = "sha256:e57d43bb848a40f4b5efacb3ebece41ddfc4d40b4fb9e5d1b49d43fd33565666"}, + {file = "ddtrace-2.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:e595d2acba589f2881809c3a1e8302a8ddbfc9d49a546eadf9fb57ee18e39472"}, + {file = "ddtrace-2.14.1-cp311-cp311-macosx_12_0_universal2.whl", hash = "sha256:bd5c7274978625688b4eece12deb19704c2ba16187e1e8c35a76b312b6ee587f"}, + {file = "ddtrace-2.14.1-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:901e57ed636fbf5b5d002b0348f33d502779cc31d75ac703b63e0b6a84085c07"}, + {file = "ddtrace-2.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20c4cd8ae87bef85542984ac203f5dd20359daf3a5d7f3f6f7f69736adb0c79e"}, + {file = "ddtrace-2.14.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ad1fbb0705ff096184e3e5013c6e8f3b7181847ddfb18ea7f8311c3913a5734"}, + {file = "ddtrace-2.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a57bb3f8e1bce2e19e3e7effa244bd6cf34a8203692f222c775d8b7d0cd17fa"}, + {file = "ddtrace-2.14.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c8e071118dc999d66b94bbe4d927967c76f97a6d10579d75881ee0ecde97baa8"}, + {file = "ddtrace-2.14.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:08edf6315429f7b46c760f8726e1f4dd1538c9afd2c02861b5341fd78c39ae5a"}, + {file = "ddtrace-2.14.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:707a7c4a0af62234b0d0a8480d9b0c534d57f25a22f554842bceacbd6ad11f96"}, + {file = "ddtrace-2.14.1-cp311-cp311-win32.whl", hash = "sha256:d52e5cecfddd9b0155792f8f2dc8060337d692a37b24cf8dd862b3026797c1cb"}, + {file = "ddtrace-2.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:761cbfc629636d38a166f8b8eb5425bdbb29aeaad093095230078257e75572cc"}, + {file = "ddtrace-2.14.1-cp312-cp312-macosx_12_0_universal2.whl", hash = "sha256:b7e128001653ad1e24a6705251110c49f8017cb22071de3b77b43bf77978d90b"}, + {file = "ddtrace-2.14.1-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:18133ea923613214dfff790a48f4a0cfdfc642804bdb4e3b3e7176848f6b1d8f"}, + {file = "ddtrace-2.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d59eb2995eec053a7301a07c34795db06ce12b1b86ce787afa3c67ec3bcf6a"}, + {file = "ddtrace-2.14.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8b4aa9aa17f64f2f8e33b9133c5929eebc82773bdf4f739472a4308595bede1e"}, + {file = "ddtrace-2.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70f78d588a8a11c5b5b12612100fd0e05eb6e85d9c33848555e151b20fa5f2c3"}, + {file = "ddtrace-2.14.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3cafa9a6663bef1a3caee783f21f5a94c6bb77cf9ab62b9ec6f7c160cdd012aa"}, + {file = "ddtrace-2.14.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4a9385b52405d069a7cf0d17917a9efafb7261e3d77fe6a3366840e4978e70d9"}, + {file = "ddtrace-2.14.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:219ccfd16c0117ab2b26249acb0c88cc0eb0d9543d422ac0ba8f0bfaddb1be2f"}, + {file = "ddtrace-2.14.1-cp312-cp312-win32.whl", hash = "sha256:97c154e3fb9312fdc926d42204f6aa6966d51a834ef48b5f1655ad8d37b8ee32"}, + {file = "ddtrace-2.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:0286787a6d883606351b2c59ea21deefdeb80cf07f80d37cf86aef8dd1f17637"}, + {file = "ddtrace-2.14.1-cp37-cp37m-macosx_12_0_x86_64.whl", hash = "sha256:294583ef333a9cbe5f8ec4906f37dd9dad27d5007a848d291908c1f6df5dabbe"}, + {file = "ddtrace-2.14.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e863f82f3911242bbcac1c1f9575ba025dae0fc00c57d949b14ca62a27f6dc10"}, + {file = "ddtrace-2.14.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8fee112bd030daf73a26845ebeeb94d2fbdd6aff716643cbad2cf7c68fe722c1"}, + {file = "ddtrace-2.14.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6705f094130d39f9024831273790d240d1af00c18055377fd7084af693ada600"}, + {file = "ddtrace-2.14.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ae3461dac55604e035e8fecaf1ae5ef65a3bb0cd6c212966df54316ed46c144e"}, + {file = "ddtrace-2.14.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:7bd0d58fd9b06c1c8b07ce8dd186261f5c102d1c56cebff740874e01dc5936ae"}, + {file = "ddtrace-2.14.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:5a67f9e97571de6f942f20d6d2f2882b7f257b182a73837ae9dd2b9e1376882b"}, + {file = "ddtrace-2.14.1-cp37-cp37m-win32.whl", hash = "sha256:0a823207f4b9035cc879d58e9b2121b20d803bf6b5ac1d9359393298625aae10"}, + {file = "ddtrace-2.14.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9c33cae0222ade654a77a371ed00d8f62cf37c556effebe19a4e0bfb036775a4"}, + {file = "ddtrace-2.14.1-cp38-cp38-macosx_12_0_universal2.whl", hash = "sha256:2bf270159b34c665cdfb9aaac1f7f449dae8665006302a82c97960b74d00dadd"}, + {file = "ddtrace-2.14.1-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:177ebdb00433aedeefb827e62b65900b8f80781d4b787cd26d219360cebfc1cc"}, + {file = "ddtrace-2.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a189b7b4645056cca7e60bd7c66bd88d8561a61326214f6ba7b0299c1b192f74"}, + {file = "ddtrace-2.14.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e444b5d398fb93270740ae43e181ba2693529feb0bbef196525cc6a8981cd0b4"}, + {file = "ddtrace-2.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39085a8499dbf078081a0ab48fb9e3912386a99325fa70875c07b93325c8e22e"}, + {file = "ddtrace-2.14.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c60cba86266502635e0078e0017884c2d685381ce4f009884e49a384bbec100b"}, + {file = "ddtrace-2.14.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8a777b6579ca47b7111481d16d1b7fb83ce4356ffc15d3baf38cc5fd28ec1ff0"}, + {file = "ddtrace-2.14.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:8061bad8fc33981c5d1bd424047595016cc1bf08329492852dd737fcd19516c0"}, + {file = "ddtrace-2.14.1-cp38-cp38-win32.whl", hash = "sha256:1cfc9200b68f48eaa1382efcb73a66757d44891d2b35707d92b2787d0a710277"}, + {file = "ddtrace-2.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:9e4ca8d072412d9a1052130cb163f665d01b2314c741bb4809e5bcb1621a9ea3"}, + {file = "ddtrace-2.14.1-cp39-cp39-macosx_12_0_universal2.whl", hash = "sha256:2d5d333050abad107eabf2a322753869e0cda4a7daef58b1704ea19cb7b60649"}, + {file = "ddtrace-2.14.1-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:3dc5731a22a35726c1e32873e86972e0b36ad44bf4d0c848d4ea0970995889bc"}, + {file = "ddtrace-2.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3acb996ea7096f6ceebee9e4c84d61e583c7c3f222de6f2ee55981234d74338"}, + {file = "ddtrace-2.14.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4cbe96ca1985b10e26a920e1a201416fe247f80abb534833a74a43c927c0d69b"}, + {file = "ddtrace-2.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b7f2483b46a973a1b2271ac2dbf537d3d9e1ab1ed529fc1d3a82cc7b2643dd6"}, + {file = "ddtrace-2.14.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:019e0606b2bb38a2d38695165195bf18b23334bd9083a2805bbbec1a48a952d5"}, + {file = "ddtrace-2.14.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:55cbb14cd48548ebbacc6abff1b5a226531bc5a36dd063e235b0da8b544ee04f"}, + {file = "ddtrace-2.14.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:79b01d499a2cf34d8bdf871c82b33d295f4a3d8ab1b25b2e650094d8b0ad7b07"}, + {file = "ddtrace-2.14.1-cp39-cp39-win32.whl", hash = "sha256:55c9a18c8d1443a6ffa788427f6d7450676eb54619631b31f0220fd16351b4c6"}, + {file = "ddtrace-2.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:905c7c84681e6ffd59680a8cb9ac5883699a7c4f3ed00b4c8cc25a8b50a60633"}, + {file = "ddtrace-2.14.1.tar.gz", hash = "sha256:9d7a443824ed84eac2923b8655c45d07aff374088f562dedbb4e7734122bbad5"}, ] [package.dependencies] -attrs = ">=20" bytecode = [ {version = ">=0.13.0", markers = "python_version < \"3.11.0\""}, {version = ">=0.15.0", markers = "python_version >= \"3.12.0\""}, {version = ">=0.14.0", markers = "python_version ~= \"3.11.0\""}, ] -cattrs = "*" -ddsketch = ">=3.0.0" envier = ">=0.5,<1.0" opentelemetry-api = ">=1" protobuf = ">=3" -setuptools = {version = "*", markers = "python_version >= \"3.12\""} -six = ">=1.12.0" typing-extensions = "*" +wrapt = ">=1" xmltodict = ">=0.12" [package.extras] @@ -376,7 +311,7 @@ mypy = ["mypy"] name = "exceptiongroup" version = "1.2.2" description = "Backport of PEP 654 (exception groups)" -optional = false +optional = true python-versions = ">=3.7" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, @@ -404,24 +339,27 @@ pyflakes = ">=2.5.0,<2.6.0" [[package]] name = "idna" -version = "3.7" +version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.5" +python-versions = ">=3.6" files = [ - {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, - {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, ] +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + [[package]] name = "importlib-metadata" -version = "8.0.0" +version = "8.4.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-8.0.0-py3-none-any.whl", hash = "sha256:15584cf2b1bf449d98ff8a6ff1abef57bf20f3ac6454f431736cd3e660921b2f"}, - {file = "importlib_metadata-8.0.0.tar.gz", hash = "sha256:188bd24e4c346d3f0a933f275c2fec67050326a856b9a359881d7c2a697e8812"}, + {file = "importlib_metadata-8.4.0-py3-none-any.whl", hash = "sha256:66f342cc6ac9818fc6ff340576acd24d65ba0b3efabb2b4ac08b598965a4a2f1"}, + {file = "importlib_metadata-8.4.0.tar.gz", hash = "sha256:9a547d3bc3608b025f93d403fdd1aae741c24fbb8314df4b155675742ce303c5"}, ] [package.dependencies] @@ -467,18 +405,18 @@ files = [ [[package]] name = "opentelemetry-api" -version = "1.26.0" +version = "1.27.0" description = "OpenTelemetry Python API" optional = false python-versions = ">=3.8" files = [ - {file = "opentelemetry_api-1.26.0-py3-none-any.whl", hash = "sha256:7d7ea33adf2ceda2dd680b18b1677e4152000b37ca76e679da71ff103b943064"}, - {file = "opentelemetry_api-1.26.0.tar.gz", hash = "sha256:2bd639e4bed5b18486fef0b5a520aaffde5a18fc225e808a1ac4df363f43a1ce"}, + {file = "opentelemetry_api-1.27.0-py3-none-any.whl", hash = "sha256:953d5871815e7c30c81b56d910c707588000fff7a3ca1c73e6531911d53065e7"}, + {file = "opentelemetry_api-1.27.0.tar.gz", hash = "sha256:ed673583eaa5f81b5ce5e86ef7cdaf622f88ef65f0b9aab40b843dcae5bef342"}, ] [package.dependencies] deprecated = ">=1.2.6" -importlib-metadata = ">=6.0,<=8.0.0" +importlib-metadata = ">=6.0,<=8.4.0" [[package]] name = "packaging" @@ -508,22 +446,22 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "protobuf" -version = "5.27.3" +version = "5.28.2" description = "" optional = false python-versions = ">=3.8" files = [ - {file = "protobuf-5.27.3-cp310-abi3-win32.whl", hash = "sha256:dcb307cd4ef8fec0cf52cb9105a03d06fbb5275ce6d84a6ae33bc6cf84e0a07b"}, - {file = "protobuf-5.27.3-cp310-abi3-win_amd64.whl", hash = "sha256:16ddf3f8c6c41e1e803da7abea17b1793a97ef079a912e42351eabb19b2cffe7"}, - {file = "protobuf-5.27.3-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:68248c60d53f6168f565a8c76dc58ba4fa2ade31c2d1ebdae6d80f969cdc2d4f"}, - {file = "protobuf-5.27.3-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:b8a994fb3d1c11156e7d1e427186662b64694a62b55936b2b9348f0a7c6625ce"}, - {file = "protobuf-5.27.3-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:a55c48f2a2092d8e213bd143474df33a6ae751b781dd1d1f4d953c128a415b25"}, - {file = "protobuf-5.27.3-cp38-cp38-win32.whl", hash = "sha256:043853dcb55cc262bf2e116215ad43fa0859caab79bb0b2d31b708f128ece035"}, - {file = "protobuf-5.27.3-cp38-cp38-win_amd64.whl", hash = "sha256:c2a105c24f08b1e53d6c7ffe69cb09d0031512f0b72f812dd4005b8112dbe91e"}, - {file = "protobuf-5.27.3-cp39-cp39-win32.whl", hash = "sha256:c84eee2c71ed83704f1afbf1a85c3171eab0fd1ade3b399b3fad0884cbcca8bf"}, - {file = "protobuf-5.27.3-cp39-cp39-win_amd64.whl", hash = "sha256:af7c0b7cfbbb649ad26132e53faa348580f844d9ca46fd3ec7ca48a1ea5db8a1"}, - {file = "protobuf-5.27.3-py3-none-any.whl", hash = "sha256:8572c6533e544ebf6899c360e91d6bcbbee2549251643d32c52cf8a5de295ba5"}, - {file = "protobuf-5.27.3.tar.gz", hash = "sha256:82460903e640f2b7e34ee81a947fdaad89de796d324bcbc38ff5430bcdead82c"}, + {file = "protobuf-5.28.2-cp310-abi3-win32.whl", hash = "sha256:eeea10f3dc0ac7e6b4933d32db20662902b4ab81bf28df12218aa389e9c2102d"}, + {file = "protobuf-5.28.2-cp310-abi3-win_amd64.whl", hash = "sha256:2c69461a7fcc8e24be697624c09a839976d82ae75062b11a0972e41fd2cd9132"}, + {file = "protobuf-5.28.2-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:a8b9403fc70764b08d2f593ce44f1d2920c5077bf7d311fefec999f8c40f78b7"}, + {file = "protobuf-5.28.2-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:35cfcb15f213449af7ff6198d6eb5f739c37d7e4f1c09b5d0641babf2cc0c68f"}, + {file = "protobuf-5.28.2-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:5e8a95246d581eef20471b5d5ba010d55f66740942b95ba9b872d918c459452f"}, + {file = "protobuf-5.28.2-cp38-cp38-win32.whl", hash = "sha256:87317e9bcda04a32f2ee82089a204d3a2f0d3c8aeed16568c7daf4756e4f1fe0"}, + {file = "protobuf-5.28.2-cp38-cp38-win_amd64.whl", hash = "sha256:c0ea0123dac3399a2eeb1a1443d82b7afc9ff40241433296769f7da42d142ec3"}, + {file = "protobuf-5.28.2-cp39-cp39-win32.whl", hash = "sha256:ca53faf29896c526863366a52a8f4d88e69cd04ec9571ed6082fa117fac3ab36"}, + {file = "protobuf-5.28.2-cp39-cp39-win_amd64.whl", hash = "sha256:8ddc60bf374785fb7cb12510b267f59067fa10087325b8e1855b898a0d81d276"}, + {file = "protobuf-5.28.2-py3-none-any.whl", hash = "sha256:52235802093bd8a2811abbe8bf0ab9c5f54cca0a751fdd3f6ac2a21438bffece"}, + {file = "protobuf-5.28.2.tar.gz", hash = "sha256:59379674ff119717404f7454647913787034f03fe7049cbef1d74a97bb4593f0"}, ] [[package]] @@ -561,13 +499,13 @@ files = [ [[package]] name = "pytest" -version = "8.3.2" +version = "8.3.3" description = "pytest: simple powerful testing with Python" optional = true python-versions = ">=3.8" files = [ - {file = "pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5"}, - {file = "pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce"}, + {file = "pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2"}, + {file = "pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181"}, ] [package.dependencies] @@ -653,27 +591,11 @@ botocore = ">=1.33.2,<2.0a.0" [package.extras] crt = ["botocore[crt] (>=1.33.2,<2.0a.0)"] -[[package]] -name = "setuptools" -version = "72.1.0" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "setuptools-72.1.0-py3-none-any.whl", hash = "sha256:5a03e1860cf56bb6ef48ce186b0e557fdba433237481a9a625176c2831be15d1"}, - {file = "setuptools-72.1.0.tar.gz", hash = "sha256:8d243eff56d095e5817f796ede6ae32941278f542e0f941867cc05ae52b162ec"}, -] - -[package.extras] -core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "ordered-set (>=3.1.1)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" -optional = false +optional = true python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, @@ -682,13 +604,13 @@ files = [ [[package]] name = "tomli" -version = "2.0.1" +version = "2.0.2" description = "A lil' TOML parser" optional = true -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, + {file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"}, + {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, ] [[package]] @@ -791,13 +713,13 @@ files = [ [[package]] name = "urllib3" -version = "1.26.19" +version = "1.26.20" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ - {file = "urllib3-1.26.19-py2.py3-none-any.whl", hash = "sha256:37a0344459b199fce0e80b0d3569837ec6b6937435c5244e7fd73fa6006830f3"}, - {file = "urllib3-1.26.19.tar.gz", hash = "sha256:3e3d753a8618b86d7de333b4223005f68720bcd6a7d2bcb9fbd2229ec7c1e429"}, + {file = "urllib3-1.26.20-py2.py3-none-any.whl", hash = "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e"}, + {file = "urllib3-1.26.20.tar.gz", hash = "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32"}, ] [package.extras] @@ -807,13 +729,13 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "urllib3" -version = "2.2.2" +version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, - {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, + {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, + {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.extras] @@ -914,18 +836,22 @@ files = [ [[package]] name = "zipp" -version = "3.19.2" +version = "3.20.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.19.2-py3-none-any.whl", hash = "sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c"}, - {file = "zipp-3.19.2.tar.gz", hash = "sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19"}, + {file = "zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350"}, + {file = "zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29"}, ] [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] +type = ["pytest-mypy"] [extras] dev = ["boto3", "flake8", "pytest", "pytest-benchmark", "requests"] @@ -933,4 +859,4 @@ dev = ["boto3", "flake8", "pytest", "pytest-benchmark", "requests"] [metadata] lock-version = "2.0" python-versions = ">=3.8.0,<4" -content-hash = "bf1aca9cf4f75b18197105ef45c4ef035790dbe8ad10598becad6f31340c4442" +content-hash = "46554f78374b2b0f1d4ea85f984b2a35ffe481f981c360c2f16d534d6c9eb660" diff --git a/pyproject.toml b/pyproject.toml index db2bd0a8..396b731e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "datadog_lambda" -version = "6.98.0" +version = "6.99.0" description = "The Datadog AWS Lambda Library" authors = ["Datadog, Inc. "] license = "Apache-2.0" @@ -27,7 +27,7 @@ classifiers = [ python = ">=3.8.0,<4" datadog = ">=0.41.0,<1.0.0" wrapt = "^1.11.2" -ddtrace = ">=2.10.0" +ddtrace = ">=2.14.1" ujson = ">=5.9.0" boto3 = { version = "^1.34.0", optional = true } requests = { version ="^2.22.0", optional = true } diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index cc36698b..5e8c5f67 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -2,9 +2,9 @@ # Usage - run commands from repo root: # To check if new changes to the layer cause changes to any snapshots: -# BUILD_LAYERS=true DD_API_KEY=XXXX aws-vault exec sso-serverless-sandbox-account-admin -- ./scripts/run_integration_tests +# BUILD_LAYERS=true DD_API_KEY=XXXX aws-vault exec sso-serverless-sandbox-account-admin -- ./scripts/run_integration_tests.sh # To regenerate snapshots: -# UPDATE_SNAPSHOTS=true DD_API_KEY=XXXX aws-vault exec sso-serverless-sandbox-account-admin -- ./scripts/run_integration_tests +# UPDATE_SNAPSHOTS=true DD_API_KEY=XXXX aws-vault exec sso-serverless-sandbox-account-admin -- ./scripts/run_integration_tests.sh set -e diff --git a/tests/test_metric.py b/tests/test_metric.py index 10ef9191..241f563b 100644 --- a/tests/test_metric.py +++ b/tests/test_metric.py @@ -7,7 +7,7 @@ from datadog.api.exceptions import ClientError from datetime import datetime, timedelta -from datadog_lambda.metric import lambda_metric +from datadog_lambda.metric import lambda_metric, flush_stats from datadog_lambda.api import decrypt_kms_api_key, KMS_ENCRYPTION_CONTEXT_KEY from datadog_lambda.thread_stats_writer import ThreadStatsWriter from datadog_lambda.tags import dd_lambda_layer_tag @@ -101,6 +101,10 @@ def setUp(self): self.mock_threadstats_flush_distributions = patcher.start() self.addCleanup(patcher.stop) + patcher = patch("datadog_lambda.metric.extension_thread_stats") + self.mock_extension_thread_stats = patcher.start() + self.addCleanup(patcher.stop) + def test_retry_on_remote_disconnected(self): # Raise the RemoteDisconnected error lambda_stats = ThreadStatsWriter(True) @@ -123,6 +127,10 @@ def test_flush_stats_with_tags(self): for tag in tags: self.assertTrue(tag in lambda_stats.thread_stats.constant_tags) + def test_flush_stats_without_context(self): + flush_stats(lambda_context=None) + self.mock_extension_thread_stats.flush.assert_called_with(None) + MOCK_FUNCTION_NAME = "myFunction" diff --git a/tests/test_span_pointers.py b/tests/test_span_pointers.py new file mode 100644 index 00000000..f8181d44 --- /dev/null +++ b/tests/test_span_pointers.py @@ -0,0 +1,93 @@ +from typing import List +from typing import NamedTuple + +from ddtrace._trace._span_pointer import _SpanPointerDirection +from ddtrace._trace._span_pointer import _SpanPointerDescription +from datadog_lambda.trigger import _EventSource +from datadog_lambda.trigger import EventTypes +from datadog_lambda.span_pointers import calculate_span_pointers +import pytest + + +class TestCalculateSpanPointers: + class SpanPointersCase(NamedTuple): + name: str + event_source: _EventSource + event: dict + span_pointers: List[_SpanPointerDescription] + + @pytest.mark.parametrize( + "test_case", + [ + SpanPointersCase( + name="some unsupported event", + event_source=_EventSource(EventTypes.UNKNOWN), + event={}, + span_pointers=[], + ), + SpanPointersCase( + name="empty s3 event", + event_source=_EventSource(EventTypes.S3), + event={}, + span_pointers=[], + ), + SpanPointersCase( + name="sensible s3 event", + event_source=_EventSource(EventTypes.S3), + event={ + "Records": [ + { + "eventName": "ObjectCreated:Put", + "s3": { + "bucket": { + "name": "mybucket", + }, + "object": { + "key": "mykey", + "eTag": "123abc", + }, + }, + }, + ], + }, + span_pointers=[ + _SpanPointerDescription( + pointer_kind="aws.s3.object", + pointer_direction=_SpanPointerDirection.UPSTREAM, + pointer_hash="8d49f5b0b742484159d4cd572bae1ce5", + extra_attributes={}, + ), + ], + ), + SpanPointersCase( + name="malformed s3 event", + event_source=_EventSource(EventTypes.S3), + event={ + "Records": [ + { + "eventName": "ObjectCreated:Put", + "s3": { + "bucket": { + "name": "mybucket", + }, + "object": { + "key": "mykey", + # missing eTag + }, + }, + }, + ], + }, + span_pointers=[], + ), + ], + ids=lambda test_case: test_case.name, + ) + def test_calculate_span_pointers(self, test_case: SpanPointersCase): + assert ( + calculate_span_pointers( + test_case.event_source, + test_case.event, + ) + == test_case.span_pointers + ) diff --git a/tests/test_tracing.py b/tests/test_tracing.py index b94e968f..0fb2ee31 100644 --- a/tests/test_tracing.py +++ b/tests/test_tracing.py @@ -12,6 +12,9 @@ from ddtrace import tracer from ddtrace.context import Context +from ddtrace._trace._span_pointer import _SpanPointer +from ddtrace._trace._span_pointer import _SpanPointerDirection +from ddtrace._trace._span_pointer import _SpanPointerDescription from datadog_lambda.constants import ( SamplingPriority, @@ -40,6 +43,7 @@ service_mapping as global_service_mapping, propagator, emit_telemetry_on_exception_outside_of_handler, + is_legacy_lambda_step_function, ) from datadog_lambda.trigger import EventTypes @@ -647,6 +651,33 @@ def test_step_function_trace_data(self): expected_context, ) + def test_is_legacy_lambda_step_function(self): + sf_event = { + "Payload": { + "Execution": { + "Id": "665c417c-1237-4742-aaca-8b3becbb9e75", + }, + "StateMachine": {}, + "State": { + "Name": "my-awesome-state", + "EnteredTime": "Mon Nov 13 12:43:33 PST 2023", + }, + } + } + self.assertTrue(is_legacy_lambda_step_function(sf_event)) + + sf_event = { + "Execution": { + "Id": "665c417c-1237-4742-aaca-8b3becbb9e75", + }, + "StateMachine": {}, + "State": { + "Name": "my-awesome-state", + "EnteredTime": "Mon Nov 13 12:43:33 PST 2023", + }, + } + self.assertFalse(is_legacy_lambda_step_function(sf_event)) + class TestXRayContextConversion(unittest.TestCase): def test_convert_xray_trace_id(self): @@ -718,12 +749,20 @@ class TestFunctionSpanTags(unittest.TestCase): def test_function(self): ctx = get_mock_context() span = create_function_execution_span( - ctx, "", False, False, {"source": ""}, False, {} + context=ctx, + function_name="", + is_cold_start=False, + is_proactive_init=False, + trace_context_source={"source": ""}, + merge_xray_traces=False, + trigger_tags={}, + span_pointers=None, ) self.assertEqual(span.get_tag("function_arn"), function_arn) self.assertEqual(span.get_tag("function_version"), "$LATEST") self.assertEqual(span.get_tag("resource_names"), "Function") self.assertEqual(span.get_tag("functionname"), "function") + self.assertEqual(span._links, []) def test_function_with_version(self): function_version = "1" @@ -731,7 +770,13 @@ def test_function_with_version(self): invoked_function_arn=function_arn + ":" + function_version ) span = create_function_execution_span( - ctx, "", False, False, {"source": ""}, False, {} + context=ctx, + function_name="", + is_cold_start=False, + is_proactive_init=False, + trace_context_source={"source": ""}, + merge_xray_traces=False, + trigger_tags={}, ) self.assertEqual(span.get_tag("function_arn"), function_arn) self.assertEqual(span.get_tag("function_version"), function_version) @@ -742,7 +787,13 @@ def test_function_with_alias(self): function_alias = "alias" ctx = get_mock_context(invoked_function_arn=function_arn + ":" + function_alias) span = create_function_execution_span( - ctx, "", False, False, {"source": ""}, False, {} + context=ctx, + function_name="", + is_cold_start=False, + is_proactive_init=False, + trace_context_source={"source": ""}, + merge_xray_traces=False, + trigger_tags={}, ) self.assertEqual(span.get_tag("function_arn"), function_arn) self.assertEqual(span.get_tag("function_version"), function_alias) @@ -752,13 +803,13 @@ def test_function_with_alias(self): def test_function_with_trigger_tags(self): ctx = get_mock_context() span = create_function_execution_span( - ctx, - "", - False, - False, - {"source": ""}, - False, - {"function_trigger.event_source": "cloudwatch-logs"}, + context=ctx, + function_name="", + is_cold_start=False, + is_proactive_init=False, + trace_context_source={"source": ""}, + merge_xray_traces=False, + trigger_tags={"function_trigger.event_source": "cloudwatch-logs"}, ) self.assertEqual(span.get_tag("function_arn"), function_arn) self.assertEqual(span.get_tag("resource_names"), "Function") @@ -767,6 +818,49 @@ def test_function_with_trigger_tags(self): span.get_tag("function_trigger.event_source"), "cloudwatch-logs" ) + def test_function_with_span_pointers(self): + ctx = get_mock_context() + span = create_function_execution_span( + context=ctx, + function_name="", + is_cold_start=False, + is_proactive_init=False, + trace_context_source={"source": ""}, + merge_xray_traces=False, + trigger_tags={}, + span_pointers=[ + _SpanPointerDescription( + pointer_kind="some.kind", + pointer_direction=_SpanPointerDirection.UPSTREAM, + pointer_hash="some.hash", + extra_attributes={}, + ), + _SpanPointerDescription( + pointer_kind="other.kind", + pointer_direction=_SpanPointerDirection.DOWNSTREAM, + pointer_hash="other.hash", + extra_attributes={"extra": "stuff"}, + ), + ], + ) + self.assertEqual( + span._links, + [ + _SpanPointer( + pointer_kind="some.kind", + pointer_direction=_SpanPointerDirection.UPSTREAM, + pointer_hash="some.hash", + extra_attributes={}, + ), + _SpanPointer( + pointer_kind="other.kind", + pointer_direction=_SpanPointerDirection.DOWNSTREAM, + pointer_hash="other.hash", + extra_attributes={"extra": "stuff"}, + ), + ], + ) + class TestSetTraceRootSpan(unittest.TestCase): def setUp(self):