Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/sentry/search/eap/spans/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@
simple_sentry_field("os.name"),
simple_sentry_field("app_start_type"),
simple_sentry_field("ttid"),
simple_sentry_field("server.address"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wrong internal name prefix for OTel attributes

High Severity

simple_sentry_field("server.address") maps to internal_name="sentry.server.address", but server.address is an OpenTelemetry semantic convention attribute stored without the sentry. prefix. Fixture data and the convert_span_to_item ingestion path confirm the attribute is stored as server.address. Other OTel attributes like db.system, cache.hit, and http.decoded_response_content_length correctly use ResolvedAttribute with unprefixed internal names. This mismatch means EAP queries for server.address will look up the wrong key and return no results. The same concern likely applies to segment.name.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The simple_sentry_field helper incorrectly prefixes the standard OTel attribute server.address with sentry., causing queries for this attribute to fail.
Severity: MEDIUM

Suggested Fix

Replace simple_sentry_field("server.address") with an explicit ResolvedAttribute definition. Set both public_alias and internal_name to "server.address" to prevent the incorrect sentry. prefix from being added. This aligns with the implementation of other standard OpenTelemetry attributes in the codebase.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/sentry/search/eap/spans/attributes.py#L459

Potential issue: The `simple_sentry_field("server.address")` call automatically prefixes
the field name, creating the internal name `sentry.server.address`. However,
`server.address` is a standard OpenTelemetry attribute that should be stored and queried
under its literal name without a prefix. This mismatch will cause user queries for
`server.address` to search for a non-existent internal attribute, leading to empty
results or query failures. The correct pattern, used for other OTel attributes in the
file, is to use `ResolvedAttribute` to map the public alias directly to the internal
name without modification.

Did we get this right? 👍 / 👎 to inform future reviews.

simple_sentry_field("segment.name"),
simple_measurements_field("app_start_cold", "millisecond"),
simple_measurements_field("app_start_warm", "millisecond"),
simple_measurements_field("frames_frozen"),
Expand Down
Loading