Skip to content

Commit fcd766c

Browse files
committed
Remove leading GET/ANY/etc. before http.route in API GW v2
1 parent 1b7aee3 commit fcd766c

12 files changed

+12
-12
lines changed

datadog_lambda/trigger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def extract_http_tags(event):
302302
# Try to get `routeKey` from API GW v2; otherwise try to get `resource` from API GW v1
303303
route = event.get("routeKey") or event.get("resource")
304304
if route:
305-
http_tags["http.route"] = route
305+
http_tags["http.route"] = route.split(" ")[-1]
306306

307307
return http_tags
308308

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
606606
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
607607
"http.url_details.path": "/httpapi/get",
608608
"http.method": "GET",
609-
"http.route": "GET /httpapi/get",
609+
"http.route": "/httpapi/get",
610610
"http.status_code": "200",
611611
"_dd.base_service": "integration-tests-python"
612612
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
606606
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
607607
"http.url_details.path": "/httpapi/get",
608608
"http.method": "GET",
609-
"http.route": "GET /httpapi/get",
609+
"http.route": "/httpapi/get",
610610
"http.status_code": "200",
611611
"_dd.base_service": "integration-tests-python"
612612
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
606606
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
607607
"http.url_details.path": "/httpapi/get",
608608
"http.method": "GET",
609-
"http.route": "GET /httpapi/get",
609+
"http.route": "/httpapi/get",
610610
"http.status_code": "200",
611611
"_dd.base_service": "integration-tests-python"
612612
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
606606
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
607607
"http.url_details.path": "/httpapi/get",
608608
"http.method": "GET",
609-
"http.route": "GET /httpapi/get",
609+
"http.route": "/httpapi/get",
610610
"http.status_code": "200",
611611
"_dd.base_service": "integration-tests-python"
612612
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
606606
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
607607
"http.url_details.path": "/httpapi/get",
608608
"http.method": "GET",
609-
"http.route": "GET /httpapi/get",
609+
"http.route": "/httpapi/get",
610610
"http.status_code": "200",
611611
"_dd.base_service": "integration-tests-python"
612612
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
643643
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
644644
"http.url_details.path": "/httpapi/get",
645645
"http.method": "GET",
646-
"http.route": "GET /httpapi/get",
646+
"http.route": "/httpapi/get",
647647
"http.status_code": "200",
648648
"_dd.base_service": "integration-tests-python"
649649
},

tests/integration/snapshots/logs/sync-metrics_python311.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
643643
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
644644
"http.url_details.path": "/httpapi/get",
645645
"http.method": "GET",
646-
"http.route": "GET /httpapi/get",
646+
"http.route": "/httpapi/get",
647647
"http.status_code": "200",
648648
"_dd.base_service": "integration-tests-python"
649649
},

tests/integration/snapshots/logs/sync-metrics_python312.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
643643
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
644644
"http.url_details.path": "/httpapi/get",
645645
"http.method": "GET",
646-
"http.route": "GET /httpapi/get",
646+
"http.route": "/httpapi/get",
647647
"http.status_code": "200",
648648
"_dd.base_service": "integration-tests-python"
649649
},

tests/integration/snapshots/logs/sync-metrics_python38.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A
643643
"http.url": "XXXX.execute-api.eu-west-1.amazonaws.com",
644644
"http.url_details.path": "/httpapi/get",
645645
"http.method": "GET",
646-
"http.route": "GET /httpapi/get",
646+
"http.route": "/httpapi/get",
647647
"http.status_code": "200",
648648
"_dd.base_service": "integration-tests-python"
649649
},

0 commit comments

Comments
 (0)