Skip to content

feat(attributes): add search alias metadata - #492

Open
cleptric wants to merge 7 commits into
mainfrom
add-new-properties
Open

feat(attributes): add search alias metadata#492
cleptric wants to merge 7 commits into
mainfrom
add-new-properties

Conversation

@cleptric

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Jul 13, 2026

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).


Breaking Changes 🛠

  • (op) Add gen_ai prefix to existing ops and add embeddings, generate_content, and rerank ops by msonnb in #543

New Features ✨

Attributes

  • Add search alias metadata by cleptric in #492
  • Add sentry.event.serialized_* attributes by mjq in #556
  • Add browser.bfcache.* attributes by logaretm in #513
  • Add query, deprecated in favor of db.query.text by alexander-alderman-webb in #530
  • Add aws.operation_name, deprecated in favor of rpc.method by alexander-alderman-webb in #536
  • Add db.params, deprecated in favor of db.query.parameter.<key> by alexander-alderman-webb in #529
  • Add code, deprecated in favor of rpc.response.status_code by alexander-alderman-webb in #533
  • Add django.function_name, deprecated in favor of code.function.name by alexander-alderman-webb in #538
  • Add port, deprecated in favor of server.port by alexander-alderman-webb in #532
  • Add redis.command, deprecated in favor of db.operation.name by alexander-alderman-webb in #531
  • Add address, deprecated in favor of server.address by alexander-alderman-webb in #534
  • Add aws_region, deprecated in favor of cloud.region by alexander-alderman-webb in #537
  • Add gcp_region, deprecated in favor of cloud.region by alexander-alderman-webb in #535
  • Add django.middleware_name (deprecated) in favor of middleware.name by alexander-alderman-webb in #520
  • Add starlite.middleware_name (deprecated) in favor of middleware.name by alexander-alderman-webb in #519
  • Add aws.request.url (deprecated) in favor of url.full by sentrivana in #488
  • Add subprocess.pid (deprecated) in favor of process.pid by sentrivana in #487
  • Add litestar.middleware_name (deprecated) in favor of middleware.name by sentrivana in #486
  • Add starlette.middleware_name (deprecated) in favor of middleware.name by sentrivana in #485
  • Add redis.key (deprecated) in favor of db.redis.key by sentrivana in #484
  • Add db.mongodb.collection (deprecated) in favor of db.collection.name by sentrivana in #483
  • Add Kafka messaging attributes by chargome in #474
  • Deprecate rpc.grpc.status_code in favor of rpc.response.status_code by lucas-zimerman in #494
  • Add deprecated messaging.destination_kind by andreiborza in #509
  • Add sentry.segment.name.source attribute by Lms24 in #466
  • Add attribute transformations by constantinius in #465
  • Add stable app vitals attributes by buenaflor in #493
  • Deprecate sentry.frames.* attributes by buenaflor in #500
  • Add missing AI legacy aliases from Relay SpanData by vgrozdanic in #498

Op

  • Add general measure span operation by msonnb in #550
  • Add browser resource, timing phase, and UI span operations by msonnb in #547
  • Add object storage span operations by msonnb in #545
  • Add http.client.stream op by msonnb in #544

Other

  • (conventions) Support multiple examples by Lms24 in #505
  • (descriptions) Add http.route description template for http.server span description inference by Lms24 in #518
  • (ops) Add navigation.redirect op and update name and description rules by Lms24 in #522

Internal Changes 🔧

Attribute

  • Add more examples for valid sentry.kind values by Lms24 in #517
  • Improve db.statement example and add deprecation reason by Lms24 in #501

Attributes

  • Disambiguate http.route and url.template attributes by Lms24 in #521
  • Improve description of sentry.segment.name.source by Lms24 in #511
  • Deprecate sentry.span.source and change backfill status of sentry.source by Lms24 in #510

Deps

  • Bump fast-uri from 3.1.4 to 3.1.5 by dependabot in #557
  • Bump postcss from 8.5.15 to 8.5.25 by dependabot in #549
  • Bump dompurify from 3.4.11 to 3.4.12 by dependabot in #525
  • Bump fast-uri from 3.1.2 to 3.1.4 by dependabot in #526
  • Bump svgo from 4.0.1 to 4.0.2 by dependabot in #524
  • Bump js-yaml from 4.2.0 to 4.3.0 by dependabot in #516
  • Bump astro from 6.4.7 to 7.1.0 in /docs by dependabot in #514

Other

  • (attrs) Backport attributes and normalizations from Relay by Dav1dde in #497
  • (codeowners) Assign telemetry-experience to gen_ai/ai attributes by vgrozdanic in #506
  • (deps-dev) Bump tar from 7.5.16 to 7.5.19 by dependabot in #515
  • (release) Show version in workflow run title by constantinius in #504

🤖 This preview updates automatically when you update the PR.

Comment thread model/attributes/sentry/sentry__op.json Outdated
{
"public_alias": "span.op",
"internal_name": "sentry.op",
"search_type": "string",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can likely make string the default, so not required.

Comment thread schemas/attribute.schema.json Outdated
Comment on lines +113 to +116
"internal_name": {
"description": "The internal attribute name used by the EAP search resolver",
"type": "string"
},

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.

Will this always duplicate the attribute's key? It feels like it ought to, in which case I'd prefer we make mismatches impossible by removing this property.

Comment thread schemas/attribute.schema.json Outdated
Comment on lines +135 to +138
"private": {
"description": "Whether the internal attribute should be hidden from public search results",
"type": "boolean"
},

@mjq mjq Jul 13, 2026

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.

Is this already covered by visibility? cc @nsdeschenes

Comment thread schemas/attribute.schema.json Outdated
Comment on lines +145 to +148
"spans": {
"description": "The column expression in the indexed spans dataset",
"type": "string"
},

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.

This dataset has been removed. Only EAP exists now.

Comment thread schemas/attribute.schema.json Outdated
Comment on lines +149 to +152
"eap": {
"description": "The column expression in the Events Analytics Platform dataset",
"type": "string"
}

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.

This seems better left to the Sentry backend to compute. (What's sent to EAP isn't a string either, so I don't think this is helpful here anyway). We do need a way to record when the search types and internal types of an attribute mismatch, though. I'd rather expose an (optional) internal_type property for this (one of string, boolean, double, integer, or array) so that the backend can construct the correct RPC proto.

Comment thread schemas/attribute.schema.json Outdated
"description": "Whether the internal attribute should be hidden from public search results",
"type": "boolean"
},
"dataset_mappings": {

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.

Given the two other two comments re: spans and eap I think the whole dataset_mappings can be removed.

@buenaflor

Copy link
Copy Markdown
Contributor

this closes #85 right?

cleptric and others added 6 commits August 6, 2026 13:44
Simplify the search alias model from a complex array of objects
(with internal_name, search_type, dataset_mappings, etc.) to a
single top-level public_alias string field on attributes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts:
#	python/src/sentry_conventions/attributes.py
#	scripts/generate_attributes.ts
Add public_alias metadata from the Sentry EAP search resolver to all
convention attributes that have a corresponding search alias, including
span.* aliases, user.* aliases, mobile frame aliases, and more.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the flat `public_alias` string with a structured `search_alias`
object that supports `name`, optional `type` (defaults to string), and
optional `aliases` array for additional search query names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refactor `public_alias` into a structured `search_alias` object with
`name`, optional `type`, and optional `aliases` fields. Add non-string
search types from the EAP search resolver (number, integer, second) and
add search_alias with aliases for db.system.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add search_alias with non-string types from the EAP search resolver:
- ai.total_cost (currency), ai.total_tokens.used (integer)
- cache.hit (boolean), cache.item_size (byte)
- code.lineno (number)
- http.decoded_response_content_length (byte),
  http.response_content_length (byte), http.response_transfer_size (byte)
- messaging.message.body.size (byte),
  messaging.message.receive.latency (millisecond),
  messaging.message.retry.count (number)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cleptric
cleptric marked this pull request as ready for review August 6, 2026 19:01
@cleptric
cleptric requested review from a team, Lms24 and nsdeschenes as code owners August 6, 2026 19:01
"is_in_otel": false,
"example": true,
"visibility": "public",
"search_alias": {

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.

q: Does it make sense to add a search_alias entry if neither type nor name differ from the primary definition? like in this case but probably in a lot of others, too

"visibility": "public",
"search_alias": {
"name": "db.system",
"aliases": ["span.system"]

@Lms24 Lms24 Aug 7, 2026

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.

side-note/no action required: I guess we can't break this, since we have such a ResolvedAttribute but IMHO the aliases mapping makes very little sense 🤔

{
"key": "sentry.thread.id",
"brief": "Current “managed” thread ID.",
"brief": "Current \u201cmanaged\u201d thread ID.",

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.

super-l:

Suggested change
"brief": "Current \u201cmanaged\u201d thread ID.",
"brief": "Current \"managed\" thread ID.",

"type": "array",
"items": {
"type": "string"
}

@Lms24 Lms24 Aug 7, 2026

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.

m: what's the difference between search_alias.name and search_alias.aliases? Is the intention purely to have more than one alias or are there more differences?

If there are no differences, should we simplify to names which is always an Array? (I likely lack some context in the product but I checked ResolvedAttribute and I don't see more than one alias per instance. I do see the secondary_alias boolean though which might play a role here 🤔 )

If there is a difference, let's point this out in the schema description. Also let's consider changing the name because we already have a top-level alias field and this might get confusing, especially, because the top-level alias get's generated to aliases in JS and Python code. So if these are "secondary" aliases, let's maybe call it secondary_aliases?

@Lms24

Lms24 commented Aug 7, 2026

Copy link
Copy Markdown
Member

I will rebase #508 on this PR and probably repurpose it slightly: Instead of exposing purely a deprecation chain, the chains will include:

  • the primary attribute name
  • any search aliases (alias.name + alias.aliases or whatever definition we settle on (see feat(attributes): add search alias metadata #492 (comment)))
  • the aliasing attributes
  • the primary name and aliases of any replacing or deprecated attributes as long as their status is backfill or normalize.

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.

4 participants