From 1d488f49995d2d78551fd3854fb70089a039da56 Mon Sep 17 00:00:00 2001 From: Nicholas Hulston Date: Fri, 25 Oct 2024 13:16:44 -0400 Subject: [PATCH 1/5] Add route tags --- datadog_lambda/trigger.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datadog_lambda/trigger.py b/datadog_lambda/trigger.py index 68531ebf..88ad045f 100644 --- a/datadog_lambda/trigger.py +++ b/datadog_lambda/trigger.py @@ -299,6 +299,11 @@ def extract_http_tags(event): if headers and headers.get("Referer"): http_tags["http.referer"] = headers.get("Referer") + # Try to get `routeKey` from API GW v2; otherwise try to get `resource` from API GW v1 + route = event.get("routeKey") or event.get("resource") + if route: + http_tags["http.route"] = route + return http_tags From 56bcdb3199c0eb1a0ff6b19bed503e506cdfaf70 Mon Sep 17 00:00:00 2001 From: Nicholas Hulston Date: Fri, 25 Oct 2024 13:24:42 -0400 Subject: [PATCH 2/5] update unit tests --- tests/test_trigger.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_trigger.py b/tests/test_trigger.py index 59178b1e..c08d4270 100644 --- a/tests/test_trigger.py +++ b/tests/test_trigger.py @@ -258,6 +258,7 @@ def test_extract_trigger_tags_api_gateway(self): "http.url": "70ixmpl4fl.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/prod/path/to/resource", "http.method": "POST", + "http.route": "/{proxy+}", }, ) @@ -276,6 +277,7 @@ def test_extract_trigger_tags_api_gateway_non_proxy(self): "http.url": "lgxbo6a518.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/dev/http/get", "http.method": "GET", + "http.route": "/http/get", }, ) @@ -342,6 +344,7 @@ def test_extract_trigger_tags_api_gateway_http_api(self): "http.url": "x02yirxc7a.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", }, ) From 1b7aee3bf04cf38fc0454b3d85ee1f4a2da433cb Mon Sep 17 00:00:00 2001 From: Nicholas Hulston Date: Fri, 25 Oct 2024 15:02:00 -0400 Subject: [PATCH 3/5] update snapshots --- tests/integration/snapshots/logs/async-metrics_python310.log | 2 ++ tests/integration/snapshots/logs/async-metrics_python311.log | 2 ++ tests/integration/snapshots/logs/async-metrics_python312.log | 2 ++ tests/integration/snapshots/logs/async-metrics_python38.log | 2 ++ tests/integration/snapshots/logs/async-metrics_python39.log | 2 ++ tests/integration/snapshots/logs/sync-metrics_python310.log | 2 ++ tests/integration/snapshots/logs/sync-metrics_python311.log | 2 ++ tests/integration/snapshots/logs/sync-metrics_python312.log | 2 ++ tests/integration/snapshots/logs/sync-metrics_python38.log | 2 ++ tests/integration/snapshots/logs/sync-metrics_python39.log | 2 ++ 10 files changed, 20 insertions(+) diff --git a/tests/integration/snapshots/logs/async-metrics_python310.log b/tests/integration/snapshots/logs/async-metrics_python310.log index 704e89b5..7012c528 100644 --- a/tests/integration/snapshots/logs/async-metrics_python310.log +++ b/tests/integration/snapshots/logs/async-metrics_python310.log @@ -106,6 +106,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -605,6 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/async-metrics_python311.log b/tests/integration/snapshots/logs/async-metrics_python311.log index b97628ac..96931ec7 100644 --- a/tests/integration/snapshots/logs/async-metrics_python311.log +++ b/tests/integration/snapshots/logs/async-metrics_python311.log @@ -106,6 +106,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -605,6 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/async-metrics_python312.log b/tests/integration/snapshots/logs/async-metrics_python312.log index 79dbefc1..96bcb290 100644 --- a/tests/integration/snapshots/logs/async-metrics_python312.log +++ b/tests/integration/snapshots/logs/async-metrics_python312.log @@ -106,6 +106,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -605,6 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/async-metrics_python38.log b/tests/integration/snapshots/logs/async-metrics_python38.log index 3b9d7c76..4dde8d58 100644 --- a/tests/integration/snapshots/logs/async-metrics_python38.log +++ b/tests/integration/snapshots/logs/async-metrics_python38.log @@ -106,6 +106,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -605,6 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/async-metrics_python39.log b/tests/integration/snapshots/logs/async-metrics_python39.log index 4e820246..4a97fcfe 100644 --- a/tests/integration/snapshots/logs/async-metrics_python39.log +++ b/tests/integration/snapshots/logs/async-metrics_python39.log @@ -106,6 +106,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -605,6 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python310.log b/tests/integration/snapshots/logs/sync-metrics_python310.log index 339c821c..6e364a02 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python310.log +++ b/tests/integration/snapshots/logs/sync-metrics_python310.log @@ -86,6 +86,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -642,6 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python311.log b/tests/integration/snapshots/logs/sync-metrics_python311.log index 878b0d64..d499a535 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python311.log +++ b/tests/integration/snapshots/logs/sync-metrics_python311.log @@ -86,6 +86,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -642,6 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python312.log b/tests/integration/snapshots/logs/sync-metrics_python312.log index c4dc17bc..093baacf 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python312.log +++ b/tests/integration/snapshots/logs/sync-metrics_python312.log @@ -86,6 +86,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -642,6 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python38.log b/tests/integration/snapshots/logs/sync-metrics_python38.log index 3e756430..adf44f42 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python38.log +++ b/tests/integration/snapshots/logs/sync-metrics_python38.log @@ -86,6 +86,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -642,6 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python39.log b/tests/integration/snapshots/logs/sync-metrics_python39.log index ceffe679..07bd5354 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python39.log +++ b/tests/integration/snapshots/logs/sync-metrics_python39.log @@ -86,6 +86,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.us-east-2.amazonaws.com", "http.url_details.path": "/Prod/", "http.method": "GET", + "http.route": "/", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, @@ -642,6 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", + "http.route": "GET /httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, From fcd766cf0798772e6d5a863f8ee333d9dd0e94b6 Mon Sep 17 00:00:00 2001 From: Nicholas Hulston Date: Tue, 29 Oct 2024 10:25:41 -0400 Subject: [PATCH 4/5] Remove leading GET/ANY/etc. before `http.route` in API GW v2 --- datadog_lambda/trigger.py | 2 +- tests/integration/snapshots/logs/async-metrics_python310.log | 2 +- tests/integration/snapshots/logs/async-metrics_python311.log | 2 +- tests/integration/snapshots/logs/async-metrics_python312.log | 2 +- tests/integration/snapshots/logs/async-metrics_python38.log | 2 +- tests/integration/snapshots/logs/async-metrics_python39.log | 2 +- tests/integration/snapshots/logs/sync-metrics_python310.log | 2 +- tests/integration/snapshots/logs/sync-metrics_python311.log | 2 +- tests/integration/snapshots/logs/sync-metrics_python312.log | 2 +- tests/integration/snapshots/logs/sync-metrics_python38.log | 2 +- tests/integration/snapshots/logs/sync-metrics_python39.log | 2 +- tests/test_trigger.py | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/datadog_lambda/trigger.py b/datadog_lambda/trigger.py index 88ad045f..711e9f0c 100644 --- a/datadog_lambda/trigger.py +++ b/datadog_lambda/trigger.py @@ -302,7 +302,7 @@ def extract_http_tags(event): # Try to get `routeKey` from API GW v2; otherwise try to get `resource` from API GW v1 route = event.get("routeKey") or event.get("resource") if route: - http_tags["http.route"] = route + http_tags["http.route"] = route.split(" ")[-1] return http_tags diff --git a/tests/integration/snapshots/logs/async-metrics_python310.log b/tests/integration/snapshots/logs/async-metrics_python310.log index 7012c528..40c23c68 100644 --- a/tests/integration/snapshots/logs/async-metrics_python310.log +++ b/tests/integration/snapshots/logs/async-metrics_python310.log @@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/async-metrics_python311.log b/tests/integration/snapshots/logs/async-metrics_python311.log index 96931ec7..f1f12db4 100644 --- a/tests/integration/snapshots/logs/async-metrics_python311.log +++ b/tests/integration/snapshots/logs/async-metrics_python311.log @@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/async-metrics_python312.log b/tests/integration/snapshots/logs/async-metrics_python312.log index 96bcb290..3bc69cca 100644 --- a/tests/integration/snapshots/logs/async-metrics_python312.log +++ b/tests/integration/snapshots/logs/async-metrics_python312.log @@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/async-metrics_python38.log b/tests/integration/snapshots/logs/async-metrics_python38.log index 4dde8d58..fdc6b192 100644 --- a/tests/integration/snapshots/logs/async-metrics_python38.log +++ b/tests/integration/snapshots/logs/async-metrics_python38.log @@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/async-metrics_python39.log b/tests/integration/snapshots/logs/async-metrics_python39.log index 4a97fcfe..c6c68290 100644 --- a/tests/integration/snapshots/logs/async-metrics_python39.log +++ b/tests/integration/snapshots/logs/async-metrics_python39.log @@ -606,7 +606,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python310.log b/tests/integration/snapshots/logs/sync-metrics_python310.log index 6e364a02..5d9262ce 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python310.log +++ b/tests/integration/snapshots/logs/sync-metrics_python310.log @@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python311.log b/tests/integration/snapshots/logs/sync-metrics_python311.log index d499a535..e93a4d0e 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python311.log +++ b/tests/integration/snapshots/logs/sync-metrics_python311.log @@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python312.log b/tests/integration/snapshots/logs/sync-metrics_python312.log index 093baacf..c912cede 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python312.log +++ b/tests/integration/snapshots/logs/sync-metrics_python312.log @@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python38.log b/tests/integration/snapshots/logs/sync-metrics_python38.log index adf44f42..74a1e06b 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python38.log +++ b/tests/integration/snapshots/logs/sync-metrics_python38.log @@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/integration/snapshots/logs/sync-metrics_python39.log b/tests/integration/snapshots/logs/sync-metrics_python39.log index 07bd5354..19f0e84c 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python39.log +++ b/tests/integration/snapshots/logs/sync-metrics_python39.log @@ -643,7 +643,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate","A "http.url": "XXXX.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", "http.status_code": "200", "_dd.base_service": "integration-tests-python" }, diff --git a/tests/test_trigger.py b/tests/test_trigger.py index c08d4270..c1e7f5d7 100644 --- a/tests/test_trigger.py +++ b/tests/test_trigger.py @@ -344,7 +344,7 @@ def test_extract_trigger_tags_api_gateway_http_api(self): "http.url": "x02yirxc7a.execute-api.eu-west-1.amazonaws.com", "http.url_details.path": "/httpapi/get", "http.method": "GET", - "http.route": "GET /httpapi/get", + "http.route": "/httpapi/get", }, ) From eaa81ac316cd0f9f9b44747c136b22edf8fa7601 Mon Sep 17 00:00:00 2001 From: Nicholas Hulston Date: Tue, 29 Oct 2024 10:27:09 -0400 Subject: [PATCH 5/5] Add comment --- datadog_lambda/trigger.py | 1 + 1 file changed, 1 insertion(+) diff --git a/datadog_lambda/trigger.py b/datadog_lambda/trigger.py index 711e9f0c..64eff1a0 100644 --- a/datadog_lambda/trigger.py +++ b/datadog_lambda/trigger.py @@ -302,6 +302,7 @@ def extract_http_tags(event): # Try to get `routeKey` from API GW v2; otherwise try to get `resource` from API GW v1 route = event.get("routeKey") or event.get("resource") if route: + # "GET /my/endpoint" = > "/my/endpoint" http_tags["http.route"] = route.split(" ")[-1] return http_tags