Here I have Lamdba function 1 and that invokes lambda function 2 in Go. I want to see these 2 functions joined in the service map.
I have created a custom segment eg called "parent" and the create a subsegment from this context eg called "child". Then using client.InvokeWithContext to invoke the function 2 passing the "child" segment context.
sess := session.Must(session.NewSession())
client := lambda.New(sess, &aws.Config{Region: aws.String(region)})
xray.Configure(xray.Config{LogLevel: "trace"})
xray.AWS(client.Client)
ctx, seg := xray.BeginSegment(context.Background(), "Parent")
ctx, subseg := xray.BeginSubsegment(ctx, "Child")
result, _ := client.InvokeWithContext(ctx,
lambda.InvokeInput{FunctionName: aws.String(functionName), Payload: nil})
subseg.Close(nil)
seg.Close(nil)
Problem is that this creates trace parent -> child in sevice map but also has function 1 too.
What is the best way to join these 2 functions on the service map please ?