Receiving "An error occurred fetching your data" if the root segment has not finished

0

We're using AWS X-Ray to trace our long-running processes, but we're not able to view the traces until the root segment has ended. As soon as the long-running process finishes we're able to see the entire trace with all the sub-segments included, but nothing is displayed before this, even though many sub-segments finish while the process is running. The X-Ray API doesn't return the data either, so it's not just an issue in the X-Ray console.

Is this expected behaviour? If not, how would we troubleshoot this issue?

Chris
已提問 2 年前檢視次數 560 次
1 個回答
0

Hi Chris!

Thanks for posting this issue. X-Ray the service will aggregate the data that clients (instrumented with the X-Ray SDK or OpenTelemetry) send it. X-Ray does support showing "in-progress" segments, but only if the clients actually send the traces/segments before they are closed out.

You are most likely wrapping a segment around your process so that once the process finishes you are using endSegment() to close out the segment. This segment closing "flushes" the segment to the X-Ray service and that's why you would see it there.

However, if you want to see it in progress, you need to periodically call sendSegment() so that the X-Ray service can display it. Only after you call that method can you retrieve the data X-Ray receives.

You want to do this on the Root segment, as subsegments cannot be sent without a segment to be their parent.

Hope this helps!

AWS
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南