Skip to content

Rename legacy ai.* attributes to gen_ai.* names. #4924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented Jul 9, 2025

This makes the names OTel compatible and also allows older SDKs that use the legacy names to send spans that will appear in the AI agents insights module.

Those are matching the deprecated ai.* attributes described in the Sentry conventions:
https://getsentry.github.io/sentry-conventions/generated/attributes/ai.html#deprecated-attributes

We have checked if those attributes are used by customers in alerts, dashboards and saved queries. They are NOT used, so we can safely normalize them.

Fixes getsentry/sentry-python#4516

@antonpirker antonpirker marked this pull request as ready for review July 9, 2025 09:19
@antonpirker antonpirker requested a review from a team as a code owner July 9, 2025 09:19
@@ -493,7 +493,7 @@ pub struct SpanData {
pub gen_ai_usage_output_tokens_reasoning: Annotated<Value>,

// Exact model used to generate the response (e.g. gpt-4o-mini-2024-07-18)
#[metastructure(field = "gen_ai.response.model")]
#[metastructure(field = "gen_ai.response.model", legacy_alias = "ai.model_id")]
Copy link
Member

Choose a reason for hiding this comment

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

We should also remove ai_model_id field, since this is basically deprecating it. Not sure if it needs to be done as a part of this PR, or if follow-up is fine

#[metastructure(field = "gen_ai.response.text", pii = "maybe")]
#[metastructure(
field = "gen_ai.response.text",
legacy_alias = "ai.responses",
Copy link
Member

Choose a reason for hiding this comment

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

This field also already exists ai_responses

Comment on lines -1058 to +1059
"gen_ai.agent.name": "Seer",
"gen_ai.system": "openai"
"gen_ai.system": "openai",
"gen_ai.agent.name": "Seer"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you revert this? They were alphabetical before.

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.

If the attributes are NOT used, make relay to rename those span attributes
3 participants