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 2a696046..0aded4de 100644 --- a/datadog_lambda/tracing.py +++ b/datadog_lambda/tracing.py @@ -1259,6 +1259,7 @@ def create_function_execution_span( merge_xray_traces, trigger_tags, parent_span=None, + span_pointers=None, ): tags = None if context: @@ -1296,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/wrapper.py b/datadog_lambda/wrapper.py index e97c0ebe..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, @@ -307,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..dcac5c82 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.28" 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.28-py3-none-any.whl", hash = "sha256:dc088b86a14f17d3cd2e96915c6ccfd31bce640dfe9180df579ed311bc6bf0fc"}, + {file = "boto3-1.35.28.tar.gz", hash = "sha256:8960fc458b9ba3c8a9890a607c31cee375db821f39aefaec9ff638248e81644a"}, ] [package.dependencies] -botocore = ">=1.34.156,<1.35.0" +botocore = ">=1.35.28,<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.28" 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.28-py3-none-any.whl", hash = "sha256:b66c78f3d6379bd16f0362f07168fa7699cdda3921fc880047192d96f2c8c527"}, + {file = "botocore-1.35.28.tar.gz", hash = "sha256:115d13f2172d8e9fa92e8d913f0e80092b97624d190f46772ed2930d4a355d55"}, ] [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.0" 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.0-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:c55bf165b923a12a1386fbf951735a4b8335a0cfa1558833d2b78abdd289c783"}, + {file = "ddtrace-2.14.0-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:b6abaec1263e0ed19fe48d068e02907b7cc6bd312049c4d562f3fe80fcb9e8e5"}, + {file = "ddtrace-2.14.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:84aff2e9a98172c44b187616838705c7abd4c6e2122e595eb324ba0f269cc7cf"}, + {file = "ddtrace-2.14.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82c5147d9b27604ac642de32e05fc2d5bac76b15a9ad98b530a585fed347ca86"}, + {file = "ddtrace-2.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cfb54abfb7b1b1c33a794d926df76e8161bd284a3b15ad55d13290c41b734e95"}, + {file = "ddtrace-2.14.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e89d31f3871bee63322dc5d0168d57cfb07ff2581e240510f7103a27e5608046"}, + {file = "ddtrace-2.14.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:75ce4fce7be384bdaae2a4d8600104397352ca71afea6a37a3243f6013031f5d"}, + {file = "ddtrace-2.14.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:81c093b8ad180ce55aec1e6d257de9729a2a2c09dec0fcddc2e7aaede102c32c"}, + {file = "ddtrace-2.14.0-cp310-cp310-win32.whl", hash = "sha256:b22e13c25af867d92c3b5898e3c01c7dc05ec2ec9975ee54f1ed1ed7ac05969a"}, + {file = "ddtrace-2.14.0-cp310-cp310-win_amd64.whl", hash = "sha256:d0faab57ee36e054d01fe0684418f20235532411fe470837cce91b60c8aa48a7"}, + {file = "ddtrace-2.14.0-cp311-cp311-macosx_12_0_universal2.whl", hash = "sha256:1f28dbfc35e8e4b3885d55552ef85aa49f66d64291df6212dae878eb057e92e7"}, + {file = "ddtrace-2.14.0-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:80cf740482b6f1c65c394e54a6ed269785bfb6319bcd51b91275d671a0d3d2b2"}, + {file = "ddtrace-2.14.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f0d07c561238baa8d1d667f315409b9f74a64e77cc2bbad416df6c08d3e9e86"}, + {file = "ddtrace-2.14.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bbf1c209f5c9b5b505524fe0c5cb3a0f19ece72680d090240af30a6e5172ae23"}, + {file = "ddtrace-2.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03d7883787db4cd302ebcf6121421d38f3022d98cd04e57473953f0e320f8f4c"}, + {file = "ddtrace-2.14.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8cbe7b8848c46e5d7c2efaa4428ea5be9fda699bd69d1d271a8fe805b5554246"}, + {file = "ddtrace-2.14.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2286245dc4bfee011851d7e96d4cf15ec59260b54693cae7ffd688ba6d5562a7"}, + {file = "ddtrace-2.14.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:49214fbfb675f69369339389eea5f399706e9df222b5aba0d92f84f078918074"}, + {file = "ddtrace-2.14.0-cp311-cp311-win32.whl", hash = "sha256:f8900a124e56e2232c5a34624b45ce7d8e1bba9cad214f2d16dc73a64b30ce09"}, + {file = "ddtrace-2.14.0-cp311-cp311-win_amd64.whl", hash = "sha256:5f4d340f8c438f6ceb510b4f1fa1a22db14b536420acf8f9d68d5acd95d2e543"}, + {file = "ddtrace-2.14.0-cp312-cp312-macosx_12_0_universal2.whl", hash = "sha256:567cb2254abd0e1e36251ed5a8395c6da6a7f808a854a9fe69ff5a410ab0e586"}, + {file = "ddtrace-2.14.0-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:3737025a28090e48eb8c087608b5620056c2b63460889028723bb4918e663293"}, + {file = "ddtrace-2.14.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef5f8a4bbe25c9d175c4cf239d63b48a7d26c9ad190b52ac3c27494ff78fc048"}, + {file = "ddtrace-2.14.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d6581d6684afa3d8661e6aff4771edc2b87fcc19628bc0e72724b794a551d3d"}, + {file = "ddtrace-2.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3c3d834e7e0175c51c2a0fe37ef0bba7f80a00915c000826550ea94e570e5b0"}, + {file = "ddtrace-2.14.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:5843b6cc83395979f3a17ecb14e14a446795bac64cb4e05bc6eff30be55d014a"}, + {file = "ddtrace-2.14.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0209386ee86c95a1ceb245539f81746d4986110c6c974ce1152afbb114531b9a"}, + {file = "ddtrace-2.14.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:2f1d475562ca82ed79616614a1f11880e580920566fd5ba35b777d738f93affb"}, + {file = "ddtrace-2.14.0-cp312-cp312-win32.whl", hash = "sha256:83f63720fe40d930b614137d45dc1df5942a440779478f1a192c05ab20fbbbac"}, + {file = "ddtrace-2.14.0-cp312-cp312-win_amd64.whl", hash = "sha256:0f8bf0a20e9a9094262c59f7237a743cf5aefd20dc29722912a4782e09b2ce1f"}, + {file = "ddtrace-2.14.0-cp37-cp37m-macosx_12_0_x86_64.whl", hash = "sha256:d7006a90a2200e0692d0c307147020365f244f2043e994aeac9d1c3476d5056f"}, + {file = "ddtrace-2.14.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a375825022164fab9230b5d51662503953c3d3ef4ae0928f72d3429b8d82067a"}, + {file = "ddtrace-2.14.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:088f0e67af81096594065327a98058e4b3555a37458214289ddafe0636b752bb"}, + {file = "ddtrace-2.14.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ffa219e3fa22403e615be2e0669cc1d1d2ca1afa6ef141079ae5e6973306181"}, + {file = "ddtrace-2.14.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:3cd1ffa14bcfc66f3cee0d191ca4681fae602334d9a8044bd5a73b2fc4693454"}, + {file = "ddtrace-2.14.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:7c111498a85693c31ff3e9bd43994ce6734ab960057b36b87e7cbb14e4e90df0"}, + {file = "ddtrace-2.14.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:4ea1f947b128075c42f1df90f447172a07775cb6c2701698ceaad671dfc71bc7"}, + {file = "ddtrace-2.14.0-cp37-cp37m-win32.whl", hash = "sha256:de373d0e7cb0a37ee9ff452f344dcca2d525f3d3ec500f175237456d78472d20"}, + {file = "ddtrace-2.14.0-cp37-cp37m-win_amd64.whl", hash = "sha256:a9880134d03f732503d46b2f75e3febea817827b7d025b7a963bc4d0db892edd"}, + {file = "ddtrace-2.14.0-cp38-cp38-macosx_12_0_universal2.whl", hash = "sha256:8a02903585ae581a3b40ad01e062535d8affb3968a408fd96eb48f70615381a4"}, + {file = "ddtrace-2.14.0-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:b8a1fba689370e5fe956dab6e48f67cb37679fcd26d09fa402f8f4a99472140a"}, + {file = "ddtrace-2.14.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:073b5cf02bc9302c8132f9ff9db000448a3fd7ba3c3139fc1fb92cd3207d6d96"}, + {file = "ddtrace-2.14.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:86bf04c50fa5ae351c50e716befc5f114993936c18a553d4e177c6272f9df3a4"}, + {file = "ddtrace-2.14.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2dd8d22e61261a04849e89590f4aa81c8a39bd2b7355babf77213fe8c94608bd"}, + {file = "ddtrace-2.14.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6bb4f00aef805d4e21b16c288823a158f203728e4855f7c8eb7e527c8e49c5c1"}, + {file = "ddtrace-2.14.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:a15180012c57b60469a65be8b6c1f7bdf9372a51b8e8e4de622802f13d770ed1"}, + {file = "ddtrace-2.14.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:206a01ae3986e09777f0d3d1dc65f1a39d29a77194af07467f3cc9679a60373c"}, + {file = "ddtrace-2.14.0-cp38-cp38-win32.whl", hash = "sha256:852ca5bb6b5c5bdf8accaf45fda78171d0deecf378ac1efddf69e0f098196807"}, + {file = "ddtrace-2.14.0-cp38-cp38-win_amd64.whl", hash = "sha256:7ba1c9de72e059db44b018743c1abee9c4e50f8538567359312595554d3a427e"}, + {file = "ddtrace-2.14.0-cp39-cp39-macosx_12_0_universal2.whl", hash = "sha256:a426098d703548802f8d80a76e7740d42b40061493e82b9ab055154dd9837c8f"}, + {file = "ddtrace-2.14.0-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:5e72740fcdab45ed919b130f6ae2e5a26c6aaa7a13be94673dee0bce11a561a6"}, + {file = "ddtrace-2.14.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70b5c386ff3c5b76ad96812fdaf4206660efd51e5ebe98ec46e4eaf8bae5440c"}, + {file = "ddtrace-2.14.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b262463a46fa178d0257798b84439810dac5de8e81ffc7f6c14350b5a1b9be3e"}, + {file = "ddtrace-2.14.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cf628b5588ea8b14e4bbd0187b7adc7c1fc493bd98df354e9f1da5bd8e8b4e15"}, + {file = "ddtrace-2.14.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:2256ab35a9fc9190fe14bb2af95b769e6c08f872efbeb4ae3ffd7e1ce0a2c650"}, + {file = "ddtrace-2.14.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:77b73b0878ddfa1a91f74c03b2b9b739fb296b9624ccfe743525d8190e434a6d"}, + {file = "ddtrace-2.14.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5c3a34ddc9b8f63d46e32e2b9d52f5ab23e373ae90395f09aef60edb0e6238cb"}, + {file = "ddtrace-2.14.0-cp39-cp39-win32.whl", hash = "sha256:8a3f5facc044e016ff0529b44ba16d54e56868eb48c6249c03e15cd9407562e5"}, + {file = "ddtrace-2.14.0-cp39-cp39-win_amd64.whl", hash = "sha256:e9f48394d2a2d1d2ac48fb955d8637b2dd7b055b9033bd686008c12d41b37552"}, + {file = "ddtrace-2.14.0.tar.gz", hash = "sha256:fb8e851164a4b1f64002d1f76b720281d5cf63eb904f1d04a36bf3c4955b6693"}, ] [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"}, @@ -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 = "a6aec85347838ba30c70f912ff0d9de03f3089cb658024c1f8d3214baaead760" diff --git a/pyproject.toml b/pyproject.toml index db2bd0a8..d74fd9fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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.0" 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_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 b21b9337..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, @@ -746,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" @@ -759,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) @@ -770,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) @@ -780,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") @@ -795,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):