Skip to content

[processor/coldstart] pair cold start spans using faas.invocation_id - #2520

Merged
wpessers merged 1 commit into
open-telemetry:mainfrom
naari3:fix/coldstart-processor-semconv
Aug 10, 2026
Merged

[processor/coldstart] pair cold start spans using faas.invocation_id#2520
wpessers merged 1 commit into
open-telemetry:mainfrom
naari3:fix/coldstart-processor-semconv

Conversation

@naari3

@naari3 naari3 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

The processor identifies execution spans by faas.execution, which semantic conventions renamed to faas.invocation_id in 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 drops platform.initRuntimeDone instead 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.execution working. Credit for finding the issue goes there, and I'm happy to close this in favour of a revived #1216.

Testing

TestPairingByInvocationID covers a cold start span released by an execution span carrying faas.invocation_id. It fails without the fix. The existing tests were left on faas.execution as the backward-compatibility regression test and pass unchanged.

Note

This also moves off go.opentelemetry.io/collector/semconv, deprecated since collector v0.126.0, to go.opentelemetry.io/otel/semconv as already used by telemetryapireceiver.

Relates to #2099 and #1652.

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.
@naari3
naari3 requested a review from a team as a code owner August 5, 2026 07:42
@linux-foundation-easycla

linux-foundation-easycla Bot commented Aug 5, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: naari3 / name: naari3 (98f6293)

@github-actions github-actions Bot added the go Pull requests that update Go code label Aug 5, 2026

@tylerbenson tylerbenson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@borchero

borchero commented Aug 5, 2026

Copy link
Copy Markdown

No worries, thanks for reviving @naari3 :)

@wpessers
wpessers merged commit bff4be9 into open-telemetry:main Aug 10, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants