豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
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 fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions