Skip to content

feat(attributes): add gen ai data migrations#455

Open
constantinius wants to merge 1 commit into
constantinius/feat/attributes/data-migration-utilitiesfrom
constantinius/feat/attributes/gen-ai-data-migrations
Open

feat(attributes): add gen ai data migrations#455
constantinius wants to merge 1 commit into
constantinius/feat/attributes/data-migration-utilitiesfrom
constantinius/feat/attributes/gen-ai-data-migrations

Conversation

@constantinius

@constantinius constantinius commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add gen_ai.request.messagesgen_ai.input.messages data migration
  • add gen_ai.response.text / gen_ai.response.tool_callsgen_ai.output.messages data migration
  • annotate source and target attributes with string migration identifiers
  • cover the migrations across JS, Python, and Rust

Stacked on #454.

Contributes to TET-2369.

Testing

  • yarn test

Add migrations that normalize deprecated gen_ai request and response attributes into the newer input and output message attributes. The migrations preserve existing replacement values, remove normalized source attributes, and include coverage across JavaScript, Python, and Rust.
@constantinius constantinius requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code owners June 26, 2026 07:21
@github-actions

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add gen ai data migrations by constantinius in #455
  • Add data migration utilities by constantinius in #454
  • Add sentry.trace_lifecycle attribute by Lms24 in #442
  • Add Cloudflare DO sql attributes by JPeer264 in #435
  • Add gen_ai.request.reasoning_effort attribute by cleptric in #334
  • Add deprecated otel.kind attribute by Lms24 in #440

Docs

  • Add span operations reference page by Lms24 in #452
  • Make span name and description cards linkable by Lms24 in #433

Bug Fixes 🐛

  • (attributes) Add deprecated sentry.thread.id by mjq in #451

Documentation 📚

  • (contributing) Improve releasing and downstream update instructions by constantinius in #434
  • Remove semicolon in db.query.summary example by JPeer264 in #439

Internal Changes 🔧

Deps

  • Bump dompurify from 3.4.10 to 3.4.11 by dependabot in #438
  • Bump astro from 6.1.10 to 6.4.6 in /docs by dependabot in #432

Other

  • (attributes) Rename pii field to apply_scrubbing by cleptric in #426
  • (test) Exit vitest when running yarn test by Lms24 in #441
  • Exclude formatting changes from git blame by Lms24 in #450
  • Use oxfmt and oxlint for formatting and linting by Lms24 in #449
  • Update yarn.lock file by JPeer264 in #436
  • Bump all dependencies to fix esbuild security issues by cleptric in #431

Other

  • Update blame ignore revs for pii field renaming by cleptric in #437

🤖 This preview updates automatically when you update the PR.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5c3da4b. Configure here.

return JSON.stringify([{ role: 'assistant', parts }]);
}

return textValue ?? toolCallsValue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty tool calls skip wrapper

Medium Severity

The gen_ai_response_to_output_messages migration only builds gen_ai.output.messages when parts is non-empty. If gen_ai.response.tool_calls is a valid JSON empty array (or text extracts to no parts), it returns the raw source value such as [] instead of the usual [{"role":"assistant","parts":...}] envelope used for all other migrated tool-call and text inputs.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5c3da4b. Configure here.

@linear-code

linear-code Bot commented Jun 26, 2026

Copy link
Copy Markdown

TET-2369

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.

1 participant