I'm trying to instrument a web server written in Go that provides REST API, that runs in a container on AWS ECS. I'm running the server in Debug in VSCode for now, working on a proof of concept that would show traces for the different endpoints, with major functions as subsegments. I've instrumented the router in our middleware like this:
h = xray.Handler(xray.NewFixedSegmentNamer("myappname"), h)
And function calls made from the various handler functions are instrumented by passing the request context in, then having this:
_, subSeg := xray.BeginSubsegment(ctx, "get-user")
calculateUsefulInfo(ctx)
subSeg.Close(nil)
Then that calculateUsefulInfo() function can call other functions, passing along the context (ctx) and internally doing the same thing (another BeginSubsegment+subSeg.Close) with a different subsegment name.
I have the AWS XRay daemon running, with appropriate permissions, and I see the traces appear in the AWS console. However, I only see one level of nesting.
I turned on 100% sampling in AWS. I'm running the XRay daemon in local mode, dev-level logging. Any idea what I'm missing here?