Skip to content

Commit 30716c2

Browse files
committed
update http.url in trigger tags
1 parent d8acff0 commit 30716c2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

datadog_lambda/trigger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def extract_http_tags(event):
301301
if request_context and request_context.get("stage"):
302302
domain_name = request_context.get("domainName")
303303
if domain_name:
304-
http_tags["http.url"] = domain_name
304+
http_tags["http.url"] = f"https://{domain_name}"
305305

306306
path = request_context.get("path")
307307
method = request_context.get("httpMethod")

tests/test_trigger.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def test_extract_trigger_tags_api_gateway(self):
294294
{
295295
"function_trigger.event_source": "api-gateway",
296296
"function_trigger.event_source_arn": "arn:aws:apigateway:us-west-1::/restapis/1234567890/stages/prod",
297-
"http.url": "70ixmpl4fl.execute-api.us-east-2.amazonaws.com",
297+
"http.url": "https://70ixmpl4fl.execute-api.us-east-2.amazonaws.com",
298298
"http.url_details.path": "/prod/path/to/resource",
299299
"http.method": "POST",
300300
"http.route": "/{proxy+}",
@@ -313,7 +313,7 @@ def test_extract_trigger_tags_api_gateway_non_proxy(self):
313313
{
314314
"function_trigger.event_source": "api-gateway",
315315
"function_trigger.event_source_arn": "arn:aws:apigateway:us-west-1::/restapis/lgxbo6a518/stages/dev",
316-
"http.url": "lgxbo6a518.execute-api.eu-west-1.amazonaws.com",
316+
"http.url": "https://lgxbo6a518.execute-api.eu-west-1.amazonaws.com",
317317
"http.url_details.path": "/dev/http/get",
318318
"http.method": "GET",
319319
"http.route": "/http/get",
@@ -332,7 +332,7 @@ def test_extract_trigger_tags_api_gateway_websocket_connect(self):
332332
{
333333
"function_trigger.event_source": "api-gateway",
334334
"function_trigger.event_source_arn": "arn:aws:apigateway:us-west-1::/restapis/p62c47itsb/stages/dev",
335-
"http.url": "p62c47itsb.execute-api.eu-west-1.amazonaws.com",
335+
"http.url": "https://p62c47itsb.execute-api.eu-west-1.amazonaws.com",
336336
},
337337
)
338338

@@ -348,7 +348,7 @@ def test_extract_trigger_tags_api_gateway_websocket_default(self):
348348
{
349349
"function_trigger.event_source": "api-gateway",
350350
"function_trigger.event_source_arn": "arn:aws:apigateway:us-west-1::/restapis/p62c47itsb/stages/dev",
351-
"http.url": "p62c47itsb.execute-api.eu-west-1.amazonaws.com",
351+
"http.url": "https://p62c47itsb.execute-api.eu-west-1.amazonaws.com",
352352
},
353353
)
354354

@@ -364,7 +364,7 @@ def test_extract_trigger_tags_api_gateway_websocket_disconnect(self):
364364
{
365365
"function_trigger.event_source": "api-gateway",
366366
"function_trigger.event_source_arn": "arn:aws:apigateway:us-west-1::/restapis/p62c47itsb/stages/dev",
367-
"http.url": "p62c47itsb.execute-api.eu-west-1.amazonaws.com",
367+
"http.url": "https://p62c47itsb.execute-api.eu-west-1.amazonaws.com",
368368
},
369369
)
370370

@@ -380,7 +380,7 @@ def test_extract_trigger_tags_api_gateway_http_api(self):
380380
{
381381
"function_trigger.event_source": "api-gateway",
382382
"function_trigger.event_source_arn": "arn:aws:apigateway:us-west-1::/restapis/x02yirxc7a/stages/$default",
383-
"http.url": "x02yirxc7a.execute-api.eu-west-1.amazonaws.com",
383+
"http.url": "https://x02yirxc7a.execute-api.eu-west-1.amazonaws.com",
384384
"http.url_details.path": "/httpapi/get",
385385
"http.method": "GET",
386386
"http.route": "/httpapi/get",

tests/test_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def test_5xx_sends_errors_metric_and_set_tags(self, mock_extract_trigger_tags):
283283
mock_extract_trigger_tags.return_value = {
284284
"function_trigger.event_source": "api-gateway",
285285
"function_trigger.event_source_arn": "arn:aws:apigateway:us-west-1::/restapis/1234567890/stages/prod",
286-
"http.url": "70ixmpl4fl.execute-api.us-east-2.amazonaws.com",
286+
"http.url": "https://70ixmpl4fl.execute-api.us-east-2.amazonaws.com",
287287
"http.url_details.path": "/prod/path/to/resource",
288288
"http.method": "GET",
289289
}

0 commit comments

Comments
 (0)