Skip to content

Remove TemporalIdGenerator.seed_span_id and seed_trace_id - #1891

Open
DABH wants to merge 2 commits into
remove-openai-agents-integrationfrom
otel/remove-id-generator-seeding
Open

DABH wants to merge 2 commits into
remove-openai-agents-integrationfrom
otel/remove-id-generator-seeding

Conversation

@DABH

@DABH DABH commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1868, and CI here inherits its base's current uv sync failure (the two-week exclude-newer window for temporalio-openai-agents 1.0.0 clears on 2026-09-30) until that PR is updated or lands. Follow-up to #1856: its OpenAI Agents half landed as temporalio/ai-integrations#26, and this is the OTel half that was left behind when that PR closed.

What was changed

Removes TemporalIdGenerator.seed_span_id() and seed_trace_id() from temporalio.contrib.opentelemetry, together with the context-local seed queues behind them, the branches in generate_span_id() / generate_trace_id() that consumed them, and the one test that only exercised the seeding. ReplaySafeTracerProvider.id_generator() stays. Net −80 lines of code, no additions.

💥 Breaking change

Code that calls either method raises AttributeError after upgrading. TemporalIdGenerator is not exported from temporalio.contrib.opentelemetry, lives in a private module, and carries the experimental warning, but it is reachable through ReplaySafeTracerProvider.id_generator() and the provider's constructor, and the two methods were public-named and documented — so this is a removal, not a refactor, and it is logged under Breaking Changes next to #1868's entry.

Who is affected: the API was added in #1286 (1.24.0) for exactly one caller, the OpenAI Agents OTel interceptor, which #1868 removes from this repo. The standalone temporalio-openai-agents does not use it. A GitHub code search finds one consumer outside vendored SDK copies: temporal-community/temporal-agent-harness, which carries a copy of the old interceptor.

Why remove it rather than keep it

Migration: connect a trace across a boundary by setting a remote-parent SpanContext, as temporalio-openai-agents does. To control the ID sequence itself, pass your own IdGenerator to create_tracer_provider(id_generator=...); TemporalIdGenerator wraps it and defers to it outside workflows.

Checklist

  1. tests/contrib/opentelemetry: 75 passed on this branch. test_temporal_id_generator_seeds_are_context_local removed (it only tested the seeding).
  2. Lint gate clean on the changed files.
  3. CHANGELOG entry under Breaking Changes.

The OpenAI Agents OTel interceptor, the only caller of seed_span_id and
seed_trace_id, now propagates the caller's span as a remote parent instead
of re-minting it under the caller's IDs (temporalio/ai-integrations#26), and
#1868 removes it from this repository. Drop the two methods, their
context-local seed queues, the seed-consumption branches in the generate_*
methods, and the test that only exercised the seeding.
@DABH
DABH requested a review from a team as a code owner September 22, 2026 06:28
@DABH
DABH added this pull request to stack #1892 September 22, 2026 06:32
@DABH DABH changed the title 💥 Remove TemporalIdGenerator.seed_span_id and seed_trace_id Remove TemporalIdGenerator.seed_span_id and seed_trace_id Sep 22, 2026

@brianstrauch brianstrauch 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.

+1, but would recommend shortening the changelog

@DABH

DABH commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

@brianstrauch done, thanks

This branch has not been deployed

No deployments
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