Skip to content
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

fix: span was leaking, leading to long traces #575

Merged
merged 1 commit into from
May 24, 2024

Conversation

Pascal-Delange
Copy link
Contributor

What was happening is that in some cases (trigger mismatch, specifically) we never called span.End() (or at least we did so very late, because the deferred call was happening at the end of the batch execution). So we are seing some long spans towards the end of the batch execution (see screenshot).
TBH I still don't understand why they are not even longer - though probably the explanation is that there are many such long spans, all with deferred .End() queued, and the most recent ones are simply ended first when the function ends, and after a certain number the trace collection rate limiting kicks in (otherwise we'd see spans minutes old)

Anyway, I fix this by doing the span generation and scenario execution in a closure so that the deferred End does not wait forever.

Capture d’écran 2024-05-24 à 12 37 08

@Pascal-Delange Pascal-Delange requested a review from balzdur May 24, 2024 10:37
@Pascal-Delange Pascal-Delange force-pushed the pascal/improve-batch-scenario-traces branch from 9be0ed2 to 144bcf3 Compare May 24, 2024 13:45
@Pascal-Delange Pascal-Delange merged commit 9a0c333 into main May 24, 2024
3 checks passed
@Pascal-Delange Pascal-Delange deleted the pascal/improve-batch-scenario-traces branch May 24, 2024 14:22
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.

2 participants