Skip to content

Commit b9f4164

Browse files
authored
[SLS-1697] Update Forwarder to handle inferred spans differently (#512)
* Add unit tests for inferred spans * Add check for external inferred spans * Add end to end forwarder unit test
1 parent 060c54c commit b9f4164

File tree

7 files changed

+1849
-0
lines changed

7 files changed

+1849
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"messageType": "DATA_MESSAGE",
3+
"owner": "601427279990",
4+
"logGroup": "/aws/lambda/hello-dog-node-dev-hello12x",
5+
"logStream": "2020/03/05/[$LATEST]20bddfd5a2dc4c6b97ac02800eae90d0",
6+
"subscriptionFilters": [
7+
"hello-dog-node-dev-hello12x"
8+
],
9+
"logEvents": [
10+
{
11+
"id": "35311576111948622874033876462979853992919938886093242368",
12+
"timestamp": 1583425836114,
13+
"message": "2020-03-05T16:30:36.113Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=3172564172058669914 dd.span_id=14292093692483532556] {\"status\":\"debug\",\"message\":\"datadog:Patched console output with trace context\"}\n"
14+
},
15+
{
16+
"id": "35311576111948622874033876462979853992919938886093242369",
17+
"timestamp": 1583425836114,
18+
"message": "2020-03-05T16:30:36.114Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=3172564172058669914 dd.span_id=14292093692483532556] {\"autoPatchHTTP\":true,\"tracerInitialized\":true,\"status\":\"debug\",\"message\":\"datadog:Not patching HTTP libraries\"}\n"
19+
},
20+
{
21+
"id": "35311576111948622874033876462979853992919938886093242370",
22+
"timestamp": 1583425836114,
23+
"message": "2020-03-05T16:30:36.114Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=3172564172058669914 dd.span_id=14292093692483532556] {\"status\":\"debug\",\"message\":\"datadog:Reading trace context from env var Root=1-5e61292c-cc1229a4dfbeae1043928548;Parent=c657b77d9514f70c;Sampled=1\"}\n"
24+
},
25+
{
26+
"id": "35311576111948622874033876462979853992919938886093242371",
27+
"timestamp": 1583425836114,
28+
"message": "2020-03-05T16:30:36.114Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=3172564172058669914 dd.span_id=14292093692483532556] {\"parentID\":\"14292093692483532556\",\"sampleMode\":2,\"source\":\"xray\",\"traceID\":\"6899143064054564168\",\"status\":\"debug\",\"message\":\"datadog:read trace context from environment\"}\n"
29+
},
30+
{
31+
"id": "35311576111948622874033876462979853992919938886093242372",
32+
"timestamp": 1583425836114,
33+
"message": "{\"e\":1583425836.114,\"m\":\"aws.lambda.enhanced.invocations\",\"t\":[\"region:us-east-1\",\"account_id:601427279990\",\"functionname:hello-dog-node-dev-hello12x\",\"cold_start:false\",\"memorysize:128\",\"runtime:nodejs12.x\"],\"v\":1}\n"
34+
},
35+
{
36+
"id": "35311576112305434797210366433244425485282312670188929029",
37+
"timestamp": 1583425836130,
38+
"message": "2020-03-05T16:30:36.130Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=6899143064054564168 dd.span_id=14292093692483532556] {\"status\":\"debug\",\"message\":\"datadog:set trace context from xray with parent 14292093692483532556 from segment\"}\n"
39+
},
40+
{
41+
"id": "35311576113197464605151591358905854216188247130428145670",
42+
"timestamp": 1583425836170,
43+
"message": "2020-03-05T16:30:36.131Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=6899143064054564168 dd.span_id=14292093692483532556] {\"status\":\"debug\",\"message\":\"datadog:set trace context from xray with parent 14292093692483532556 from segment\"}\n"
44+
},
45+
{
46+
"id": "35311576113197464605151591358905854216188247130428145671",
47+
"timestamp": 1583425836170,
48+
"message": "2020-03-05T16:30:36.131Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=6899143064054564168 dd.span_id=14292093692483532556] {\"status\":\"debug\",\"message\":\"datadog:set trace context from xray with parent 14292093692483532556 from segment\"}\n"
49+
},
50+
{
51+
"id": "35311576113197464605151591358905854216188247130428145672",
52+
"timestamp": 1583425836170,
53+
"message": "2020-03-05T16:30:36.131Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=6899143064054564168 dd.span_id=14292093692483532556] {\"status\":\"debug\",\"message\":\"datadog:set trace context from xray with parent 14292093692483532556 from segment\"}\n"
54+
},
55+
{
56+
"id": "35311576113197464605151591358905854216188247130428145673",
57+
"timestamp": 1583425836170,
58+
"message": "2020-03-05T16:30:36.131Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=6899143064054564168 dd.span_id=14292093692483532556] {\"status\":\"debug\",\"message\":\"datadog:Attempting to find parent for datadog trace trace\"}\n"
59+
},
60+
{
61+
"id": "35311576113197464605151591358905854216188247130428145674",
62+
"timestamp": 1583425836170,
63+
"message": "2020-03-05T16:30:36.131Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDEBUG\t[dd.trace_id=6899143064054564168 dd.span_id=14292093692483532556] {\"status\":\"debug\",\"message\":\"datadog:Applying lambda context to datadog traces\"}\n"
64+
},
65+
{
66+
"id": "35311576113643479509122203821736568581641214360547753995",
67+
"timestamp": 1583425836190,
68+
"message": "2020-03-05T16:30:36.172Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tINFO\t[dd.trace_id=6899143064054564168 dd.span_id=2927617725217152879] Request Headers undefined\n"
69+
},
70+
{
71+
"id": "35311576113643479509122203821736568581641214360547753996",
72+
"timestamp": 1583425836190,
73+
"message": "2020-03-05T16:30:36.172Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tINFO\t[dd.trace_id=6899143064054564168 dd.span_id=2927617725217152879] Root=1-5e61292c-cc1229a4dfbeae1043928548;Parent=c657b77d9514f70c;Sampled=1\n"
74+
},
75+
{
76+
"id": "35311576113643479509122203821736568581641214360547753997",
77+
"timestamp": 1583425836190,
78+
"message": "{\"e\":1583425836.172,\"m\":\"hello.js10x.dog-2\",\"t\":[\"dd_lambda_layer:datadog-nodev12.14.1\"],\"v\":10}\n"
79+
},
80+
{
81+
"id": "35311576123455807396475678004012284621606493423179137038",
82+
"timestamp": 1583425836630,
83+
"message": "2020-03-05T16:30:36.592Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tINFO\t[dd.trace_id=6899143064054564168 dd.span_id=3694123456155101779] 8103.047457805628\n"
84+
},
85+
{
86+
"id": "35311576123478108141674208627153820339879141784685117455",
87+
"timestamp": 1583425836631,
88+
"message": "2020-03-05T16:30:36.631Z\tf08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tINFO\t[dd.trace_id=6899143064054564168 dd.span_id=2927617725217152879] Finishing Span\n"
89+
},
90+
{
91+
"id": "35311576125685881916328740318165856448871329573777178640",
92+
"timestamp": 1583425836730,
93+
"message": "{\"traces\": [[{\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"0000000000000000\", \"span_id\": \"A812B5E71D1C5417\", \"service\": \"ialbefmodl.execute-api.sa-east-1.amazonaws.com\", \"resource\": \"ialbefmodl.execute-api.sa-east-1.amazonaws.com/\", \"name\": \"aws.apigateway\", \"error\": 0, \"start\": 1636820292450000128, \"duration\": 149992638, \"meta\": {\"runtime-id\": \"810d8797397b4a8c94ca00582b397222\", \"_dd.origin\": \"lambda\", \"operation_name\": \"aws.apigateway.rest\", \"http.url\": \"ialbefmodl.execute-api.sa-east-1.amazonaws.com/\", \"endpoint\": \"/\", \"http.method\": \"GET\", \"resource_names\": \"ialbefmodl.execute-api.sa-east-1.amazonaws.com/\", \"request_id\": \"9f09f496-83c7-441b-bc59-9741107b0683\", \"inferred_span.inherit_lambda\": \"False\", \"inferred_span.is_async\": \"False\", \"http.status_code\": \"200\"}, \"metrics\": {\"_dd.agent_psr\": 1, \"system.pid\": 9, \"_sampling_priority_v1\": 1}, \"type\": \"http\"}, {\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"A812B5E71D1C5417\", \"span_id\": \"080EE818C637C434\", \"service\": \"aws.lambda\", \"resource\": \"inferred-spans-python-dev-initSender\", \"name\": \"aws.lambda\", \"error\": 0, \"start\": 1636820292466458058, \"duration\": 133507715, \"meta\": {\"_dd.origin\": \"lambda\", \"cold_start\": \"false\", \"function_arn\": \"arn:aws:lambda:sa-east-1:601427279990:function:inferred-spans-python-dev-initsender\", \"function_version\": \"$LATEST\", \"request_id\": \"9f09f496-83c7-441b-bc59-9741107b0683\", \"resource_names\": \"inferred-spans-python-dev-initSender\", \"functionname\": \"inferred-spans-python-dev-initsender\", \"datadog_lambda\": \"3.49.0\", \"dd_trace\": \"0.50.4\", \"span.name\": \"aws.lambda\", \"function_trigger.event_source\": \"api-gateway\", \"function_trigger.event_source_arn\": \"arn:aws:apigateway:sa-east-1::/restapis/ialbefmodl/stages/dev\", \"http.url\": \"ialbefmodl.execute-api.sa-east-1.amazonaws.com\", \"http.url_details.path\": \"/dev/\", \"http.method\": \"GET\", \"http.status_code\": \"200\"}, \"type\": \"serverless\"}, {\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"080EE818C637C434\", \"span_id\": \"1E1CBE25CBABD2AD\", \"service\": \"aws.sqs\", \"resource\": \"sqs.sendmessage\", \"name\": \"sqs.command\", \"error\": 0, \"start\": 1636820292466887097, \"duration\": 19825652, \"meta\": {\"_dd.origin\": \"lambda\", \"params.MessageAttributes._datadog.StringValue\": \"{\\\"x-datadog-trace-id\\\": \\\"11303031032863116131\\\", \\\"x-datadog-parent-id\\\": \\\"2169818190025839277\\\", \\\"x-datadog-sampling-priority\\\": \\\"1\\\"}\", \"params.MessageAttributes._datadog.DataType\": \"String\", \"params.QueueUrl\": \"https://sqs.sa-east-1.amazonaws.com/601427279990/serverlessTracingQueuePy\", \"aws.agent\": \"botocore\", \"aws.operation\": \"SendMessage\", \"aws.region\": \"sa-east-1\", \"http.status_code\": \"200\", \"aws.requestid\": \"adc84b9d-0bc0-5ad9-82e0-1194ec44018a\"}, \"metrics\": {\"_dd.measured\": 1, \"retry_attempts\": 0}, \"type\": \"http\"}, {\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"080EE818C637C434\", \"span_id\": \"2084449425493209\", \"service\": \"aws.sns\", \"resource\": \"sns.publish\", \"name\": \"sns.command\", \"error\": 0, \"start\": 1636820292487211990, \"duration\": 21565856, \"meta\": {\"_dd.origin\": \"lambda\", \"params.MessageAttributes._datadog.StringValue\": \"{\\\"x-datadog-trace-id\\\": \\\"11303031032863116131\\\", \\\"x-datadog-parent-id\\\": \\\"580656595079775284\\\", \\\"x-datadog-sampling-priority\\\": \\\"1\\\"}\", \"params.MessageAttributes._datadog.DataType\": \"String\", \"params.Message\": \"Asynchronously invoking a Lambda function with SNS.\", \"params.TopicArn\": \"arn:aws:sns:sa-east-1:601427279990:serverlessTracingTopicPy\", \"aws.agent\": \"botocore\", \"aws.operation\": \"Publish\", \"aws.region\": \"sa-east-1\", \"http.status_code\": \"200\", \"aws.requestid\": \"37ec8df5-bc7c-583e-835c-d7fc5bf87b1b\"}, \"metrics\": {\"_dd.measured\": 1, \"retry_attempts\": 0}, \"type\": \"http\"}, {\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"080EE818C637C434\", \"span_id\": \"640267352BAD0C2B\", \"service\": \"aws.dynamodb\", \"resource\": \"dynamodb.putitem\", \"name\": \"dynamodb.command\", \"error\": 0, \"start\": 1636820292508904508, \"duration\": 6481144, \"meta\": {\"_dd.origin\": \"lambda\", \"params.Item.email.S\": \"e560387c-da16-4aae-8479-2c9232234ed6\", \"params.TableName\": \"usersTable\", \"aws.agent\": \"botocore\", \"aws.operation\": \"PutItem\", \"aws.region\": \"sa-east-1\", \"http.status_code\": \"200\", \"aws.requestid\": \"QHMDJ5RCOUB1LNCAB0VVKEDCHVVV4KQNSO5AEMVJF66Q9ASUAAJG\"}, \"metrics\": {\"_dd.measured\": 1, \"retry_attempts\": 0}, \"type\": \"http\"}, {\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"080EE818C637C434\", \"span_id\": \"D50A24D92FF59FD4\", \"service\": \"aws.kinesis\", \"resource\": \"kinesis.putrecord\", \"name\": \"kinesis.command\", \"error\": 0, \"start\": 1636820292515486978, \"duration\": 7799031, \"meta\": {\"_dd.origin\": \"lambda\", \"params.PartitionKey\": \"partitionkey\", \"params.Data\": \"{\\\"foo\\\": \\\"bar\\\"}\", \"params.StreamName\": \"kinesisStream\", \"aws.agent\": \"botocore\", \"aws.operation\": \"PutRecord\", \"aws.region\": \"sa-east-1\", \"http.status_code\": \"200\", \"aws.requestid\": \"dda3348f-e941-9fe5-87aa-d30b19df6a3e\"}, \"metrics\": {\"_dd.measured\": 1, \"retry_attempts\": 0}, \"type\": \"http\"}, {\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"080EE818C637C434\", \"span_id\": \"0E4800A960384F8F\", \"service\": \"aws.events\", \"resource\": \"events.putevents\", \"name\": \"events.command\", \"error\": 0, \"start\": 1636820292523387895, \"duration\": 13733007, \"meta\": {\"_dd.origin\": \"lambda\", \"params.Entries\": \"[{'Source': 'eventbridge.custom.event.sender', 'DetailType': 'testdetail', 'Detail': '{\\\"foo\\\": \\\"bar\\\"}', 'EventBusName': 'inferredBus'}]\", \"aws.agent\": \"botocore\", \"aws.operation\": \"PutEvents\", \"aws.region\": \"sa-east-1\", \"http.status_code\": \"200\", \"aws.requestid\": \"d7545887-c739-4e35-ab65-c6504e714d07\"}, \"metrics\": {\"_dd.measured\": 1, \"retry_attempts\": 0}, \"type\": \"http\"}, {\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"080EE818C637C434\", \"span_id\": \"154151ED08C6AD19\", \"service\": \"aws.s3\", \"resource\": \"s3.putobject\", \"name\": \"s3.command\", \"error\": 0, \"start\": 1636820292538263155, \"duration\": 38689743, \"meta\": {\"_dd.origin\": \"lambda\", \"params.Key\": \"76909630-1599-4fcc-ab10-5425637e1bee\", \"params.Bucket\": \"inferred-spans-python-bucket\", \"aws.agent\": \"botocore\", \"aws.operation\": \"PutObject\", \"aws.region\": \"sa-east-1\", \"http.status_code\": \"200\", \"aws.requestid\": \"0Z7JMRYXA4WXJP0M\"}, \"metrics\": {\"_dd.measured\": 1, \"retry_attempts\": 0}, \"type\": \"http\"}, {\"trace_id\": \"9CDC6ED69F05CB63\", \"parent_id\": \"080EE818C637C434\", \"span_id\": \"70BB81DD6895FD93\", \"service\": \"aws.lambda\", \"resource\": \"lambda.invoke\", \"name\": \"lambda.command\", \"error\": 0, \"start\": 1636820292579315022, \"duration\": 20111883, \"meta\": {\"_dd.origin\": \"lambda\", \"params.ClientContext\": \"eyJjdXN0b20iOiB7Il9kYXRhZG9nIjogeyJ4LWRhdGFkb2ctdHJhY2UtaWQiOiAiMTEzMDMwMzEwMzI4NjMxMTYxMzEiLCAieC1kYXRhZG9nLXBhcmVudC1pZCI6ICI4MTIzMjI5MTQwODM1MjM3MjY3IiwgIngtZGF0YWRvZy1zYW1wbGluZy1wcmlvcml0eSI6ICIxIn19fQ==\", \"params.FunctionName\": \"inferred-spans-python-dev-directInvokeReceiver\", \"aws.agent\": \"botocore\", \"aws.operation\": \"Invoke\", \"aws.region\": \"sa-east-1\", \"http.status_code\": \"200\", \"aws.requestid\": \"0e6344ef-befc-4066-b755-f2c902fc4f7f\"}, \"metrics\": {\"_dd.measured\": 1, \"retry_attempts\": 0}, \"type\": \"http\"}]]}\n"
94+
},
95+
{
96+
"id": "35311576126131896820299352780996570814324296803896786961",
97+
"timestamp": 1583425836750,
98+
"message": "END RequestId: f08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\n"
99+
},
100+
{
101+
"id": "35311576126131896820299352780996570814324296803896786962",
102+
"timestamp": 1583425836750,
103+
"message": "REPORT RequestId: f08bb4c8-d6b2-4f05-ac17-af7e2ba005fb\tDuration: 619.31 ms\tBilled Duration: 700 ms\tMemory Size: 128 MB\tMax Memory Used: 118 MB\t\nXRAY TraceId: 1-5e61292c-cc1229a4dfbeae1043928548\tSegmentId: 07a85e713f6302b2\tSampled: true\t\n"
104+
}
105+
]
106+
}

aws/logs_monitoring/tests/test_lambda_function.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import sys
44
import unittest
55
import json
6+
import gzip
7+
import base64
8+
from time import time
69
from botocore.exceptions import ClientError
710

811
sys.modules["trace_forwarder.connection"] = MagicMock()
@@ -26,7 +29,11 @@
2629
extract_host_from_cloudtrails,
2730
extract_host_from_guardduty,
2831
extract_host_from_route53,
32+
enrich,
33+
transform,
34+
split,
2935
)
36+
from parsing import parse, parse_event_type
3037

3138
env_patch.stop()
3239

@@ -105,5 +112,91 @@ def test_value_instance_float(self):
105112
self.assertEqual(extract_metric({"e": 0, "v": None, "m": "foo", "t": []}), None)
106113

107114

115+
class Context:
116+
function_version = 0
117+
invoked_function_arn = "arn:aws:lambda:sa-east-1:601427279990:function:inferred-spans-python-dev-initsender"
118+
function_name = "inferred-spans-python-dev-initsender"
119+
memory_limit_in_mb = "10"
120+
121+
122+
def create_cloudwatch_log_event_from_data(data):
123+
# CloudWatch log event data is a base64-encoded ZIP archive
124+
# see https://docs.aws.amazon.com/lambda/latest/dg/services-cloudwatchlogs.html
125+
gzipped_data = gzip.compress(bytes(data, encoding="utf-8"))
126+
encoded_data = base64.b64encode(gzipped_data).decode("utf-8")
127+
return encoded_data
128+
129+
130+
class TestLambdaFunctionEndToEnd(unittest.TestCase):
131+
@patch("enhanced_lambda_metrics.send_forwarder_internal_metrics")
132+
@patch("enhanced_lambda_metrics.get_cache_from_s3")
133+
def test_datadog_forwarder(self, mock_get_s3_cache, mock_forward_metrics):
134+
mock_get_s3_cache.return_value = (
135+
{
136+
"arn:aws:lambda:sa-east-1:601427279990:function:inferred-spans-python-dev-initsender": [
137+
"team:metrics",
138+
"monitor:datadog",
139+
"env:prod",
140+
"creator:swf",
141+
"service:hello",
142+
]
143+
},
144+
time(),
145+
)
146+
context = Context()
147+
my_path = os.path.abspath(os.path.dirname(__file__))
148+
path = os.path.join(my_path, "events/cloudwatch_logs.json")
149+
150+
with open(
151+
path,
152+
"r",
153+
) as input_file:
154+
input_data = input_file.read()
155+
156+
event = {"awslogs": {"data": create_cloudwatch_log_event_from_data(input_data)}}
157+
os.environ["DD_FETCH_LAMBDA_TAGS"] = "True"
158+
159+
event_type = parse_event_type(event)
160+
self.assertEqual(event_type, "awslogs")
161+
162+
normalized_events = parse(event, context)
163+
enriched_events = enrich(normalized_events)
164+
transformed_events = transform(enriched_events)
165+
166+
metrics, logs, trace_payloads = split(transformed_events)
167+
self.assertEqual(len(trace_payloads), 1)
168+
169+
trace_payload = json.loads(trace_payloads[0]["message"])
170+
traces = trace_payload["traces"]
171+
self.assertEqual(len(traces), 1)
172+
173+
trace = traces[0]
174+
self.assertEqual(len(trace), 9)
175+
176+
inferred_spans = list(
177+
filter(
178+
lambda span: "meta" in span
179+
and "inferred_span.inherit_lambda" in span["meta"],
180+
trace,
181+
)
182+
)
183+
self.assertEqual(len(inferred_spans), 1)
184+
185+
inferred_span = inferred_spans[0]
186+
self.assertEqual(
187+
inferred_span["service"], "ialbefmodl.execute-api.sa-east-1.amazonaws.com"
188+
)
189+
self.assertEqual(inferred_span["name"], "aws.apigateway")
190+
191+
# ensure tags not applied to inferred span
192+
assert "team" not in inferred_span["meta"]
193+
assert "monitor" not in inferred_span["meta"]
194+
assert "env" not in inferred_span["meta"]
195+
assert "creator" not in inferred_span["meta"]
196+
assert "service" not in inferred_span["meta"]
197+
198+
del os.environ["DD_FETCH_LAMBDA_TAGS"]
199+
200+
108201
if __name__ == "__main__":
109202
unittest.main()

aws/logs_monitoring/trace_forwarder/internal/apm/model.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ func AddTagsToTracePayloads(tracePayloads []*pb.TracePayload, tags string) {
184184
for _, trace := range tracePayload.Traces {
185185

186186
for _, span := range trace.Spans {
187+
// do not add tags from Lambda function if it's an inferred span and
188+
// it does not belong to the AWS Lambda service
189+
if value, ok := span.Meta["inferred_span.inherit_lambda"]; ok && value == "False" {
190+
continue
191+
}
187192
if serviceLookup[span.Service] != "" {
188193
span.Service = serviceLookup[span.Service]
189194
}

0 commit comments

Comments
 (0)