Skip to content

Expose scope-level attributes API #5764

@antonis

Description

@antonis

Summary

Android SDK 8.34.0 (changelog) added a scope-level attributes API (getsentry/sentry-java#5118, getsentry/sentry-java#5148). Scope attributes are automatically included in structured logs and metrics.

New Android APIs

Sentry.setAttribute("key", "value")
Sentry.setAttributes(mapOf("key1" to "value1", "key2" to "value2"))
Sentry.removeAttribute("key")

Also supports collections and arrays in attribute type inference (getsentry/sentry-java#5124).

Proposal

Expose Sentry.setAttribute, Sentry.setAttributes, and Sentry.removeAttribute in the React Native SDK JS API, bridging to the native implementations on both Android and iOS.

This is likely a prerequisite for structured logs support in React Native. May depend on @sentry/core exposing the same API on the JS side first.

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions