Skip to content

feat(eap): Add server.address and segment.name span attribute definitions#111707

Closed
nsdeschenes wants to merge 1 commit intomasterfrom
nd/chore-attributes-add-segement-and-server-address
Closed

feat(eap): Add server.address and segment.name span attribute definitions#111707
nsdeschenes wants to merge 1 commit intomasterfrom
nd/chore-attributes-add-segement-and-server-address

Conversation

@nsdeschenes
Copy link
Copy Markdown
Contributor

@nsdeschenes nsdeschenes commented Mar 27, 2026

Add server.address and segment.name to the EAP span attribute definitions.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 27, 2026
@nsdeschenes nsdeschenes marked this pull request as ready for review March 27, 2026 13:43
@nsdeschenes nsdeschenes requested a review from a team as a code owner March 27, 2026 13:43
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

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.

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

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.

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.

@nsdeschenes nsdeschenes marked this pull request as draft March 27, 2026 13:47
@nsdeschenes
Copy link
Copy Markdown
Contributor Author

Closing this out as it seems to be the wrong approach.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant