Skip to content

[skill-drift] update(sentry-svelte-sdk): document setAttribute and setAttributes APIs#229

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
skill-drift/sentry-svelte-sdk-skill-drift-update-sentry-svelte-sdk-doc-1782742229
Open

[skill-drift] update(sentry-svelte-sdk): document setAttribute and setAttributes APIs#229
github-actions[bot] wants to merge 1 commit into
mainfrom
skill-drift/sentry-svelte-sdk-skill-drift-update-sentry-svelte-sdk-doc-1782742229

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Warning

Auto-generated from external SDK content. Review all links and code suggestions before acting on them.

Summary

Added documentation for new Sentry.setAttribute() and Sentry.setAttributes() APIs introduced in @sentry/sveltekit 10.61.0.

Changes

references/error-monitoring.md:

  • Added new "Attributes" section documenting setAttribute(key, value) and setAttributes(attributes)
  • Positioned after Tags section since attributes are conceptually similar but serve different purposes
  • Documented supported types: string, number, boolean, and arrays of these types
  • Noted that attributes apply to logs, metrics, and streamed spans

SDK 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 to setTag(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

…tAttributes APIs

Automated drift-fix run.

Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>
@github-actions github-actions Bot requested a review from a team as a code owner June 29, 2026 14:10
@github-actions github-actions Bot requested review from chargome, mydea and s1gr1d and removed request for a team June 29, 2026 14:10
});
```

Attributes are applied to logs, metrics, and streamed spans. Supported types: `string`, `number`, `boolean`, and arrays of these types (`string[]`, `number[]`, `boolean[]`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants