otel: support gen_ai.response.time_to_first_chunk in sqlite store#312938
Merged
Conversation
The CLI runtime is migrating from the vendor-prefixed github.copilot.time_to_first_chunk attribute to the OTel GenAI semconv attribute gen_ai.response.time_to_first_chunk. Both encode TTFT in seconds. The sqlite store's _ttftMs() now reads either name (preferring the new one) so we keep populating ttft_ms before, during, and after the runtime rollout. Adds two unit tests: one for the new attribute alone, one verifying the new attribute wins when both are present. Refs: open-telemetry/semantic-conventions#3607 github/copilot-agent-runtime#6949
62f0e48 to
b804497
Compare
dmitrivMS
approved these changes
Apr 28, 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.
Summary
The CLI agent runtime is migrating from the vendor-prefixed attribute
github.copilot.time_to_first_chunkto the new OTel GenAI semantic-conventions attributegen_ai.response.time_to_first_chunk. Both encode time-to-first-chunk in seconds. To stay green before, during, and after the runtime rollout, the OTel sqlite store's_ttftMs()now reads either attribute (preferring the new one) when denormalizing TTFT into thettft_mscolumn.Changes
extensions/copilot/src/platform/otel/node/sqlite/otelSqliteStore.ts—_ttftMs()checksgen_ai.response.time_to_first_chunkfirst, falls back togithub.copilot.time_to_first_chunk.extensions/copilot/src/platform/otel/node/sqlite/test/otelSqliteStore.spec.ts— Adds two unit tests:ttft_ms(ms).gen_ai.request.stream(the other new attribute in the upstream PR) has no current consumer here, so no shim is needed — it flows through as a normal span attribute.Verification
References