diff --git a/django_app/poetry.lock b/django_app/poetry.lock index c6bec269e..2d6cf3fcf 100644 --- a/django_app/poetry.lock +++ b/django_app/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.3.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "accelerate" @@ -2047,65 +2047,69 @@ error-tracking = ["ddtrace (>=3,<5)"] [[package]] name = "ddtrace" -version = "4.10.3" +version = "4.11.0" description = "Datadog APM client library" optional = false python-versions = "<3.15,>=3.9" groups = ["main"] files = [ - {file = "ddtrace-4.10.3-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:2971c585ee6022310847e32dbbcf667ea6a83a9ea83150afda4be27f87a1fb6d"}, - {file = "ddtrace-4.10.3-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:10df59249f876781467f808a998b662b80d817ec236633993dcf0d46b0ebc0b4"}, - {file = "ddtrace-4.10.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:14f92e9412beb08d189b8235dd3c55993b092f1d9d286da664c777dceba51c88"}, - {file = "ddtrace-4.10.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3565355b65c8452956f0552be6edd9385087ac72de3585a9f6c0a2a2c38425cb"}, - {file = "ddtrace-4.10.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5d2722a67e5e76178748a9b0b372b41ff93dfd93fa3d450eee06f0d49dffd984"}, - {file = "ddtrace-4.10.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5095b3049b46d65c7e22c89e83554483617d4c8e4658742dc3375158d54c8278"}, - {file = "ddtrace-4.10.3-cp310-cp310-win32.whl", hash = "sha256:670dfa84819b3f01143899d7478e1e2109ad9cd084d65a9610bc08c479ebb19a"}, - {file = "ddtrace-4.10.3-cp310-cp310-win_amd64.whl", hash = "sha256:023f37709e1eab772d52669481f01391e3238095b9ef9f78816be6b7bd5c0c8a"}, - {file = "ddtrace-4.10.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:ba6083760b7900b9bc88dd09e406ee4cbeff7f52bc0c00d3b794dc1836c7282e"}, - {file = "ddtrace-4.10.3-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:4f42ab64ed9f6ff1df25db94cd9e6eee25f312f7b79af2905a0971dbf6375280"}, - {file = "ddtrace-4.10.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6c2c73cce18448cae791124d383d12d656e087b581c5fa36434956c2cf15f38f"}, - {file = "ddtrace-4.10.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:05351f343468a01e9eb971e3674e551b455326199907708aee2e5448f97a9b9f"}, - {file = "ddtrace-4.10.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:3551c4341ed175bba352a70e06998946117f1798071e210709a6a9ff6eac3292"}, - {file = "ddtrace-4.10.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:cbce2665483523960ed38eeb256772e805967faae1b5de004437c21d8f4f3120"}, - {file = "ddtrace-4.10.3-cp311-cp311-win32.whl", hash = "sha256:97c3e28c21a361c0d7e9ad11d37fed02a40f5676f049bf03a3f64048a4dc2c03"}, - {file = "ddtrace-4.10.3-cp311-cp311-win_amd64.whl", hash = "sha256:d1ceafdb79425cd59df4f010c88718e700093d2160b5f5db76d56072e73586fa"}, - {file = "ddtrace-4.10.3-cp311-cp311-win_arm64.whl", hash = "sha256:1003cc2df836b89c78b9351fc77888173ba43337d939604f6920d52eebd7649d"}, - {file = "ddtrace-4.10.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:77150793300a9a327cf971ba4178f41b8efcbaba8d1afcd0d78489f832f21a63"}, - {file = "ddtrace-4.10.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:bf91f34000cec828689d72bd458e53ed5ac1dd9799df3c6a71aac06b3321125e"}, - {file = "ddtrace-4.10.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:feacd27427216154b66f73129bc3b8a37fd6bd097aba5ff0ebddc0bb68dc5c65"}, - {file = "ddtrace-4.10.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cc2fef5e8600719ce8f8bc2e0e9385f21a619881a2d8fedbbdd9a7a8ea409974"}, - {file = "ddtrace-4.10.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b223d26026e68a6ba1c728f17d8102b2ad6dea30289c91d84078284f20d11883"}, - {file = "ddtrace-4.10.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1fe973efe7583a616bb607aa7e6ffef521620a03e52d58e4ea8dd6059f4b99b8"}, - {file = "ddtrace-4.10.3-cp312-cp312-win32.whl", hash = "sha256:79aa6cbffc1aae5ad9f3df71b7d5055fd40bf861e6407a1dff5b8629d8db6a59"}, - {file = "ddtrace-4.10.3-cp312-cp312-win_amd64.whl", hash = "sha256:a1a49d145d6119378606d42dcd78b0dd5e7cad12dc7e47f11b27224e4b0d6dc9"}, - {file = "ddtrace-4.10.3-cp312-cp312-win_arm64.whl", hash = "sha256:2dc2a4092e99bdc5ba3a4d9ec3f85cdabc6e0b0d2be240836fec973d838bc4df"}, - {file = "ddtrace-4.10.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:6def32279ea766f790e623c4eb1c057304187a0095710b4390e8bfe92e449d27"}, - {file = "ddtrace-4.10.3-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:8b8e32295382638570ea411d13ff2728fd05a8ac6b38b9f4264e5d55ad132b86"}, - {file = "ddtrace-4.10.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3581b24d8f53e1c1c1e1f81906d253d46d81cd76f7795d2db5189ba174024552"}, - {file = "ddtrace-4.10.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4ba47da0e824b9a47881cc59176e79eceb6d986ba3afb949d585fa3447b809b1"}, - {file = "ddtrace-4.10.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:fb1bd9ee05b502c7767bf8f55f8e49dfe24b5fee04bf789df377c3bc77b02650"}, - {file = "ddtrace-4.10.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d4d9c60eec7593d07705aaa7238148399c15483d0f61dac3934d9ddfddbc2c1d"}, - {file = "ddtrace-4.10.3-cp313-cp313-win32.whl", hash = "sha256:c7e548568a60b5ec8cb3dd520fb0ead49ec0dbd0124b79e8e97f430a69a47a70"}, - {file = "ddtrace-4.10.3-cp313-cp313-win_amd64.whl", hash = "sha256:fbe41cdf3c2aec5d042a3da204c6aa62d6f2e6acb88d24bf6b845d342e8d84cf"}, - {file = "ddtrace-4.10.3-cp313-cp313-win_arm64.whl", hash = "sha256:66cf442e58468606ea2af81dc1e08ec971a031db422d5a798054cba379dd4bdc"}, - {file = "ddtrace-4.10.3-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:fc06adb2de4e9cbcb91a6f22b15f88e3b24aab89bc031ed07341a694b02f1584"}, - {file = "ddtrace-4.10.3-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:bb1dd13a8676af0987b24c21b13acb1b711d04196fd759b5a71d1d56a9048c9f"}, - {file = "ddtrace-4.10.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:95eacdc4c1c35b0b8adbe50061e49f22d94e8be74a1dbc3b701ee61c8f33c86c"}, - {file = "ddtrace-4.10.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:42cc4535fdffa6e9cccd22afd5a5c54b83e456349b03a46aeb3c24ae915c37d3"}, - {file = "ddtrace-4.10.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e989289bfe026d70b98581355620bb1604374b15775c40d7c695d27c303f0b7b"}, - {file = "ddtrace-4.10.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a668874431201a05738e0c94cbe5328518864edd6aeab5ddd13fb5c73323f100"}, - {file = "ddtrace-4.10.3-cp314-cp314-win32.whl", hash = "sha256:03d836ff4ed02e81f2ea6c4277c75b640fe92472e92b01929e2bc073415e0306"}, - {file = "ddtrace-4.10.3-cp314-cp314-win_amd64.whl", hash = "sha256:908e5970674222d8f2c7b10c5ec255ff70d17222d9db73b15f7ba2419f256ef8"}, - {file = "ddtrace-4.10.3-cp314-cp314-win_arm64.whl", hash = "sha256:1137aeaeb999e07583d7d306999afcb48daceab2e608f98936722d733b8ea9e7"}, - {file = "ddtrace-4.10.3-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:347d849888138e50f2bccb7185d9a8504f18e6d4f53b6f027af4695a25a2fd42"}, - {file = "ddtrace-4.10.3-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:7931857d350660899a5ef0831c7ef0192c38943d724b384da73bc78d9948b3f1"}, - {file = "ddtrace-4.10.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2cb2c62f245f5d97936cfac7a4d8860a284dd38e885b2c40e866694083ea9e85"}, - {file = "ddtrace-4.10.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d7992fab1bab2691e69d7dfa0285bd94016d1c43eb031d3f1259ec0135f67d65"}, - {file = "ddtrace-4.10.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f54beef343314c82fea8fa8511f26392ce500a0861f90c93363643dac4376cec"}, - {file = "ddtrace-4.10.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f261888fb2a6403c410a9108451364718303fc3130b13e6a5d77f98451061362"}, - {file = "ddtrace-4.10.3-cp39-cp39-win32.whl", hash = "sha256:ee314640e74de19de87b11cbe911d1f737d7b27685b1d106b55a1504ada0b5a7"}, - {file = "ddtrace-4.10.3-cp39-cp39-win_amd64.whl", hash = "sha256:0aa87dfbd53a0d52c67c9c36ad426a7b359063e73ce3d835e8aaea7c5a5af3f7"}, - {file = "ddtrace-4.10.3.tar.gz", hash = "sha256:12abe3864c7247261ef26bf2ab24e6444e8a280c04de01a36b27c57da1fdb083"}, + {file = "ddtrace-4.11.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:0bc55e48da62b6a287b36e01f5876489023178c09b60e8e01608e2e895ccdc4b"}, + {file = "ddtrace-4.11.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:5df47873c625993e81fabd8f6ae2ab61f66c6805cfd1a8c551a509d5b5d91062"}, + {file = "ddtrace-4.11.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e857428cc86fe541f5b3768d7d8331e2f1cbde1a2492deedff4619109cbfd5fc"}, + {file = "ddtrace-4.11.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fc60575f8f47af58e6523f8a802d1f92a4912aa7d4ba71024958421044cba61a"}, + {file = "ddtrace-4.11.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d65ab60bfb0b2edde6c564bd1f97b99a8ea9bb082c93b265488ba214c606d240"}, + {file = "ddtrace-4.11.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7ebfdee1342b5b1cdad8505e040bbfe5bdf6976e820803eaa4a1814417d6bb0e"}, + {file = "ddtrace-4.11.0-cp310-cp310-win32.whl", hash = "sha256:6247a431ae3a2622a0e835357a644b1bac81719e28f21748fd7d4034c79c3ed7"}, + {file = "ddtrace-4.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:9197110982756a97243906ffce7b98e6007c8258a6bbc22451d7b26e8f1b0103"}, + {file = "ddtrace-4.11.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:b4074e538e708b0e9d7f812be15db306abbe3a6cb70046f9f786d66daa862344"}, + {file = "ddtrace-4.11.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:05f701229233ad8a4ad5d52b8ff2bfd6e2f99601a3bc04367615cd1ce4a01a80"}, + {file = "ddtrace-4.11.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c3a557891e91a443e6a3a9b7c31dc96b9963acada0986dab5a3d65507efa16a1"}, + {file = "ddtrace-4.11.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0328bfeb4a6bdc00168a4184aea670eedc073734f6fbc6ca1abfeb6547415d2"}, + {file = "ddtrace-4.11.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ad6f17111746568a58da89b6db5e5d18eb07db7b8ce3be3396631f37391cff50"}, + {file = "ddtrace-4.11.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:eb30dd327789ec1851bc42194c8db0b93a7ad708c2963d694e3622b684a085f7"}, + {file = "ddtrace-4.11.0-cp311-cp311-win32.whl", hash = "sha256:dfe73130778ca22652ae398fc77de3643d50687deb127bf4cd2566b10778125a"}, + {file = "ddtrace-4.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:1241f38d52b40b516d620ed68ecd04afbc715f2c1c9f3ddae8a7b86ecf848c91"}, + {file = "ddtrace-4.11.0-cp311-cp311-win_arm64.whl", hash = "sha256:3013b67e1a172eb0edd8c37559b81760a9db205a671541925ebd0127f496409b"}, + {file = "ddtrace-4.11.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:d0eadcf7df3143bf0611f09a351040e475b5df7f512410698cd481a076bca056"}, + {file = "ddtrace-4.11.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:57eb0616dc5c8ff04b5c560ba6d3def69d2bc618e69ce65cc015f103fc68649e"}, + {file = "ddtrace-4.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c311109d1e0f3482b7a44126c855eeb796b186f01604ce74c54800aa5892863d"}, + {file = "ddtrace-4.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:695ec915640072e2917b13d317fe1696086a38924ba02cbe1dcb3918ffb0fa65"}, + {file = "ddtrace-4.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:355a288756a7a5d6b73221d28ba4536cb0271d2ea7909adab3e2ee37d62a569f"}, + {file = "ddtrace-4.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2c19888af09f6ad3340f2935ea5c9eb80d9298141e196fd33e544369920aefba"}, + {file = "ddtrace-4.11.0-cp312-cp312-win32.whl", hash = "sha256:cd524b299bd15ed14192cb041a35e992003e0d3a9f8831062f9f28bcfacb63e2"}, + {file = "ddtrace-4.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:af663120d3b4116965bebbd79ce8e73a85644816a0917999e8164b6204678cb6"}, + {file = "ddtrace-4.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:f0b50a1739573318b0a81fb56a8b22ed6ae6dac017b89400cbc76c17b439d9ed"}, + {file = "ddtrace-4.11.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:16b9f06c841858debb3de2c4a7ce6acbd6967eaa6ce264dbd0e2a58e376b8583"}, + {file = "ddtrace-4.11.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:1cb352d7df16b864f258d4602addf23b8d29d2d416ccc1d0af8d88c614f70a01"}, + {file = "ddtrace-4.11.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:54f4cf656aa452bc37b62fa7939c5bddca751ffd4d315b3c925236d4794767ea"}, + {file = "ddtrace-4.11.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:776d99ccb01abecf7dbb4910f4a570b6ab625ed47e00bb6c0159d88d4e2ef1c8"}, + {file = "ddtrace-4.11.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5533ce94e50412565a36ce0c8fc6ff6f7490e69b4ecff10c550482e49d5d065e"}, + {file = "ddtrace-4.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:81d147bd3d6fa067f2c72c7e32aba90d5d61ed379850896f1cc7fd1ea3437bb1"}, + {file = "ddtrace-4.11.0-cp313-cp313-win32.whl", hash = "sha256:bcf1d3ba8c3771b8c75f0b9ecd9038ae0a44c8bb0c01d21458c405a29341518a"}, + {file = "ddtrace-4.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:d465b9f6f049fc32278cbfd74e1e593b0c3460aacb622bef0cee71e50ffc4b05"}, + {file = "ddtrace-4.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:00cc0fbfa6b8741477528c3fe7bc70a4a5ea439221f188e14da6907f03ed0125"}, + {file = "ddtrace-4.11.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:e6f1ca84237e9f52fd71e3458262cfc407dd43337a56e4a6ba9beea88f0958c5"}, + {file = "ddtrace-4.11.0-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:c3ddbf9a5a0cd51b5ab9bca898c85cfce73072054b9f5b577164a95065cb8331"}, + {file = "ddtrace-4.11.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7c435b708f4956208141c22d941ed60a1551813353f6c1cfc1a5283ec3d80cc5"}, + {file = "ddtrace-4.11.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:26b3fd7ee97cf7fa1296eecacd393bbbef343cf8bb2d0b1ee39d40cb1d4818fa"}, + {file = "ddtrace-4.11.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:8d23d66ba9525fd9b9a61c0db8c43e64461066b1d49c75c85f639ea65776367b"}, + {file = "ddtrace-4.11.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:85e081e2295a77c9b38e5792a097f1df8169e1dd9b3339f820d00183e10e8b1b"}, + {file = "ddtrace-4.11.0-cp314-cp314-win32.whl", hash = "sha256:c267fe4efceb71019f5e6833fdb4fbdff18a51641bdca9fceabbe579984461e4"}, + {file = "ddtrace-4.11.0-cp314-cp314-win_amd64.whl", hash = "sha256:3bebf3cb12ac51c422ad1ed74873746b8398cce845075b234115c2f518a7a652"}, + {file = "ddtrace-4.11.0-cp314-cp314-win_arm64.whl", hash = "sha256:f596cb2da582600e091c8174ab4f8e44bf4f05c50c03cc450e0378c516e0c6e3"}, + {file = "ddtrace-4.11.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9d9a7c4644e4ffc858e951eeab37ab86e9b717ef1bc2f2a47de69f1ec373bccb"}, + {file = "ddtrace-4.11.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b49433f0e85e16c34f578e01ec4e263ab5181d9636635add8d6194bd47dd163c"}, + {file = "ddtrace-4.11.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:2affbac04583808cba374976d07e59a4fe156d1de122f8def30550bf7717b745"}, + {file = "ddtrace-4.11.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:51a28ab8072c741e104d8c6f47d990eb5989a359b7ea4d91bab7c5c1f5c1a03c"}, + {file = "ddtrace-4.11.0-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:e4706b45074d80aecd357274f1a8257c73967250e78ac9d46bdc7df6aa78ba86"}, + {file = "ddtrace-4.11.0-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:b5da09a248c712d023dfffb085b3f62ecefd1a1d5d1ee4ba1da6852879bea771"}, + {file = "ddtrace-4.11.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:019071f74b30507c82c8acba03ba24fe5338d0b51de561640379d8de9689d247"}, + {file = "ddtrace-4.11.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7c5de4a48d9304cc171171c032c5f0a472f1cd498b22f4e3563738e053c91585"}, + {file = "ddtrace-4.11.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7707a9fcccc2d99e90e27788a494b4603d9d99551c2fdc1aa41dd453ee913d77"}, + {file = "ddtrace-4.11.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:792670a1a7d6ec35321cc46fa4a7ca97464cecfc54d075ed6f629d90af1f6567"}, + {file = "ddtrace-4.11.0-cp39-cp39-win32.whl", hash = "sha256:27ffca4b2555dff543f3fe2df88ef70492cb6dc1df523550803e3f3175bc7277"}, + {file = "ddtrace-4.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:73b128817039e626f557b4c035d9756209ba90a9a14595b13596f7100810fe86"}, + {file = "ddtrace-4.11.0.tar.gz", hash = "sha256:260c5b46e80565f4fd08cec2650f707627fb57cd6f8951a2d8c9e6a02b490074"}, ] [package.dependencies] @@ -3478,7 +3482,7 @@ files = [ [package.dependencies] googleapis-common-protos = ">=1.5.5" grpcio = ">=1.71.2" -protobuf = ">=5.26.1,<6.0.dev0" +protobuf = ">=5.26.1,<6.0dev" [[package]] name = "h11" @@ -4005,7 +4009,7 @@ files = [ [package.dependencies] attrs = ">=22.2.0" -jsonschema-specifications = ">=2023.3.6" +jsonschema-specifications = ">=2023.03.6" referencing = ">=0.28.4" rpds-py = ">=0.25.0" @@ -6031,7 +6035,7 @@ files = [ ] [package.dependencies] -certifi = ">=2024.7.4" +certifi = ">=2024.07.04" Events = "*" python-dateutil = "*" requests = ">=2.32.0,<3.0.0" @@ -8616,10 +8620,10 @@ files = [ ] [package.dependencies] -botocore = ">=1.37.4,<2.0a0" +botocore = ">=1.37.4,<2.0a.0" [package.extras] -crt = ["botocore[crt] (>=1.37.4,<2.0a0)"] +crt = ["botocore[crt] (>=1.37.4,<2.0a.0)"] [[package]] name = "safetensors" @@ -11460,9 +11464,9 @@ files = [ ] [package.extras] -cffi = ["cffi (>=1.17,<2.0) ; platform_python_implementation != \"PyPy\" and python_version < \"3.14\"", "cffi (>=2.0.0b0) ; platform_python_implementation != \"PyPy\" and python_version >= \"3.14\""] +cffi = ["cffi (>=1.17,<2.0) ; platform_python_implementation != \"PyPy\" and python_version < \"3.14\"", "cffi (>=2.0.0b) ; platform_python_implementation != \"PyPy\" and python_version >= \"3.14\""] [metadata] lock-version = "2.1" python-versions = ">=3.12,<3.13" -content-hash = "fa16631f516a858827a987eeb5d50ec37aba45aa095581c8480fd57a653f5f09" +content-hash = "0ab7c6106d527e74f7ecc15e0a6cfd4e8190c765f6e811864a829bbee3ce8bee" diff --git a/django_app/pyproject.toml b/django_app/pyproject.toml index eb8857a9c..68871aa48 100644 --- a/django_app/pyproject.toml +++ b/django_app/pyproject.toml @@ -58,7 +58,7 @@ mohawk = "^1.1.0" uwotm8 = "^0.1.6" pymupdf = "^1.27.2" openpyxl = "^3.1.5" -ddtrace = "^4.10.3" +ddtrace = "^4.11.0" django-requestlogs = "^0.8" unoserver = "^3.6" coverage = "^7.13.5" diff --git a/django_app/redbox_app/settings.py b/django_app/redbox_app/settings.py index 2f4a4d5e0..df5faf507 100644 --- a/django_app/redbox_app/settings.py +++ b/django_app/redbox_app/settings.py @@ -355,6 +355,9 @@ def filter_transactions(event, _hint): LOG_LEVEL = env.str("DJANGO_LOG_LEVEL", "WARNING") LOG_FORMAT = env.str("DJANGO_LOG_FORMAT", "asim_formatter") +DD_TRACE_DEBUG_ENABLED = env.bool("DD_TRACE_DEBUG", default=False) +DD_TRACE_LOG_LEVEL = env.str("DD_TRACE_LOG_LEVEL", "DEBUG" if DD_TRACE_DEBUG_ENABLED else "ERROR") +DD_TRACE_LOG_HANDLER = "console" if DD_TRACE_DEBUG_ENABLED else "asim" LOGGING = { "version": 1, "disable_existing_loggers": False, @@ -412,8 +415,8 @@ def filter_transactions(event, _hint): "level": "WARNING", }, "ddtrace": { - "handlers": ["asim"], - "level": "ERROR", + "handlers": [DD_TRACE_LOG_HANDLER], + "level": DD_TRACE_LOG_LEVEL, "propagate": False, }, }, @@ -493,7 +496,7 @@ def filter_transactions(event, _hint): EMBEDDING_BACKEND = env.str("EMBEDDING_BACKEND", "amazon.titan-embed-text-v2:0") -DEFAULT_MODEL_ID = env.str("DEFAULT_MODEL_ID", "anthropic.claude-3-sonnet-20240229-v1:0") +DEFAULT_MODEL_ID = env.str("DEFAULT_MODEL_ID", "claude-sonnet-4-6") WEB_SEARCH_API_LIMIT = env.int("WEB_SEARCH_API_LIMIT", 100) diff --git a/django_app/start.sh b/django_app/start.sh index f37ec2c89..7b2bcff9d 100644 --- a/django_app/start.sh +++ b/django_app/start.sh @@ -2,6 +2,13 @@ PORT=8080 +if [ "${REDBOX_ENABLE_DD_DIAGNOSTICS:-false}" = "1" ] || [ "${REDBOX_ENABLE_DD_DIAGNOSTICS:-false}" = "true" ] || [ "${REDBOX_ENABLE_DD_DIAGNOSTICS:-false}" = "TRUE" ]; then + export DD_TRACE_DEBUG=true + export DD_TRACE_LOG_LEVEL=DEBUG + export REDBOX_BEDROCK_DIAGNOSTICS=true + echo "Datadog diagnostics mode enabled" +fi + venv/bin/django-admin migrate venv/bin/django-admin collectstatic --noinput venv/bin/django-admin create_admin_user diff --git a/poetry.lock b/poetry.lock index 71048ac14..95c2d01c0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.3.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "accelerate" @@ -2001,65 +2001,69 @@ error-tracking = ["ddtrace (>=3,<5)"] [[package]] name = "ddtrace" -version = "4.10.3" +version = "4.11.0" description = "Datadog APM client library" optional = false python-versions = "<3.15,>=3.9" groups = ["main"] files = [ - {file = "ddtrace-4.10.3-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:2971c585ee6022310847e32dbbcf667ea6a83a9ea83150afda4be27f87a1fb6d"}, - {file = "ddtrace-4.10.3-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:10df59249f876781467f808a998b662b80d817ec236633993dcf0d46b0ebc0b4"}, - {file = "ddtrace-4.10.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:14f92e9412beb08d189b8235dd3c55993b092f1d9d286da664c777dceba51c88"}, - {file = "ddtrace-4.10.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3565355b65c8452956f0552be6edd9385087ac72de3585a9f6c0a2a2c38425cb"}, - {file = "ddtrace-4.10.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5d2722a67e5e76178748a9b0b372b41ff93dfd93fa3d450eee06f0d49dffd984"}, - {file = "ddtrace-4.10.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5095b3049b46d65c7e22c89e83554483617d4c8e4658742dc3375158d54c8278"}, - {file = "ddtrace-4.10.3-cp310-cp310-win32.whl", hash = "sha256:670dfa84819b3f01143899d7478e1e2109ad9cd084d65a9610bc08c479ebb19a"}, - {file = "ddtrace-4.10.3-cp310-cp310-win_amd64.whl", hash = "sha256:023f37709e1eab772d52669481f01391e3238095b9ef9f78816be6b7bd5c0c8a"}, - {file = "ddtrace-4.10.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:ba6083760b7900b9bc88dd09e406ee4cbeff7f52bc0c00d3b794dc1836c7282e"}, - {file = "ddtrace-4.10.3-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:4f42ab64ed9f6ff1df25db94cd9e6eee25f312f7b79af2905a0971dbf6375280"}, - {file = "ddtrace-4.10.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6c2c73cce18448cae791124d383d12d656e087b581c5fa36434956c2cf15f38f"}, - {file = "ddtrace-4.10.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:05351f343468a01e9eb971e3674e551b455326199907708aee2e5448f97a9b9f"}, - {file = "ddtrace-4.10.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:3551c4341ed175bba352a70e06998946117f1798071e210709a6a9ff6eac3292"}, - {file = "ddtrace-4.10.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:cbce2665483523960ed38eeb256772e805967faae1b5de004437c21d8f4f3120"}, - {file = "ddtrace-4.10.3-cp311-cp311-win32.whl", hash = "sha256:97c3e28c21a361c0d7e9ad11d37fed02a40f5676f049bf03a3f64048a4dc2c03"}, - {file = "ddtrace-4.10.3-cp311-cp311-win_amd64.whl", hash = "sha256:d1ceafdb79425cd59df4f010c88718e700093d2160b5f5db76d56072e73586fa"}, - {file = "ddtrace-4.10.3-cp311-cp311-win_arm64.whl", hash = "sha256:1003cc2df836b89c78b9351fc77888173ba43337d939604f6920d52eebd7649d"}, - {file = "ddtrace-4.10.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:77150793300a9a327cf971ba4178f41b8efcbaba8d1afcd0d78489f832f21a63"}, - {file = "ddtrace-4.10.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:bf91f34000cec828689d72bd458e53ed5ac1dd9799df3c6a71aac06b3321125e"}, - {file = "ddtrace-4.10.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:feacd27427216154b66f73129bc3b8a37fd6bd097aba5ff0ebddc0bb68dc5c65"}, - {file = "ddtrace-4.10.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cc2fef5e8600719ce8f8bc2e0e9385f21a619881a2d8fedbbdd9a7a8ea409974"}, - {file = "ddtrace-4.10.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b223d26026e68a6ba1c728f17d8102b2ad6dea30289c91d84078284f20d11883"}, - {file = "ddtrace-4.10.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1fe973efe7583a616bb607aa7e6ffef521620a03e52d58e4ea8dd6059f4b99b8"}, - {file = "ddtrace-4.10.3-cp312-cp312-win32.whl", hash = "sha256:79aa6cbffc1aae5ad9f3df71b7d5055fd40bf861e6407a1dff5b8629d8db6a59"}, - {file = "ddtrace-4.10.3-cp312-cp312-win_amd64.whl", hash = "sha256:a1a49d145d6119378606d42dcd78b0dd5e7cad12dc7e47f11b27224e4b0d6dc9"}, - {file = "ddtrace-4.10.3-cp312-cp312-win_arm64.whl", hash = "sha256:2dc2a4092e99bdc5ba3a4d9ec3f85cdabc6e0b0d2be240836fec973d838bc4df"}, - {file = "ddtrace-4.10.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:6def32279ea766f790e623c4eb1c057304187a0095710b4390e8bfe92e449d27"}, - {file = "ddtrace-4.10.3-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:8b8e32295382638570ea411d13ff2728fd05a8ac6b38b9f4264e5d55ad132b86"}, - {file = "ddtrace-4.10.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3581b24d8f53e1c1c1e1f81906d253d46d81cd76f7795d2db5189ba174024552"}, - {file = "ddtrace-4.10.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4ba47da0e824b9a47881cc59176e79eceb6d986ba3afb949d585fa3447b809b1"}, - {file = "ddtrace-4.10.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:fb1bd9ee05b502c7767bf8f55f8e49dfe24b5fee04bf789df377c3bc77b02650"}, - {file = "ddtrace-4.10.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d4d9c60eec7593d07705aaa7238148399c15483d0f61dac3934d9ddfddbc2c1d"}, - {file = "ddtrace-4.10.3-cp313-cp313-win32.whl", hash = "sha256:c7e548568a60b5ec8cb3dd520fb0ead49ec0dbd0124b79e8e97f430a69a47a70"}, - {file = "ddtrace-4.10.3-cp313-cp313-win_amd64.whl", hash = "sha256:fbe41cdf3c2aec5d042a3da204c6aa62d6f2e6acb88d24bf6b845d342e8d84cf"}, - {file = "ddtrace-4.10.3-cp313-cp313-win_arm64.whl", hash = "sha256:66cf442e58468606ea2af81dc1e08ec971a031db422d5a798054cba379dd4bdc"}, - {file = "ddtrace-4.10.3-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:fc06adb2de4e9cbcb91a6f22b15f88e3b24aab89bc031ed07341a694b02f1584"}, - {file = "ddtrace-4.10.3-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:bb1dd13a8676af0987b24c21b13acb1b711d04196fd759b5a71d1d56a9048c9f"}, - {file = "ddtrace-4.10.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:95eacdc4c1c35b0b8adbe50061e49f22d94e8be74a1dbc3b701ee61c8f33c86c"}, - {file = "ddtrace-4.10.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:42cc4535fdffa6e9cccd22afd5a5c54b83e456349b03a46aeb3c24ae915c37d3"}, - {file = "ddtrace-4.10.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e989289bfe026d70b98581355620bb1604374b15775c40d7c695d27c303f0b7b"}, - {file = "ddtrace-4.10.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a668874431201a05738e0c94cbe5328518864edd6aeab5ddd13fb5c73323f100"}, - {file = "ddtrace-4.10.3-cp314-cp314-win32.whl", hash = "sha256:03d836ff4ed02e81f2ea6c4277c75b640fe92472e92b01929e2bc073415e0306"}, - {file = "ddtrace-4.10.3-cp314-cp314-win_amd64.whl", hash = "sha256:908e5970674222d8f2c7b10c5ec255ff70d17222d9db73b15f7ba2419f256ef8"}, - {file = "ddtrace-4.10.3-cp314-cp314-win_arm64.whl", hash = "sha256:1137aeaeb999e07583d7d306999afcb48daceab2e608f98936722d733b8ea9e7"}, - {file = "ddtrace-4.10.3-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:347d849888138e50f2bccb7185d9a8504f18e6d4f53b6f027af4695a25a2fd42"}, - {file = "ddtrace-4.10.3-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:7931857d350660899a5ef0831c7ef0192c38943d724b384da73bc78d9948b3f1"}, - {file = "ddtrace-4.10.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2cb2c62f245f5d97936cfac7a4d8860a284dd38e885b2c40e866694083ea9e85"}, - {file = "ddtrace-4.10.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d7992fab1bab2691e69d7dfa0285bd94016d1c43eb031d3f1259ec0135f67d65"}, - {file = "ddtrace-4.10.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f54beef343314c82fea8fa8511f26392ce500a0861f90c93363643dac4376cec"}, - {file = "ddtrace-4.10.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f261888fb2a6403c410a9108451364718303fc3130b13e6a5d77f98451061362"}, - {file = "ddtrace-4.10.3-cp39-cp39-win32.whl", hash = "sha256:ee314640e74de19de87b11cbe911d1f737d7b27685b1d106b55a1504ada0b5a7"}, - {file = "ddtrace-4.10.3-cp39-cp39-win_amd64.whl", hash = "sha256:0aa87dfbd53a0d52c67c9c36ad426a7b359063e73ce3d835e8aaea7c5a5af3f7"}, - {file = "ddtrace-4.10.3.tar.gz", hash = "sha256:12abe3864c7247261ef26bf2ab24e6444e8a280c04de01a36b27c57da1fdb083"}, + {file = "ddtrace-4.11.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:0bc55e48da62b6a287b36e01f5876489023178c09b60e8e01608e2e895ccdc4b"}, + {file = "ddtrace-4.11.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:5df47873c625993e81fabd8f6ae2ab61f66c6805cfd1a8c551a509d5b5d91062"}, + {file = "ddtrace-4.11.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e857428cc86fe541f5b3768d7d8331e2f1cbde1a2492deedff4619109cbfd5fc"}, + {file = "ddtrace-4.11.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fc60575f8f47af58e6523f8a802d1f92a4912aa7d4ba71024958421044cba61a"}, + {file = "ddtrace-4.11.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d65ab60bfb0b2edde6c564bd1f97b99a8ea9bb082c93b265488ba214c606d240"}, + {file = "ddtrace-4.11.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7ebfdee1342b5b1cdad8505e040bbfe5bdf6976e820803eaa4a1814417d6bb0e"}, + {file = "ddtrace-4.11.0-cp310-cp310-win32.whl", hash = "sha256:6247a431ae3a2622a0e835357a644b1bac81719e28f21748fd7d4034c79c3ed7"}, + {file = "ddtrace-4.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:9197110982756a97243906ffce7b98e6007c8258a6bbc22451d7b26e8f1b0103"}, + {file = "ddtrace-4.11.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:b4074e538e708b0e9d7f812be15db306abbe3a6cb70046f9f786d66daa862344"}, + {file = "ddtrace-4.11.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:05f701229233ad8a4ad5d52b8ff2bfd6e2f99601a3bc04367615cd1ce4a01a80"}, + {file = "ddtrace-4.11.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c3a557891e91a443e6a3a9b7c31dc96b9963acada0986dab5a3d65507efa16a1"}, + {file = "ddtrace-4.11.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0328bfeb4a6bdc00168a4184aea670eedc073734f6fbc6ca1abfeb6547415d2"}, + {file = "ddtrace-4.11.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ad6f17111746568a58da89b6db5e5d18eb07db7b8ce3be3396631f37391cff50"}, + {file = "ddtrace-4.11.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:eb30dd327789ec1851bc42194c8db0b93a7ad708c2963d694e3622b684a085f7"}, + {file = "ddtrace-4.11.0-cp311-cp311-win32.whl", hash = "sha256:dfe73130778ca22652ae398fc77de3643d50687deb127bf4cd2566b10778125a"}, + {file = "ddtrace-4.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:1241f38d52b40b516d620ed68ecd04afbc715f2c1c9f3ddae8a7b86ecf848c91"}, + {file = "ddtrace-4.11.0-cp311-cp311-win_arm64.whl", hash = "sha256:3013b67e1a172eb0edd8c37559b81760a9db205a671541925ebd0127f496409b"}, + {file = "ddtrace-4.11.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:d0eadcf7df3143bf0611f09a351040e475b5df7f512410698cd481a076bca056"}, + {file = "ddtrace-4.11.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:57eb0616dc5c8ff04b5c560ba6d3def69d2bc618e69ce65cc015f103fc68649e"}, + {file = "ddtrace-4.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c311109d1e0f3482b7a44126c855eeb796b186f01604ce74c54800aa5892863d"}, + {file = "ddtrace-4.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:695ec915640072e2917b13d317fe1696086a38924ba02cbe1dcb3918ffb0fa65"}, + {file = "ddtrace-4.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:355a288756a7a5d6b73221d28ba4536cb0271d2ea7909adab3e2ee37d62a569f"}, + {file = "ddtrace-4.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2c19888af09f6ad3340f2935ea5c9eb80d9298141e196fd33e544369920aefba"}, + {file = "ddtrace-4.11.0-cp312-cp312-win32.whl", hash = "sha256:cd524b299bd15ed14192cb041a35e992003e0d3a9f8831062f9f28bcfacb63e2"}, + {file = "ddtrace-4.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:af663120d3b4116965bebbd79ce8e73a85644816a0917999e8164b6204678cb6"}, + {file = "ddtrace-4.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:f0b50a1739573318b0a81fb56a8b22ed6ae6dac017b89400cbc76c17b439d9ed"}, + {file = "ddtrace-4.11.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:16b9f06c841858debb3de2c4a7ce6acbd6967eaa6ce264dbd0e2a58e376b8583"}, + {file = "ddtrace-4.11.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:1cb352d7df16b864f258d4602addf23b8d29d2d416ccc1d0af8d88c614f70a01"}, + {file = "ddtrace-4.11.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:54f4cf656aa452bc37b62fa7939c5bddca751ffd4d315b3c925236d4794767ea"}, + {file = "ddtrace-4.11.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:776d99ccb01abecf7dbb4910f4a570b6ab625ed47e00bb6c0159d88d4e2ef1c8"}, + {file = "ddtrace-4.11.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5533ce94e50412565a36ce0c8fc6ff6f7490e69b4ecff10c550482e49d5d065e"}, + {file = "ddtrace-4.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:81d147bd3d6fa067f2c72c7e32aba90d5d61ed379850896f1cc7fd1ea3437bb1"}, + {file = "ddtrace-4.11.0-cp313-cp313-win32.whl", hash = "sha256:bcf1d3ba8c3771b8c75f0b9ecd9038ae0a44c8bb0c01d21458c405a29341518a"}, + {file = "ddtrace-4.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:d465b9f6f049fc32278cbfd74e1e593b0c3460aacb622bef0cee71e50ffc4b05"}, + {file = "ddtrace-4.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:00cc0fbfa6b8741477528c3fe7bc70a4a5ea439221f188e14da6907f03ed0125"}, + {file = "ddtrace-4.11.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:e6f1ca84237e9f52fd71e3458262cfc407dd43337a56e4a6ba9beea88f0958c5"}, + {file = "ddtrace-4.11.0-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:c3ddbf9a5a0cd51b5ab9bca898c85cfce73072054b9f5b577164a95065cb8331"}, + {file = "ddtrace-4.11.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7c435b708f4956208141c22d941ed60a1551813353f6c1cfc1a5283ec3d80cc5"}, + {file = "ddtrace-4.11.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:26b3fd7ee97cf7fa1296eecacd393bbbef343cf8bb2d0b1ee39d40cb1d4818fa"}, + {file = "ddtrace-4.11.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:8d23d66ba9525fd9b9a61c0db8c43e64461066b1d49c75c85f639ea65776367b"}, + {file = "ddtrace-4.11.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:85e081e2295a77c9b38e5792a097f1df8169e1dd9b3339f820d00183e10e8b1b"}, + {file = "ddtrace-4.11.0-cp314-cp314-win32.whl", hash = "sha256:c267fe4efceb71019f5e6833fdb4fbdff18a51641bdca9fceabbe579984461e4"}, + {file = "ddtrace-4.11.0-cp314-cp314-win_amd64.whl", hash = "sha256:3bebf3cb12ac51c422ad1ed74873746b8398cce845075b234115c2f518a7a652"}, + {file = "ddtrace-4.11.0-cp314-cp314-win_arm64.whl", hash = "sha256:f596cb2da582600e091c8174ab4f8e44bf4f05c50c03cc450e0378c516e0c6e3"}, + {file = "ddtrace-4.11.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9d9a7c4644e4ffc858e951eeab37ab86e9b717ef1bc2f2a47de69f1ec373bccb"}, + {file = "ddtrace-4.11.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b49433f0e85e16c34f578e01ec4e263ab5181d9636635add8d6194bd47dd163c"}, + {file = "ddtrace-4.11.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:2affbac04583808cba374976d07e59a4fe156d1de122f8def30550bf7717b745"}, + {file = "ddtrace-4.11.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:51a28ab8072c741e104d8c6f47d990eb5989a359b7ea4d91bab7c5c1f5c1a03c"}, + {file = "ddtrace-4.11.0-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:e4706b45074d80aecd357274f1a8257c73967250e78ac9d46bdc7df6aa78ba86"}, + {file = "ddtrace-4.11.0-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:b5da09a248c712d023dfffb085b3f62ecefd1a1d5d1ee4ba1da6852879bea771"}, + {file = "ddtrace-4.11.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:019071f74b30507c82c8acba03ba24fe5338d0b51de561640379d8de9689d247"}, + {file = "ddtrace-4.11.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7c5de4a48d9304cc171171c032c5f0a472f1cd498b22f4e3563738e053c91585"}, + {file = "ddtrace-4.11.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7707a9fcccc2d99e90e27788a494b4603d9d99551c2fdc1aa41dd453ee913d77"}, + {file = "ddtrace-4.11.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:792670a1a7d6ec35321cc46fa4a7ca97464cecfc54d075ed6f629d90af1f6567"}, + {file = "ddtrace-4.11.0-cp39-cp39-win32.whl", hash = "sha256:27ffca4b2555dff543f3fe2df88ef70492cb6dc1df523550803e3f3175bc7277"}, + {file = "ddtrace-4.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:73b128817039e626f557b4c035d9756209ba90a9a14595b13596f7100810fe86"}, + {file = "ddtrace-4.11.0.tar.gz", hash = "sha256:260c5b46e80565f4fd08cec2650f707627fb57cd6f8951a2d8c9e6a02b490074"}, ] [package.dependencies] @@ -3074,7 +3078,6 @@ python-versions = ">=3.10" groups = ["docs"] files = [ {file = "griffe-2.0.0-py3-none-any.whl", hash = "sha256:5418081135a391c3e6e757a7f3f156f1a1a746cc7b4023868ff7d5e2f9a980aa"}, - {file = "griffe-2.0.0.tar.gz", hash = "sha256:c68979cd8395422083a51ea7cf02f9c119d889646d99b7b656ee43725de1b80f"}, ] [package.dependencies] @@ -3109,7 +3112,6 @@ python-versions = ">=3.10" groups = ["docs"] files = [ {file = "griffecli-2.0.0-py3-none-any.whl", hash = "sha256:9f7cd9ee9b21d55e91689358978d2385ae65c22f307a63fb3269acf3f21e643d"}, - {file = "griffecli-2.0.0.tar.gz", hash = "sha256:312fa5ebb4ce6afc786356e2d0ce85b06c1c20d45abc42d74f0cda65e159f6ef"}, ] [package.dependencies] @@ -3125,7 +3127,6 @@ python-versions = ">=3.10" groups = ["docs"] files = [ {file = "griffelib-2.0.0-py3-none-any.whl", hash = "sha256:01284878c966508b6d6f1dbff9b6fa607bc062d8261c5c7253cb285b06422a7f"}, - {file = "griffelib-2.0.0.tar.gz", hash = "sha256:e504d637a089f5cab9b5daf18f7645970509bf4f53eda8d79ed71cce8bd97934"}, ] [package.extras] @@ -3859,7 +3860,7 @@ files = [ [package.dependencies] attrs = ">=22.2.0" -jsonschema-specifications = ">=2023.3.6" +jsonschema-specifications = ">=2023.03.6" referencing = ">=0.28.4" rpds-py = ">=0.25.0" @@ -8431,10 +8432,10 @@ files = [ ] [package.dependencies] -botocore = ">=1.37.4,<2.0a0" +botocore = ">=1.37.4,<2.0a.0" [package.extras] -crt = ["botocore[crt] (>=1.37.4,<2.0a0)"] +crt = ["botocore[crt] (>=1.37.4,<2.0a.0)"] [[package]] name = "safetensors" @@ -10555,4 +10556,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = ">=3.12,<3.13" -content-hash = "51d47613605e10651f246bf674602f731818af13e0eebd0f958b76a8c58244ba" +content-hash = "ad437910b7fa8e2080724a8a71cf4a5ec29e0103c54f5eec1d802a03824f4c73" diff --git a/pyproject.toml b/pyproject.toml index 22c611f0b..db1150275 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ django = "5.2.13" django-staff-sso-client = "^5.2.0" dbt-copilot-python = "^2.1.0" uwotm8 = "^0.1.6" -ddtrace = "^4.10.3" +ddtrace = "^4.11.0" django-log-formatter-asim = "^1.3.0" django-requestlogs = "^0.8" openpyxl = "^3.1.5" diff --git a/redbox/poetry.lock b/redbox/poetry.lock index e6e6dd017..394b88b4d 100644 --- a/redbox/poetry.lock +++ b/redbox/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "accelerate" @@ -1633,65 +1633,69 @@ typing-inspect = ">=0.4.0,<1" [[package]] name = "ddtrace" -version = "4.10.3" +version = "4.11.0" description = "Datadog APM client library" optional = false python-versions = "<3.15,>=3.9" groups = ["main"] files = [ - {file = "ddtrace-4.10.3-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:2971c585ee6022310847e32dbbcf667ea6a83a9ea83150afda4be27f87a1fb6d"}, - {file = "ddtrace-4.10.3-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:10df59249f876781467f808a998b662b80d817ec236633993dcf0d46b0ebc0b4"}, - {file = "ddtrace-4.10.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:14f92e9412beb08d189b8235dd3c55993b092f1d9d286da664c777dceba51c88"}, - {file = "ddtrace-4.10.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3565355b65c8452956f0552be6edd9385087ac72de3585a9f6c0a2a2c38425cb"}, - {file = "ddtrace-4.10.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5d2722a67e5e76178748a9b0b372b41ff93dfd93fa3d450eee06f0d49dffd984"}, - {file = "ddtrace-4.10.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5095b3049b46d65c7e22c89e83554483617d4c8e4658742dc3375158d54c8278"}, - {file = "ddtrace-4.10.3-cp310-cp310-win32.whl", hash = "sha256:670dfa84819b3f01143899d7478e1e2109ad9cd084d65a9610bc08c479ebb19a"}, - {file = "ddtrace-4.10.3-cp310-cp310-win_amd64.whl", hash = "sha256:023f37709e1eab772d52669481f01391e3238095b9ef9f78816be6b7bd5c0c8a"}, - {file = "ddtrace-4.10.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:ba6083760b7900b9bc88dd09e406ee4cbeff7f52bc0c00d3b794dc1836c7282e"}, - {file = "ddtrace-4.10.3-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:4f42ab64ed9f6ff1df25db94cd9e6eee25f312f7b79af2905a0971dbf6375280"}, - {file = "ddtrace-4.10.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6c2c73cce18448cae791124d383d12d656e087b581c5fa36434956c2cf15f38f"}, - {file = "ddtrace-4.10.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:05351f343468a01e9eb971e3674e551b455326199907708aee2e5448f97a9b9f"}, - {file = "ddtrace-4.10.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:3551c4341ed175bba352a70e06998946117f1798071e210709a6a9ff6eac3292"}, - {file = "ddtrace-4.10.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:cbce2665483523960ed38eeb256772e805967faae1b5de004437c21d8f4f3120"}, - {file = "ddtrace-4.10.3-cp311-cp311-win32.whl", hash = "sha256:97c3e28c21a361c0d7e9ad11d37fed02a40f5676f049bf03a3f64048a4dc2c03"}, - {file = "ddtrace-4.10.3-cp311-cp311-win_amd64.whl", hash = "sha256:d1ceafdb79425cd59df4f010c88718e700093d2160b5f5db76d56072e73586fa"}, - {file = "ddtrace-4.10.3-cp311-cp311-win_arm64.whl", hash = "sha256:1003cc2df836b89c78b9351fc77888173ba43337d939604f6920d52eebd7649d"}, - {file = "ddtrace-4.10.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:77150793300a9a327cf971ba4178f41b8efcbaba8d1afcd0d78489f832f21a63"}, - {file = "ddtrace-4.10.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:bf91f34000cec828689d72bd458e53ed5ac1dd9799df3c6a71aac06b3321125e"}, - {file = "ddtrace-4.10.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:feacd27427216154b66f73129bc3b8a37fd6bd097aba5ff0ebddc0bb68dc5c65"}, - {file = "ddtrace-4.10.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cc2fef5e8600719ce8f8bc2e0e9385f21a619881a2d8fedbbdd9a7a8ea409974"}, - {file = "ddtrace-4.10.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b223d26026e68a6ba1c728f17d8102b2ad6dea30289c91d84078284f20d11883"}, - {file = "ddtrace-4.10.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1fe973efe7583a616bb607aa7e6ffef521620a03e52d58e4ea8dd6059f4b99b8"}, - {file = "ddtrace-4.10.3-cp312-cp312-win32.whl", hash = "sha256:79aa6cbffc1aae5ad9f3df71b7d5055fd40bf861e6407a1dff5b8629d8db6a59"}, - {file = "ddtrace-4.10.3-cp312-cp312-win_amd64.whl", hash = "sha256:a1a49d145d6119378606d42dcd78b0dd5e7cad12dc7e47f11b27224e4b0d6dc9"}, - {file = "ddtrace-4.10.3-cp312-cp312-win_arm64.whl", hash = "sha256:2dc2a4092e99bdc5ba3a4d9ec3f85cdabc6e0b0d2be240836fec973d838bc4df"}, - {file = "ddtrace-4.10.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:6def32279ea766f790e623c4eb1c057304187a0095710b4390e8bfe92e449d27"}, - {file = "ddtrace-4.10.3-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:8b8e32295382638570ea411d13ff2728fd05a8ac6b38b9f4264e5d55ad132b86"}, - {file = "ddtrace-4.10.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3581b24d8f53e1c1c1e1f81906d253d46d81cd76f7795d2db5189ba174024552"}, - {file = "ddtrace-4.10.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4ba47da0e824b9a47881cc59176e79eceb6d986ba3afb949d585fa3447b809b1"}, - {file = "ddtrace-4.10.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:fb1bd9ee05b502c7767bf8f55f8e49dfe24b5fee04bf789df377c3bc77b02650"}, - {file = "ddtrace-4.10.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d4d9c60eec7593d07705aaa7238148399c15483d0f61dac3934d9ddfddbc2c1d"}, - {file = "ddtrace-4.10.3-cp313-cp313-win32.whl", hash = "sha256:c7e548568a60b5ec8cb3dd520fb0ead49ec0dbd0124b79e8e97f430a69a47a70"}, - {file = "ddtrace-4.10.3-cp313-cp313-win_amd64.whl", hash = "sha256:fbe41cdf3c2aec5d042a3da204c6aa62d6f2e6acb88d24bf6b845d342e8d84cf"}, - {file = "ddtrace-4.10.3-cp313-cp313-win_arm64.whl", hash = "sha256:66cf442e58468606ea2af81dc1e08ec971a031db422d5a798054cba379dd4bdc"}, - {file = "ddtrace-4.10.3-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:fc06adb2de4e9cbcb91a6f22b15f88e3b24aab89bc031ed07341a694b02f1584"}, - {file = "ddtrace-4.10.3-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:bb1dd13a8676af0987b24c21b13acb1b711d04196fd759b5a71d1d56a9048c9f"}, - {file = "ddtrace-4.10.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:95eacdc4c1c35b0b8adbe50061e49f22d94e8be74a1dbc3b701ee61c8f33c86c"}, - {file = "ddtrace-4.10.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:42cc4535fdffa6e9cccd22afd5a5c54b83e456349b03a46aeb3c24ae915c37d3"}, - {file = "ddtrace-4.10.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e989289bfe026d70b98581355620bb1604374b15775c40d7c695d27c303f0b7b"}, - {file = "ddtrace-4.10.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a668874431201a05738e0c94cbe5328518864edd6aeab5ddd13fb5c73323f100"}, - {file = "ddtrace-4.10.3-cp314-cp314-win32.whl", hash = "sha256:03d836ff4ed02e81f2ea6c4277c75b640fe92472e92b01929e2bc073415e0306"}, - {file = "ddtrace-4.10.3-cp314-cp314-win_amd64.whl", hash = "sha256:908e5970674222d8f2c7b10c5ec255ff70d17222d9db73b15f7ba2419f256ef8"}, - {file = "ddtrace-4.10.3-cp314-cp314-win_arm64.whl", hash = "sha256:1137aeaeb999e07583d7d306999afcb48daceab2e608f98936722d733b8ea9e7"}, - {file = "ddtrace-4.10.3-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:347d849888138e50f2bccb7185d9a8504f18e6d4f53b6f027af4695a25a2fd42"}, - {file = "ddtrace-4.10.3-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:7931857d350660899a5ef0831c7ef0192c38943d724b384da73bc78d9948b3f1"}, - {file = "ddtrace-4.10.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2cb2c62f245f5d97936cfac7a4d8860a284dd38e885b2c40e866694083ea9e85"}, - {file = "ddtrace-4.10.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d7992fab1bab2691e69d7dfa0285bd94016d1c43eb031d3f1259ec0135f67d65"}, - {file = "ddtrace-4.10.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f54beef343314c82fea8fa8511f26392ce500a0861f90c93363643dac4376cec"}, - {file = "ddtrace-4.10.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f261888fb2a6403c410a9108451364718303fc3130b13e6a5d77f98451061362"}, - {file = "ddtrace-4.10.3-cp39-cp39-win32.whl", hash = "sha256:ee314640e74de19de87b11cbe911d1f737d7b27685b1d106b55a1504ada0b5a7"}, - {file = "ddtrace-4.10.3-cp39-cp39-win_amd64.whl", hash = "sha256:0aa87dfbd53a0d52c67c9c36ad426a7b359063e73ce3d835e8aaea7c5a5af3f7"}, - {file = "ddtrace-4.10.3.tar.gz", hash = "sha256:12abe3864c7247261ef26bf2ab24e6444e8a280c04de01a36b27c57da1fdb083"}, + {file = "ddtrace-4.11.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:0bc55e48da62b6a287b36e01f5876489023178c09b60e8e01608e2e895ccdc4b"}, + {file = "ddtrace-4.11.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:5df47873c625993e81fabd8f6ae2ab61f66c6805cfd1a8c551a509d5b5d91062"}, + {file = "ddtrace-4.11.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e857428cc86fe541f5b3768d7d8331e2f1cbde1a2492deedff4619109cbfd5fc"}, + {file = "ddtrace-4.11.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fc60575f8f47af58e6523f8a802d1f92a4912aa7d4ba71024958421044cba61a"}, + {file = "ddtrace-4.11.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d65ab60bfb0b2edde6c564bd1f97b99a8ea9bb082c93b265488ba214c606d240"}, + {file = "ddtrace-4.11.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7ebfdee1342b5b1cdad8505e040bbfe5bdf6976e820803eaa4a1814417d6bb0e"}, + {file = "ddtrace-4.11.0-cp310-cp310-win32.whl", hash = "sha256:6247a431ae3a2622a0e835357a644b1bac81719e28f21748fd7d4034c79c3ed7"}, + {file = "ddtrace-4.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:9197110982756a97243906ffce7b98e6007c8258a6bbc22451d7b26e8f1b0103"}, + {file = "ddtrace-4.11.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:b4074e538e708b0e9d7f812be15db306abbe3a6cb70046f9f786d66daa862344"}, + {file = "ddtrace-4.11.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:05f701229233ad8a4ad5d52b8ff2bfd6e2f99601a3bc04367615cd1ce4a01a80"}, + {file = "ddtrace-4.11.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c3a557891e91a443e6a3a9b7c31dc96b9963acada0986dab5a3d65507efa16a1"}, + {file = "ddtrace-4.11.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0328bfeb4a6bdc00168a4184aea670eedc073734f6fbc6ca1abfeb6547415d2"}, + {file = "ddtrace-4.11.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ad6f17111746568a58da89b6db5e5d18eb07db7b8ce3be3396631f37391cff50"}, + {file = "ddtrace-4.11.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:eb30dd327789ec1851bc42194c8db0b93a7ad708c2963d694e3622b684a085f7"}, + {file = "ddtrace-4.11.0-cp311-cp311-win32.whl", hash = "sha256:dfe73130778ca22652ae398fc77de3643d50687deb127bf4cd2566b10778125a"}, + {file = "ddtrace-4.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:1241f38d52b40b516d620ed68ecd04afbc715f2c1c9f3ddae8a7b86ecf848c91"}, + {file = "ddtrace-4.11.0-cp311-cp311-win_arm64.whl", hash = "sha256:3013b67e1a172eb0edd8c37559b81760a9db205a671541925ebd0127f496409b"}, + {file = "ddtrace-4.11.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:d0eadcf7df3143bf0611f09a351040e475b5df7f512410698cd481a076bca056"}, + {file = "ddtrace-4.11.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:57eb0616dc5c8ff04b5c560ba6d3def69d2bc618e69ce65cc015f103fc68649e"}, + {file = "ddtrace-4.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c311109d1e0f3482b7a44126c855eeb796b186f01604ce74c54800aa5892863d"}, + {file = "ddtrace-4.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:695ec915640072e2917b13d317fe1696086a38924ba02cbe1dcb3918ffb0fa65"}, + {file = "ddtrace-4.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:355a288756a7a5d6b73221d28ba4536cb0271d2ea7909adab3e2ee37d62a569f"}, + {file = "ddtrace-4.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2c19888af09f6ad3340f2935ea5c9eb80d9298141e196fd33e544369920aefba"}, + {file = "ddtrace-4.11.0-cp312-cp312-win32.whl", hash = "sha256:cd524b299bd15ed14192cb041a35e992003e0d3a9f8831062f9f28bcfacb63e2"}, + {file = "ddtrace-4.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:af663120d3b4116965bebbd79ce8e73a85644816a0917999e8164b6204678cb6"}, + {file = "ddtrace-4.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:f0b50a1739573318b0a81fb56a8b22ed6ae6dac017b89400cbc76c17b439d9ed"}, + {file = "ddtrace-4.11.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:16b9f06c841858debb3de2c4a7ce6acbd6967eaa6ce264dbd0e2a58e376b8583"}, + {file = "ddtrace-4.11.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:1cb352d7df16b864f258d4602addf23b8d29d2d416ccc1d0af8d88c614f70a01"}, + {file = "ddtrace-4.11.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:54f4cf656aa452bc37b62fa7939c5bddca751ffd4d315b3c925236d4794767ea"}, + {file = "ddtrace-4.11.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:776d99ccb01abecf7dbb4910f4a570b6ab625ed47e00bb6c0159d88d4e2ef1c8"}, + {file = "ddtrace-4.11.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5533ce94e50412565a36ce0c8fc6ff6f7490e69b4ecff10c550482e49d5d065e"}, + {file = "ddtrace-4.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:81d147bd3d6fa067f2c72c7e32aba90d5d61ed379850896f1cc7fd1ea3437bb1"}, + {file = "ddtrace-4.11.0-cp313-cp313-win32.whl", hash = "sha256:bcf1d3ba8c3771b8c75f0b9ecd9038ae0a44c8bb0c01d21458c405a29341518a"}, + {file = "ddtrace-4.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:d465b9f6f049fc32278cbfd74e1e593b0c3460aacb622bef0cee71e50ffc4b05"}, + {file = "ddtrace-4.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:00cc0fbfa6b8741477528c3fe7bc70a4a5ea439221f188e14da6907f03ed0125"}, + {file = "ddtrace-4.11.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:e6f1ca84237e9f52fd71e3458262cfc407dd43337a56e4a6ba9beea88f0958c5"}, + {file = "ddtrace-4.11.0-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:c3ddbf9a5a0cd51b5ab9bca898c85cfce73072054b9f5b577164a95065cb8331"}, + {file = "ddtrace-4.11.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7c435b708f4956208141c22d941ed60a1551813353f6c1cfc1a5283ec3d80cc5"}, + {file = "ddtrace-4.11.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:26b3fd7ee97cf7fa1296eecacd393bbbef343cf8bb2d0b1ee39d40cb1d4818fa"}, + {file = "ddtrace-4.11.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:8d23d66ba9525fd9b9a61c0db8c43e64461066b1d49c75c85f639ea65776367b"}, + {file = "ddtrace-4.11.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:85e081e2295a77c9b38e5792a097f1df8169e1dd9b3339f820d00183e10e8b1b"}, + {file = "ddtrace-4.11.0-cp314-cp314-win32.whl", hash = "sha256:c267fe4efceb71019f5e6833fdb4fbdff18a51641bdca9fceabbe579984461e4"}, + {file = "ddtrace-4.11.0-cp314-cp314-win_amd64.whl", hash = "sha256:3bebf3cb12ac51c422ad1ed74873746b8398cce845075b234115c2f518a7a652"}, + {file = "ddtrace-4.11.0-cp314-cp314-win_arm64.whl", hash = "sha256:f596cb2da582600e091c8174ab4f8e44bf4f05c50c03cc450e0378c516e0c6e3"}, + {file = "ddtrace-4.11.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9d9a7c4644e4ffc858e951eeab37ab86e9b717ef1bc2f2a47de69f1ec373bccb"}, + {file = "ddtrace-4.11.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b49433f0e85e16c34f578e01ec4e263ab5181d9636635add8d6194bd47dd163c"}, + {file = "ddtrace-4.11.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:2affbac04583808cba374976d07e59a4fe156d1de122f8def30550bf7717b745"}, + {file = "ddtrace-4.11.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:51a28ab8072c741e104d8c6f47d990eb5989a359b7ea4d91bab7c5c1f5c1a03c"}, + {file = "ddtrace-4.11.0-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:e4706b45074d80aecd357274f1a8257c73967250e78ac9d46bdc7df6aa78ba86"}, + {file = "ddtrace-4.11.0-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:b5da09a248c712d023dfffb085b3f62ecefd1a1d5d1ee4ba1da6852879bea771"}, + {file = "ddtrace-4.11.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:019071f74b30507c82c8acba03ba24fe5338d0b51de561640379d8de9689d247"}, + {file = "ddtrace-4.11.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7c5de4a48d9304cc171171c032c5f0a472f1cd498b22f4e3563738e053c91585"}, + {file = "ddtrace-4.11.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7707a9fcccc2d99e90e27788a494b4603d9d99551c2fdc1aa41dd453ee913d77"}, + {file = "ddtrace-4.11.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:792670a1a7d6ec35321cc46fa4a7ca97464cecfc54d075ed6f629d90af1f6567"}, + {file = "ddtrace-4.11.0-cp39-cp39-win32.whl", hash = "sha256:27ffca4b2555dff543f3fe2df88ef70492cb6dc1df523550803e3f3175bc7277"}, + {file = "ddtrace-4.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:73b128817039e626f557b4c035d9756209ba90a9a14595b13596f7100810fe86"}, + {file = "ddtrace-4.11.0.tar.gz", hash = "sha256:260c5b46e80565f4fd08cec2650f707627fb57cd6f8951a2d8c9e6a02b490074"}, ] [package.dependencies] @@ -9556,4 +9560,4 @@ cffi = ["cffi (>=1.17,<2.0) ; platform_python_implementation != \"PyPy\" and pyt [metadata] lock-version = "2.1" python-versions = ">=3.12,<3.13" -content-hash = "f9553c58e2381bac182305b849e73cb046f61fa4ae35bbe5830934ca88c176d7" +content-hash = "440a328efca0942ed7cbce12425dfdb61d7809c02ac08485983adcae9d4b325f" diff --git a/redbox/pyproject.toml b/redbox/pyproject.toml index beed4c1e7..ce7ce7179 100644 --- a/redbox/pyproject.toml +++ b/redbox/pyproject.toml @@ -33,7 +33,7 @@ mohawk = "^1.1.0" django-waffle = "^4.2.0" langchain-mcp-adapters = "^0.0.11" pymupdf = "^1.26.0" -ddtrace = "^4.10.3" +ddtrace = "^4.11.0" django-requestlogs = "^0.8" django-log-formatter-asim = "^1.3.0" pytest = "^8.4.2" diff --git a/redbox/redbox/chains/components.py b/redbox/redbox/chains/components.py index 9fffa4595..1f935d74f 100644 --- a/redbox/redbox/chains/components.py +++ b/redbox/redbox/chains/components.py @@ -30,7 +30,7 @@ KnowledgeBaseTabularMetadataRetriever, TabularMetadataRetriever, ) -from redbox.transform import bedrock_tokeniser +from redbox.transform import bedrock_tokeniser, ensure_bedrock_client_token_metrics logger = logging.getLogger(__name__) load_dotenv() @@ -46,6 +46,8 @@ def get_chat_llm( ai_settings: AISettings = AISettings(), tools: list[StructuredTool] | None = None, ): + ensure_bedrock_client_token_metrics() + fallback_backend = ChatLLMBackend( name="anthropic.claude-3-7-sonnet-20250219-v1:0", provider="bedrock", diff --git a/redbox/redbox/graph/nodes/tools.py b/redbox/redbox/graph/nodes/tools.py index 64be4e664..375ecb453 100644 --- a/redbox/redbox/graph/nodes/tools.py +++ b/redbox/redbox/graph/nodes/tools.py @@ -43,7 +43,13 @@ get_knowledge_base, ) from redbox.retriever.retrievers import SchematisedTabularChunkRetriever, query_to_documents -from redbox.transform import bedrock_tokeniser, merge_documents, sort_documents +from redbox.transform import ( + annotate_span_with_token_metrics, + bedrock_tokeniser, + ensure_bedrock_client_token_metrics, + merge_documents, + sort_documents, +) log = logging.getLogger(__name__) @@ -680,11 +686,12 @@ def _search_wikipedia(query: str) -> tuple[str, list[Document]]: @waffle_flag("DATA_HUB_API_ROUTE_ON") def parse_filters_bedrock(prompt: str): + ensure_bedrock_client_token_metrics() client = boto3.client("bedrock-runtime", region_name="eu-west-2") settings = get_settings() - model_id = settings.default_model_id if settings.default_model_id else "anthropic.claude-3-sonnet-20240229-v1:0" + model_id = settings.default_model_id if settings.default_model_id else "claude-sonnet-4-6" response = client.invoke_model( modelId=model_id, @@ -719,9 +726,25 @@ def parse_filters_bedrock(prompt: str): body = json.loads(response["body"].read()) try: - response_json = json.loads(body["content"][0]["text"].strip()) + response_text = body["content"][0]["text"].strip() + response_json = json.loads(response_text) + usage = body.get("usage", {}) + input_tokens = usage.get("input_tokens", bedrock_tokeniser(prompt)) + output_tokens = usage.get("output_tokens", bedrock_tokeniser(response_text)) + annotate_span_with_token_metrics( + model=model_id, + input_tokens=input_tokens, + output_tokens=output_tokens, + provider="bedrock", + ) return response_json.get("dataset", "companies-dataset"), response_json.get("filters", {}) except Exception: + annotate_span_with_token_metrics( + model=model_id, + input_tokens=bedrock_tokeniser(prompt), + output_tokens=bedrock_tokeniser(json.dumps(body)), + provider="bedrock", + ) return "companies-dataset", {} diff --git a/redbox/redbox/transform.py b/redbox/redbox/transform.py index 9b4f344cd..a411d6e01 100644 --- a/redbox/redbox/transform.py +++ b/redbox/redbox/transform.py @@ -1,10 +1,15 @@ import itertools +import json import logging -import re import math +import os +import re +from functools import wraps from typing import Dict, Iterable from uuid import NAMESPACE_DNS, UUID, uuid5 +import boto3 +from ddtrace import tracer from langchain_core.callbacks.manager import dispatch_custom_event from langchain_core.documents import Document from langchain_core.messages import AIMessage, AnyMessage @@ -15,6 +20,332 @@ log = logging.getLogger(__name__) +_BEDROCK_CONTEXT_KEY = "_redbox_bedrock_api_params" +_BEDROCK_OPERATION_KEY = "_redbox_bedrock_operation" +_BEDROCK_CLIENT_PATCHED = False +_BEDROCK_DIAGNOSTICS_ENV = "REDBOX_BEDROCK_DIAGNOSTICS" + + +def _serialize_text(text: bytes | bytearray | str | None) -> str: + if text is None: + return "" + if isinstance(text, (bytes, bytearray)): + try: + return text.decode("utf-8") + except Exception: + return text.decode("utf-8", errors="ignore") + return str(text) + + +def _diagnostics_enabled() -> bool: + return os.getenv(_BEDROCK_DIAGNOSTICS_ENV, "false").lower() in {"1", "true", "yes", "on"} + + +def _is_sensitive_key(key: str) -> bool: + key = (key or "").lower() + sensitive_terms = [ + "authorization", + "token", + "credential", + "signature", + "secret", + "cookie", + "x-api-key", + "api_key", + "passwd", + "password", + ] + return any(term in key for term in sensitive_terms) + + +def _log_bedrock_diagnostics(*, api_params: dict, span): + if not _diagnostics_enabled(): + return + try: + model_id = _bedrock_model_from_params(api_params) + operation = api_params.get("_redbox_operation", "unknown") if isinstance(api_params, dict) else "unknown" + span_name = getattr(span, "name", "unknown") if span else "unknown" + span_id = getattr(span, "span_id", "unknown") if span else "unknown" + trace_id = getattr(span, "trace_id", "unknown") if span else "unknown" + log.warning( + "BEDROCK_DIAGNOSTICS operation=%s modelId=%s span_name=%s span_id=%s trace_id=%s", + operation, + model_id, + span_name, + span_id, + trace_id, + ) + except Exception as e: + log.warning("BEDROCK_DIAGNOSTICS_ERROR %s", str(e)) + + +def _bedrock_request_text(body: str) -> str: + if not body: + return "" + + try: + payload = json.loads(body) + except Exception: + return body + + if isinstance(payload, dict): + if "messages" in payload and isinstance(payload["messages"], list): + return " ".join( + str(message.get("content", "")) for message in payload["messages"] if isinstance(message, dict) + ) + if "input" in payload: + return str(payload["input"]) + if "content" in payload: + return str(payload["content"]) + return body + + +def _bedrock_response_text(parsed: dict | None, http_response: object | None) -> str: + if isinstance(parsed, dict): + content = parsed.get("content") + if isinstance(content, list) and content: + first = content[0] + if isinstance(first, dict): + return str(first.get("text", "")) + if isinstance(first, str): + return first + if isinstance(content, str): + return content + + if http_response is not None: + content_attr = getattr(http_response, "content", None) + if isinstance(content_attr, (bytes, bytearray)): + return _serialize_text(content_attr) + + return "" + + +def annotate_span_with_token_metrics(model: str, input_tokens: int, output_tokens: int, provider: str = "bedrock"): + span = tracer.current_span() + if span is None: + return + + total_tokens = input_tokens + output_tokens + + span.set_tag("input_tokens", input_tokens) + span.set_tag("output_tokens", output_tokens) + span.set_tag("total_tokens", total_tokens) + span.set_tag("model", model) + span.set_tag("llm.model", model) + span.set_tag("provider", provider) + span.set_tag("llm.provider", provider) + + span.set_metric("input_tokens", input_tokens) + span.set_metric("output_tokens", output_tokens) + span.set_metric("total_tokens", total_tokens) + + span.set_metric("gen_ai.usage.input_tokens", input_tokens) + span.set_metric("gen_ai.usage.output_tokens", output_tokens) + span.set_metric("gen_ai.usage.total_tokens", total_tokens) + + +def _extract_text_from_content_blocks(content: list | str | None) -> str: + if isinstance(content, str): + return content + if not isinstance(content, list): + return "" + + parts = [] + for item in content: + if isinstance(item, str): + parts.append(item) + elif isinstance(item, dict): + text = item.get("text") + if text: + parts.append(str(text)) + return " ".join(parts) + + +def _bedrock_request_text_from_params(api_params: dict | None) -> str: + if not isinstance(api_params, dict): + return "" + + if body := api_params.get("body"): + return _bedrock_request_text(_serialize_text(body)) + + if messages := api_params.get("messages"): + return " ".join( + _extract_text_from_content_blocks(message.get("content")) + for message in messages + if isinstance(message, dict) + ) + + if system := api_params.get("system"): + return _extract_text_from_content_blocks(system) + + if input_text := api_params.get("inputText"): + return str(input_text) + + if input_body := api_params.get("input"): + return str(input_body) + + try: + return json.dumps(api_params) + except TypeError: + return str(api_params) + + +def _bedrock_response_text_from_parsed(parsed: dict | None) -> str: + if not isinstance(parsed, dict): + return "" + + if output := parsed.get("output"): + if isinstance(output, dict): + if message := output.get("message"): + if isinstance(message, dict): + return _extract_text_from_content_blocks(message.get("content")) + if text := output.get("text"): + return str(text) + + return _bedrock_response_text(parsed=parsed, http_response=None) + + +def _usage_value(usage: dict | None, *keys: str) -> int | None: + if not isinstance(usage, dict): + return None + + for key in keys: + value = usage.get(key) + if isinstance(value, (int, float)): + return int(value) + return None + + +def _bedrock_model_from_params(api_params: dict | None) -> str: + if not isinstance(api_params, dict): + return "unknown" + + direct_model = api_params.get("modelId") or api_params.get("model_id") or api_params.get("modelIdentifier") + if direct_model: + return str(direct_model) + + for path_key in ("url_path", "path", "url"): + path_value = api_params.get(path_key) + if not isinstance(path_value, str): + continue + match = re.search(r"/model/([^/]+)/", path_value) + if match: + return match.group(1) + + body = api_params.get("body") + body_text = _serialize_text(body) + if body_text: + try: + payload = json.loads(body_text) + except Exception: + payload = None + + if isinstance(payload, dict): + body_model = payload.get("modelId") or payload.get("model") or payload.get("model_id") + if body_model: + return str(body_model) + + return "unknown" + + +def _capture_bedrock_request_for_metrics(model=None, params=None, context=None, **kwargs): + operation_name = getattr(model, "name", None) or getattr(model, "operation_name", None) or "unknown" + api_params = params if isinstance(params, dict) else {} + + if isinstance(api_params, dict): + api_params["_redbox_operation"] = operation_name + + if isinstance(context, dict): + context[_BEDROCK_CONTEXT_KEY] = api_params + context[_BEDROCK_OPERATION_KEY] = operation_name + + if _diagnostics_enabled(): + try: + model_id = _bedrock_model_from_params(api_params) + param_keys = ",".join(sorted(api_params.keys())) if isinstance(api_params, dict) else "" + log.warning( + "BEDROCK_DIAGNOSTICS_REQUEST operation=%s modelId=%s param_keys=%s", + operation_name, + model_id, + param_keys, + ) + except Exception as e: + log.warning("BEDROCK_DIAGNOSTICS_REQUEST_ERROR %s", str(e)) + + +def _annotate_bedrock_response_metrics(model=None, http_response=None, parsed=None, context=None, **kwargs): + api_params = context.get(_BEDROCK_CONTEXT_KEY, {}) if isinstance(context, dict) else {} + usage = parsed.get("usage", {}) if isinstance(parsed, dict) else {} + + input_tokens = _usage_value(usage, "input_tokens", "inputTokens") + output_tokens = _usage_value(usage, "output_tokens", "outputTokens") + + if input_tokens is None: + request_text = _bedrock_request_text_from_params(api_params) + if request_text: + input_tokens = bedrock_tokeniser(request_text) + + if output_tokens is None: + response_text = _bedrock_response_text_from_parsed(parsed) + if response_text: + output_tokens = bedrock_tokeniser(response_text) + + if input_tokens is None or output_tokens is None: + span = tracer.current_span() + _log_bedrock_diagnostics(api_params=api_params, span=span) + return + + annotate_span_with_token_metrics( + model=_bedrock_model_from_params(api_params), + input_tokens=input_tokens, + output_tokens=output_tokens, + provider="bedrock", + ) + + span = tracer.current_span() + _log_bedrock_diagnostics(api_params=api_params, span=span) + + +def _register_bedrock_client_token_handlers(client): + meta = getattr(client, "meta", None) + if meta is None or getattr(meta, "service_model", None) is None: + return client + + if meta.service_model.service_name != "bedrock-runtime": + return client + + if getattr(meta, "_redbox_token_metrics_registered", False): + return client + + meta.events.register("before-call.bedrock-runtime", _capture_bedrock_request_for_metrics) + meta.events.register("after-call.bedrock-runtime", _annotate_bedrock_response_metrics) + meta._redbox_token_metrics_registered = True + return client + + +def ensure_bedrock_client_token_metrics(): + global _BEDROCK_CLIENT_PATCHED + + if _BEDROCK_CLIENT_PATCHED: + return + + original_boto3_client = boto3.client + original_session_client = boto3.session.Session.client + + @wraps(original_boto3_client) + def _patched_boto3_client(*args, **kwargs): + client = original_boto3_client(*args, **kwargs) + return _register_bedrock_client_token_handlers(client) + + @wraps(original_session_client) + def _patched_session_client(self, *args, **kwargs): + client = original_session_client(self, *args, **kwargs) + return _register_bedrock_client_token_handlers(client) + + boto3.client = _patched_boto3_client + boto3.session.Session.client = _patched_session_client + _BEDROCK_CLIENT_PATCHED = True + def bedrock_tokeniser_tokens(text: str) -> list[str]: # Simple tokeniser that counts the number of words in the text @@ -250,6 +581,13 @@ def to_request_metadata(obj: dict) -> RequestMetadata: except Exception: output_tokens = len(response[0].get("text", [])) + annotate_span_with_token_metrics( + model=model, + input_tokens=input_tokens, + output_tokens=output_tokens, + provider="bedrock", + ) + metadata_event = RequestMetadata( llm_calls=[ LLMCallMetadata( diff --git a/redbox/tests/test_transform.py b/redbox/tests/test_transform.py index dbeb512b2..5ca4fb1b6 100644 --- a/redbox/tests/test_transform.py +++ b/redbox/tests/test_transform.py @@ -1,6 +1,7 @@ import copy import itertools from datetime import UTC, datetime +from unittest.mock import MagicMock, patch from uuid import NAMESPACE_DNS, UUID, uuid5 import pytest @@ -8,6 +9,7 @@ from langchain_core.messages import AIMessage from langchain_core.runnables import RunnableLambda +import redbox.transform as transform from redbox.models.chain import DocumentState, LLMCallMetadata, RequestMetadata from redbox.retriever.retrievers import filter_by_elbow from redbox.test.data import generate_docs @@ -219,6 +221,54 @@ def test_to_request_metadata(output: dict, expected: RequestMetadata): ) +def test_to_request_metadata_tags_current_span(): + span = MagicMock() + output = { + "prompt": "Lorem ipsum dolor sit amet.", + "model": "anthropic.claude-3-7-sonnet-20250219-v1:0", + "text_and_tools": { + "raw_response": AIMessage(content="Lorem ipsum dolor sit amet, consectetur adipiscing elit.") + }, + } + + with patch("redbox.transform.tracer.current_span", return_value=span): + RunnableLambda(to_request_metadata).invoke(output) + + span.set_tag.assert_any_call("input_tokens", 6) + span.set_tag.assert_any_call("output_tokens", 10) + span.set_tag.assert_any_call("total_tokens", 16) + span.set_tag.assert_any_call("model", "anthropic.claude-3-7-sonnet-20250219-v1:0") + span.set_tag.assert_any_call("provider", "bedrock") + span.set_metric.assert_any_call("input_tokens", 6) + span.set_metric.assert_any_call("output_tokens", 10) + span.set_metric.assert_any_call("total_tokens", 16) + + +def test_bedrock_after_call_annotations_target_current_span(): + span = MagicMock() + context = {transform._BEDROCK_CONTEXT_KEY: {"modelId": "anthropic.claude-3-7-sonnet-20250219-v1:0"}} + parsed = {"usage": {"inputTokens": 8, "outputTokens": 13}} + + with patch("redbox.transform.tracer.current_span", return_value=span): + transform._annotate_bedrock_response_metrics(parsed=parsed, context=context) + + span.set_metric.assert_any_call("input_tokens", 8) + span.set_metric.assert_any_call("output_tokens", 13) + span.set_metric.assert_any_call("total_tokens", 21) + + +def test_register_bedrock_client_token_handlers_registers_once(): + client = MagicMock() + client.meta.service_model.service_name = "bedrock-runtime" + client.meta.events = MagicMock() + + transform._register_bedrock_client_token_handlers(client) + transform._register_bedrock_client_token_handlers(client) + + registered_events = [call.args[0] for call in client.meta.events.register.call_args_list] + assert registered_events == ["before-call.bedrock-runtime", "after-call.bedrock-runtime"] + + def test_structure_documents_by_file_name(): docs = list(generate_docs(s3_key="s3_key", total_tokens=1000, number_of_docs=3, chunk_resolution="normal")) expected = DocumentState(groups={uuid5(NAMESPACE_DNS, "s3_key"): {doc.metadata["uuid"]: doc for doc in docs}})