[skill-drift] update(sentry-svelte-sdk): document setAttribute and setAttributes APIs#229
Open
github-actions[bot] wants to merge 1 commit into
Conversation
…tAttributes APIs Automated drift-fix run. Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>
| }); | ||
| ``` | ||
|
|
||
| Attributes are applied to logs, metrics, and streamed spans. Supported types: `string`, `number`, `boolean`, and arrays of these types (`string[]`, `number[]`, `boolean[]`). |
There was a problem hiding this comment.
Bug: The documentation for Sentry.setAttribute() incorrectly claims it supports array values. These APIs write to the scope, which only supports primitive types, not arrays.
Severity: MEDIUM
Suggested Fix
Update the documentation for Sentry.setAttribute() and Sentry.setAttributes() to remove arrays from the list of supported types. Clarify that only string, number, and boolean are supported for scope-level attributes, and that arrays are only valid when set directly on a span.
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: skills/sentry-svelte-sdk/references/error-monitoring.md#L166
Potential issue: The documentation for `Sentry.setAttribute()` and
`Sentry.setAttributes()` in `error-monitoring.md` incorrectly states that these
functions support array values. These functions write to the isolation scope, which,
according to other Sentry documentation for scope attributes (`logging.md`), only
supports primitive types (`string`, `number`, `boolean`). While span-specific attributes
can be arrays, scope-level attributes cannot. Users following this new documentation
will attempt to use arrays, which will likely result in the data being silently dropped
or causing an error, leading to incorrect telemetry.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Auto-generated from external SDK content. Review all links and code suggestions before acting on them.
Summary
Added documentation for new
Sentry.setAttribute()andSentry.setAttributes()APIs introduced in@sentry/sveltekit10.61.0.Changes
references/error-monitoring.md:setAttribute(key, value)andsetAttributes(attributes)string,number,boolean, and arrays of these typesSDK Changes Tracked
PR #21705 - Added top-level
Sentry.setAttribute(s)APIs to all JavaScript SDKs including SvelteKit. These APIs write attributes to the isolation scope, analogous tosetTag(s)but for structured data that applies to logs, metrics, and spans.Merged: 2026-06-23
Version: 10.61.0+
Notes
Also reviewed PR #21784 (bug fix for 4xx error filtering in SvelteKit) but determined no documentation update was needed since it's an internal implementation improvement that doesn't change the public API or documented behavior.
Source PRs
Sentry.setAttribute(s)APIs