Skip to content

Pass span attributes as props to interaction elements #5511

@landenai

Description

@landenai

Problem Statement

User is currently capturing ui interaction spans via Sentry's built-in User Interaction instrumentation. They want to add custom attributes to these spans. AFAIK The only way to achieve this currently is to implement a custom onPress function, and then call Sentry.getActiveSpan().setAttributes({}). Having to add this implementation to every applicable component requires a lot of additional code.

Solution Brainstorm

An alternative approach could be to support a sentry-span-attributes prop similar to how sentry-label works. This prop could contain a list of key value pairs which would then be added to the span attribute data in Sentry.

Are you willing to submit a PR?

None

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions