Skip to content

CA-412313: don't lose distributed tracing spans when XAPI is shut down #6525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2025

Conversation

edwintorok
Copy link
Contributor

Soon after Host.evacuate XAPI could be restarted (e.g. on coordinator promotion).
But we only export traces every 30s, so we lose the spans from the last 30s, including the toplevel Host.evacuate span (which although long running is only emitted on completion).

After this change I'm now able to see Host.evacuate and all the migrate calls in the exported distributed trace.

Maintenance mode is entered by running Host.evacuate, followed
by promoting a new pool coordinator and shutting down XAPI.

We only export spans every 30s, so we may miss exporting the span for Host.evacuate.
Ensure that we at least trigger the export when XAPI is about to shutdown.
Do not wait for the export to finish, because this could take a long time
(e.g. when exporting to a remote Jaeger instance).

After this change I now see Host.evacuate properly in the exported trace.

Signed-off-by: Edwin Török <[email protected]>
json_reformat cannot handle newline delimited json, it is easier if we have a command to reformat it ourselves.

This can be useful when debugging why a trace is missing elements. Traces are stored as newline-delimited JSON
in /var/log/dt/zipkinv2/json, however json_reformat cannot process them directly, and the lines can be very long and difficult to read otherwise.

Signed-off-by: Edwin Török <[email protected]>
@last-genius
Copy link
Contributor

Something is wrong and it's not auto-merging

@last-genius last-genius disabled auto-merge June 12, 2025 14:31
@last-genius last-genius enabled auto-merge June 12, 2025 14:31
@last-genius
Copy link
Contributor

Ah, it's the gray tick

@last-genius last-genius added this pull request to the merge queue Jun 12, 2025
Merged via the queue into xapi-project:master with commit afb3678 Jun 12, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants