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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠