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
gefragt vor 2 Jahren560 Aufrufe
1 Antwort
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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen