Conversation
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
added this pull request to stack #1892
September 22, 2026 06:32
TemporalIdGenerator.seed_span_id and seed_trace_idTemporalIdGenerator.seed_span_id and seed_trace_id
brianstrauch
approved these changes
Sep 22, 2026
brianstrauch
left a comment
Member
There was a problem hiding this comment.
+1, but would recommend shortening the changelog
Contributor
Author
|
@brianstrauch done, thanks |
This branch has not been deployed
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.
Stacked on #1868, and CI here inherits its base's current
uv syncfailure (the two-weekexclude-newerwindow fortemporalio-openai-agents1.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()andseed_trace_id()fromtemporalio.contrib.opentelemetry, together with the context-local seed queues behind them, the branches ingenerate_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
AttributeErrorafter upgrading.TemporalIdGeneratoris not exported fromtemporalio.contrib.opentelemetry, lives in a private module, and carries the experimental warning, but it is reachable throughReplaySafeTracerProvider.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-agentsdoes 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
SpanContext(..., is_remote=True)), the standard OpenTelemetry way, which needs no ID seeding. Keeping the API keeps the anti-pattern one import away.generate_*call in that context, whatever span that turns out to be, so a seed that is not consumed where it was intended yields two spans with the same ID.Migration: connect a trace across a boundary by setting a remote-parent
SpanContext, astemporalio-openai-agentsdoes. To control the ID sequence itself, pass your ownIdGeneratortocreate_tracer_provider(id_generator=...);TemporalIdGeneratorwraps it and defers to it outside workflows.Checklist
tests/contrib/opentelemetry: 75 passed on this branch.test_temporal_id_generator_seeds_are_context_localremoved (it only tested the seeding).