Span start/end after parent and trans end should be allowed #635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An APM agent shouldn't prevent the creation/start of a span after its parent or its containing transaction has ended.
FWIW, the Java APM agent (I'm told) already allows span creation and end after its parent and transaction have ended.
Motivation
It is possible (at least in Node.js) to have a span creation/start happen after its containing transaction has already ended. With the OTel API this can happen like this:
This "transaction already ended - cannot build new span" limitation in the current Node.js APM agent dates back to v1 of the APM Server intake API when all of a transaction's spans had to be reported with the transaction -- and that was done on transaction end. The v2 intake API no longer requires this. elastic/apm-agent-nodejs#2653 will be removing this restriction in the Node.js APM agent.
checklist
sanitize_field_names
)CODEOWNERS
)