feat(core): Emit sentry.sdk.integrations on segment spans in span streaming#20428
Draft
nicohrubec wants to merge 8 commits intodevelopfrom
Draft
feat(core): Emit sentry.sdk.integrations on segment spans in span streaming#20428nicohrubec wants to merge 8 commits intodevelopfrom
nicohrubec wants to merge 8 commits intodevelopfrom
Conversation
Relay's wire contract (AttributeType enum in relay-event-schema) defines
exactly five `type:` tags: boolean, integer, double, string, array.
The SDK's AttributeTypeMap previously declared typed array variants
(`string[]`, `integer[]`, etc.) that Relay does not recognize - these
were never actually emitted because the runtime serializer only handled
primitives, so array-valued attributes silently dropped.
This change:
- Collapses the four `x[]` variants in AttributeTypeMap into a single
`array` variant whose value is `Array<string> | Array<number> | Array<boolean>`.
- Extends getTypedAttributeValue to auto-detect homogeneous primitive
arrays and emit `{type: 'array', value: [...]}`.
- Adds an isHomogeneousPrimitiveArray guard so mixed-type and nested
arrays remain unsupported (dropped by default, stringified under
the fallback path).
- Updates tests to cover the new typed-array path (including empty
arrays, unit preservation, and mixed-type drop/stringify).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
Arrays that were previously dropped by the serializer now ship as native array attributes (`type: 'array'`). Update the affected integration test expectations and bump size-limit thresholds for the five bundle scenarios whose gzipped/uncompressed sizes grew from the new serializer logic. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the size-limit increases for the five bundle scenarios that grew from adding homogeneous primitive array support. Test expectation updates from the previous commit stay. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c34737a to
018435d
Compare
Re-apply the size-limit bumps needed to account for the new homogeneous-primitive-array detection logic. Five scenarios grew past their thresholds: - @sentry/browser (incl. Metrics & Logs): 28 → 29 KB - CDN Bundle (incl. Logs, Metrics): 30 → 31 KB - CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed: 258.5 → 259 KB - CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed: 268 → 269 KB - CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed: 271.5 → 272 KB Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
825a63e to
018435d
Compare
…eaming In the classic (non-streaming) pipeline, SDK integrations ride on the transaction event wrapper via `event.sdk.integrations`. The span streaming pipeline emits segment spans directly as span envelope items with no transaction wrapper, so that metadata never reaches ingest. Add `sentry.sdk.integrations` as a native array attribute on segment spans (matching the wire contract Relay expects: `type: 'array'`). Relies on the homogeneous-primitive-array serializer support. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
018435d to
8b38c1f
Compare
…ations Segment spans now ship a sentry.sdk.integrations attribute listing the active SDK integrations. Add the attribute to the full-shape assertions in the browser unit test, the browser/node/cloudflare streamed integration tests, and the Deno e2e test. Matching uses expect.arrayContaining against the explicit integrations configured in each scenario, to stay resilient to default-integration churn. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
oxfmt wants the SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS entries broken across multiple lines because they exceed the max line length. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
In the classic (non-streaming) pipeline, SDK integrations ride on the
transaction event wrapper via
event.sdk.integrations. The spanstreaming pipeline emits segment spans directly as span envelope items
with no transaction wrapper, so that metadata never reaches ingest.
Add
sentry.sdk.integrationsas a native array attribute on segmentspans (matching the wire contract Relay expects:
type: 'array').Relies on the homogeneous-primitive-array serializer support.