feat(eap): Add server.address and segment.name span attribute definitions#111707
feat(eap): Add server.address and segment.name span attribute definitions#111707nsdeschenes wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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"), |
There was a problem hiding this comment.
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)
| simple_sentry_field("os.name"), | ||
| simple_sentry_field("app_start_type"), | ||
| simple_sentry_field("ttid"), | ||
| simple_sentry_field("server.address"), |
There was a problem hiding this comment.
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.
|
Closing this out as it seems to be the wrong approach. |


Add
server.addressandsegment.nameto the EAP span attribute definitions.