Skip to content

Commit 2953548

Browse files
authored
feat: Pin dd trace below 2 (#374)
* feat: Pin dd trace below 2 * feat: poetry install * feat: Fix call to MagicMock which causes ddtrace to fail msgpacking. Replace with a real span. * feat: Update snapshots * feat: strip binaries * feat: whitespace to appease editor lint
1 parent 962813a commit 2953548

14 files changed

+888
-509
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ RUN find ./python/lib/$runtime/site-packages -name \*.pyc -delete
1616

1717
# Remove botocore (40MB) to reduce package size. aws-xray-sdk
1818
# installs it, while it's already provided by the Lambda Runtime.
19+
RUN find . -name '*.so' -exec strip -g {} \;
20+
1921
RUN rm -rf ./python/lib/$runtime/site-packages/botocore*
2022
RUN rm -rf ./python/lib/$runtime/site-packages/setuptools
2123
RUN rm -rf ./python/lib/$runtime/site-packages/jsonschema/tests

poetry.lock

Lines changed: 208 additions & 190 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers = [
2727
python = ">=3.7.0,<4"
2828
datadog = ">=0.41.0,<1.0.0"
2929
wrapt = "^1.11.2"
30-
ddtrace = "1.15.2"
30+
ddtrace = "<2.0.0"
3131
urllib3 = "<2.0.0"
3232
importlib_metadata = {version = "*", python = "<3.8"}
3333
boto3 = { version = "^1.10.33", optional = true }

tests/integration/snapshots/logs/async-metrics_python310.log

Lines changed: 63 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
6868
"http.status_code": "200",
6969
"peer.service": "integration-tests-python",
7070
"_dd.p.dm": "-0",
71-
"language": "python"
71+
"language": "python",
72+
"_dd.peer.service.source": "peer.service",
73+
"_dd.base_service": "integration-tests-python"
7274
},
7375
"metrics": {
7476
"process_id": XXXX,
75-
"_dd.agent_psr": 1,
7677
"_dd.top_level": 1,
7778
"_sampling_priority_v1": 1
7879
},
@@ -104,7 +105,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
104105
"http.url": "XXXX.execute-api.us-east-2.amazonaws.com",
105106
"http.url_details.path": "/Prod/",
106107
"http.method": "GET",
107-
"http.status_code": "200"
108+
"http.status_code": "200",
109+
"_dd.base_service": "integration-tests-python"
108110
},
109111
"metrics": {
110112
"_dd.top_level": 1
@@ -127,6 +129,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
127129
"span.kind": "client",
128130
"http.method": "GET",
129131
"http.url": "https://datadoghq.com/",
132+
"out.host": "datadoghq.com",
130133
"http.status_code": "200",
131134
"http.useragent": "python-requests/X.X.X"
132135
},
@@ -152,6 +155,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
152155
"span.kind": "client",
153156
"http.method": "GET",
154157
"http.url": "https://www.datadoghq.com/",
158+
"out.host": "www.datadoghq.com",
155159
"http.status_code": "200",
156160
"http.useragent": "python-requests/X.X.X"
157161
},
@@ -232,11 +236,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
232236
"_inferred_span.tag_source": "self",
233237
"peer.service": "integration-tests-python",
234238
"_dd.p.dm": "-0",
235-
"language": "python"
239+
"language": "python",
240+
"_dd.peer.service.source": "peer.service",
241+
"_dd.base_service": "integration-tests-python"
236242
},
237243
"metrics": {
238244
"process_id": XXXX,
239-
"_dd.agent_psr": 1,
240245
"_dd.top_level": 1,
241246
"_sampling_priority_v1": 1
242247
},
@@ -264,7 +269,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
264269
"dd_trace": "X.X.X",
265270
"span.name": "aws.lambda",
266271
"function_trigger.event_source": "dynamodb",
267-
"function_trigger.event_source_arn": "XXXX"
272+
"function_trigger.event_source_arn": "XXXX",
273+
"_dd.base_service": "integration-tests-python"
268274
},
269275
"metrics": {
270276
"_dd.top_level": 1
@@ -287,6 +293,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
287293
"span.kind": "client",
288294
"http.method": "GET",
289295
"http.url": "https://datadoghq.com/",
296+
"out.host": "datadoghq.com",
290297
"http.status_code": "200",
291298
"http.useragent": "python-requests/X.X.X"
292299
},
@@ -312,6 +319,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
312319
"span.kind": "client",
313320
"http.method": "GET",
314321
"http.url": "https://www.datadoghq.com/",
322+
"out.host": "www.datadoghq.com",
315323
"http.status_code": "200",
316324
"http.useragent": "python-requests/X.X.X"
317325
},
@@ -386,11 +394,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
386394
"_inferred_span.tag_source": "self",
387395
"peer.service": "integration-tests-python",
388396
"_dd.p.dm": "-0",
389-
"language": "python"
397+
"language": "python",
398+
"_dd.peer.service.source": "peer.service",
399+
"_dd.base_service": "integration-tests-python"
390400
},
391401
"metrics": {
392402
"process_id": XXXX,
393-
"_dd.agent_psr": 1,
394403
"_dd.top_level": 1,
395404
"_sampling_priority_v1": 1
396405
},
@@ -417,7 +426,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
417426
"datadog_lambda": "X.X.X",
418427
"dd_trace": "X.X.X",
419428
"span.name": "aws.lambda",
420-
"function_trigger.event_source": "eventbridge"
429+
"function_trigger.event_source": "eventbridge",
430+
"_dd.base_service": "integration-tests-python"
421431
},
422432
"metrics": {
423433
"_dd.top_level": 1
@@ -440,6 +450,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
440450
"span.kind": "client",
441451
"http.method": "GET",
442452
"http.url": "https://datadoghq.com/",
453+
"out.host": "datadoghq.com",
443454
"http.status_code": "200",
444455
"http.useragent": "python-requests/X.X.X"
445456
},
@@ -465,6 +476,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
465476
"span.kind": "client",
466477
"http.method": "GET",
467478
"http.url": "https://www.datadoghq.com/",
479+
"out.host": "www.datadoghq.com",
468480
"http.status_code": "200",
469481
"http.useragent": "python-requests/X.X.X"
470482
},
@@ -549,11 +561,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
549561
"http.status_code": "200",
550562
"peer.service": "integration-tests-python",
551563
"_dd.p.dm": "-0",
552-
"language": "python"
564+
"language": "python",
565+
"_dd.peer.service.source": "peer.service",
566+
"_dd.base_service": "integration-tests-python"
553567
},
554568
"metrics": {
555569
"process_id": XXXX,
556-
"_dd.agent_psr": 1,
557570
"_dd.top_level": 1,
558571
"_sampling_priority_v1": 1
559572
},
@@ -585,7 +598,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
585598
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
586599
"http.url_details.path": "/httpapi/get",
587600
"http.method": "GET",
588-
"http.status_code": "200"
601+
"http.status_code": "200",
602+
"_dd.base_service": "integration-tests-python"
589603
},
590604
"metrics": {
591605
"_dd.top_level": 1
@@ -608,6 +622,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
608622
"span.kind": "client",
609623
"http.method": "GET",
610624
"http.url": "https://datadoghq.com/",
625+
"out.host": "datadoghq.com",
611626
"http.status_code": "200",
612627
"http.useragent": "python-requests/X.X.X"
613628
},
@@ -633,6 +648,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
633648
"span.kind": "client",
634649
"http.method": "GET",
635650
"http.url": "https://www.datadoghq.com/",
651+
"out.host": "www.datadoghq.com",
636652
"http.status_code": "200",
637653
"http.useragent": "python-requests/X.X.X"
638654
},
@@ -713,11 +729,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
713729
"_inferred_span.tag_source": "self",
714730
"peer.service": "integration-tests-python",
715731
"_dd.p.dm": "-0",
716-
"language": "python"
732+
"language": "python",
733+
"_dd.peer.service.source": "peer.service",
734+
"_dd.base_service": "integration-tests-python"
717735
},
718736
"metrics": {
719737
"process_id": XXXX,
720-
"_dd.agent_psr": 1,
721738
"_dd.top_level": 1,
722739
"_sampling_priority_v1": 1
723740
},
@@ -745,7 +762,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
745762
"dd_trace": "X.X.X",
746763
"span.name": "aws.lambda",
747764
"function_trigger.event_source": "kinesis",
748-
"function_trigger.event_source_arn": "XXXX"
765+
"function_trigger.event_source_arn": "XXXX",
766+
"_dd.base_service": "integration-tests-python"
749767
},
750768
"metrics": {
751769
"_dd.top_level": 1
@@ -768,6 +786,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
768786
"span.kind": "client",
769787
"http.method": "GET",
770788
"http.url": "https://datadoghq.com/",
789+
"out.host": "datadoghq.com",
771790
"http.status_code": "200",
772791
"http.useragent": "python-requests/X.X.X"
773792
},
@@ -793,6 +812,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
793812
"span.kind": "client",
794813
"http.method": "GET",
795814
"http.url": "https://www.datadoghq.com/",
815+
"out.host": "www.datadoghq.com",
796816
"http.status_code": "200",
797817
"http.useragent": "python-requests/X.X.X"
798818
},
@@ -870,11 +890,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
870890
"_inferred_span.tag_source": "self",
871891
"peer.service": "integration-tests-python",
872892
"_dd.p.dm": "-0",
873-
"language": "python"
893+
"language": "python",
894+
"_dd.peer.service.source": "peer.service",
895+
"_dd.base_service": "integration-tests-python"
874896
},
875897
"metrics": {
876898
"process_id": XXXX,
877-
"_dd.agent_psr": 1,
878899
"_dd.top_level": 1,
879900
"_sampling_priority_v1": 1
880901
},
@@ -902,7 +923,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
902923
"dd_trace": "X.X.X",
903924
"span.name": "aws.lambda",
904925
"function_trigger.event_source": "s3",
905-
"function_trigger.event_source_arn": "XXXX"
926+
"function_trigger.event_source_arn": "XXXX",
927+
"_dd.base_service": "integration-tests-python"
906928
},
907929
"metrics": {
908930
"_dd.top_level": 1
@@ -925,6 +947,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
925947
"span.kind": "client",
926948
"http.method": "GET",
927949
"http.url": "https://datadoghq.com/",
950+
"out.host": "datadoghq.com",
928951
"http.status_code": "200",
929952
"http.useragent": "python-requests/X.X.X"
930953
},
@@ -950,6 +973,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
950973
"span.kind": "client",
951974
"http.method": "GET",
952975
"http.url": "https://www.datadoghq.com/",
976+
"out.host": "www.datadoghq.com",
953977
"http.status_code": "200",
954978
"http.useragent": "python-requests/X.X.X"
955979
},
@@ -1028,11 +1052,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
10281052
"_inferred_span.tag_source": "self",
10291053
"peer.service": "integration-tests-python",
10301054
"_dd.p.dm": "-0",
1031-
"language": "python"
1055+
"language": "python",
1056+
"_dd.peer.service.source": "peer.service",
1057+
"_dd.base_service": "integration-tests-python"
10321058
},
10331059
"metrics": {
10341060
"process_id": XXXX,
1035-
"_dd.agent_psr": 1,
10361061
"_dd.top_level": 1,
10371062
"_sampling_priority_v1": 1
10381063
},
@@ -1060,7 +1085,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
10601085
"dd_trace": "X.X.X",
10611086
"span.name": "aws.lambda",
10621087
"function_trigger.event_source": "sns",
1063-
"function_trigger.event_source_arn": "XXXX"
1088+
"function_trigger.event_source_arn": "XXXX",
1089+
"_dd.base_service": "integration-tests-python"
10641090
},
10651091
"metrics": {
10661092
"_dd.top_level": 1
@@ -1083,6 +1109,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
10831109
"span.kind": "client",
10841110
"http.method": "GET",
10851111
"http.url": "https://datadoghq.com/",
1112+
"out.host": "datadoghq.com",
10861113
"http.status_code": "200",
10871114
"http.useragent": "python-requests/X.X.X"
10881115
},
@@ -1108,6 +1135,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
11081135
"span.kind": "client",
11091136
"http.method": "GET",
11101137
"http.url": "https://www.datadoghq.com/",
1138+
"out.host": "www.datadoghq.com",
11111139
"http.status_code": "200",
11121140
"http.useragent": "python-requests/X.X.X"
11131141
},
@@ -1185,11 +1213,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
11851213
"_inferred_span.tag_source": "self",
11861214
"peer.service": "integration-tests-python",
11871215
"_dd.p.dm": "-0",
1188-
"language": "python"
1216+
"language": "python",
1217+
"_dd.peer.service.source": "peer.service",
1218+
"_dd.base_service": "integration-tests-python"
11891219
},
11901220
"metrics": {
11911221
"process_id": XXXX,
1192-
"_dd.agent_psr": 1,
11931222
"_dd.top_level": 1,
11941223
"_sampling_priority_v1": 1
11951224
},
@@ -1217,7 +1246,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
12171246
"dd_trace": "X.X.X",
12181247
"span.name": "aws.lambda",
12191248
"function_trigger.event_source": "sqs",
1220-
"function_trigger.event_source_arn": "XXXX"
1249+
"function_trigger.event_source_arn": "XXXX",
1250+
"_dd.base_service": "integration-tests-python"
12211251
},
12221252
"metrics": {
12231253
"_dd.top_level": 1
@@ -1240,6 +1270,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
12401270
"span.kind": "client",
12411271
"http.method": "GET",
12421272
"http.url": "https://datadoghq.com/",
1273+
"out.host": "datadoghq.com",
12431274
"http.status_code": "200",
12441275
"http.useragent": "python-requests/X.X.X"
12451276
},
@@ -1265,6 +1296,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
12651296
"span.kind": "client",
12661297
"http.method": "GET",
12671298
"http.url": "https://www.datadoghq.com/",
1299+
"out.host": "www.datadoghq.com",
12681300
"http.status_code": "200",
12691301
"http.useragent": "python-requests/X.X.X"
12701302
},
@@ -1348,11 +1380,12 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
13481380
"http.status_code": "200",
13491381
"peer.service": "integration-tests-python",
13501382
"_dd.p.dm": "-0",
1351-
"language": "python"
1383+
"language": "python",
1384+
"_dd.peer.service.source": "peer.service",
1385+
"_dd.base_service": "integration-tests-python"
13521386
},
13531387
"metrics": {
13541388
"process_id": XXXX,
1355-
"_dd.agent_psr": 1,
13561389
"_dd.top_level": 1,
13571390
"_sampling_priority_v1": 1
13581391
},
@@ -1382,7 +1415,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
13821415
"function_trigger.event_source": "api-gateway",
13831416
"function_trigger.event_source_arn": "XXXX",
13841417
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
1385-
"http.status_code": "200"
1418+
"http.status_code": "200",
1419+
"_dd.base_service": "integration-tests-python"
13861420
},
13871421
"metrics": {
13881422
"_dd.top_level": 1
@@ -1405,6 +1439,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
14051439
"span.kind": "client",
14061440
"http.method": "GET",
14071441
"http.url": "https://datadoghq.com/",
1442+
"out.host": "datadoghq.com",
14081443
"http.status_code": "200",
14091444
"http.useragent": "python-requests/X.X.X"
14101445
},
@@ -1430,6 +1465,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", "
14301465
"span.kind": "client",
14311466
"http.method": "GET",
14321467
"http.url": "https://www.datadoghq.com/",
1468+
"out.host": "www.datadoghq.com",
14331469
"http.status_code": "200",
14341470
"http.useragent": "python-requests/X.X.X"
14351471
},

0 commit comments

Comments
 (0)