I want to include the AWS API Gateway step in my X-Ray trace results.
However when I enable X-Ray in my gateway on the production stage, the analytics tab in X-Ray only populates User-Agent as '-'
Example "Gateway Logging Config" - https://i.sstatic.net/RS88w.png
Example "Xray Analytics" - https://i.sstatic.net/x3VrJ.png
I can still see the user-agent available in the 2nd document of the X-Ray trace RAW data. Also when I disable X-Ray logging in Gateway the User-Agent begins being populated again.
Thanks in advance, for any input
Thanks for reaching out. We are aware about this issue and working with API Gateway team to add "user_agent" on the segment generated by the APIGW. I don't have any ETA but we have raised this issue with the APIGW team.
Concept : When X-Ray is enabled for APIGW, APIGW generates Segment and sends to X-Ray service. This becomes root segment and since the user agent is missing on this root segment (known issue), X-Ray analytics tab shows "-" due to missing field in the root segment.
When you disable X-Ray for APIGW, the root segment is the application segment which you have enabled X-Ray instrumentation. This probably contains user-agent which is populated by X-Ray middleware. Since user-agent is present on the root segment in this case, the analytics tab shows the user-agent field being populated.
Thanks, Yogi