[processor/coldstart] pair cold start spans using faas.invocation_id - #2520
Merged
wpessers merged 1 commit intoAug 10, 2026
Merged
Conversation
The processor identifies execution spans by the faas.execution attribute, which semantic conventions v1.19.0 renamed to faas.invocation_id. Current instrumentations set only the new name, so no execution span is ever recognized. When that happens the cold start span is held indefinitely: it is removed from the batch while waiting for an execution span to pair with, and once the batch is empty the processor returns ErrSkipProcessingData, dropping the data. The result is that adding the coldstart processor to a pipeline silently loses the platform.initRuntimeDone span rather than enriching it. Look up both attribute names so current and older instrumentations are handled. Keeping the old name working avoids breaking instrumentations that still emit it, which is why this does not simply rename the attribute. Relates to open-telemetry#2099 and open-telemetry#1652.
|
|
tylerbenson
approved these changes
Aug 5, 2026
Member
There was a problem hiding this comment.
Thanks for resubmitting this. I think it's a good contribution. Sorry @borchero that the original PR didn't get reviewed in a timely fashion.
|
No worries, thanks for reviving @naari3 :) |
wpessers
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The processor identifies execution spans by
faas.execution, which semantic conventions renamed tofaas.invocation_idin v1.19.0. Current instrumentations set only the new name, so no execution span is ever recognized and the cold start span is never released.The failure is silent rather than a no-op: a held cold start span is removed from the batch, so a batch containing only that span becomes empty and the processor returns
ErrSkipProcessingData. Adding the coldstart processor to a pipeline dropsplatform.initRuntimeDoneinstead of enriching it.This accepts both attribute names, so current and older instrumentations both work.
Relation to #1216
@borchero submitted #1216 for this in March 2024. It went without review and was closed by the author. That PR renamed the attribute outright; this one keeps
faas.executionworking. Credit for finding the issue goes there, and I'm happy to close this in favour of a revived #1216.Testing
TestPairingByInvocationIDcovers a cold start span released by an execution span carryingfaas.invocation_id. It fails without the fix. The existing tests were left onfaas.executionas the backward-compatibility regression test and pass unchanged.Note
This also moves off
go.opentelemetry.io/collector/semconv, deprecated since collector v0.126.0, togo.opentelemetry.io/otel/semconvas already used bytelemetryapireceiver.Relates to #2099 and #1652.