Conversation
Align the `ElectronNet` outgoing-request span with the `http.client`
spans that `@sentry/node`'s fetch instrumentation emits, so Relay can
infer the low-cardinality span name and high-cardinality description from
the same conventions rules:
- Name is now the sanitized URL (`${method} ${sanitizedUrl}`) via
`getSanitizedUrlStringFromUrlObject`.
- Emit OTel attributes `http.request.method`, `server.address`,
`server.port`, `url.full`, `url.path`, `url.query`, `url.scheme`
(filtered for PII) instead of the bespoke `url`/`http.method`/
`type: 'net.request'`.
- `onlyIfParent` now follows `hasSpanStreamingEnabled(client)` so the span
is emitted without an active parent under span streaming, matching the
node/browser fetch instrumentation.
The Electron-specific `sentry.origin` (`auto.http.electron.net`) is kept.
Update the net tracing e2e assertions to the new attribute set (the span
name is unchanged for URLs without query/credentials).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PbscLoW7dZTXEm8ebixtgS
…http-client-spans
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.
Stacked on top of #1415 (
feat/vNext).Aligns the
ElectronNetoutgoing-request span with thehttp.clientspans that@sentry/node's fetch instrumentation emits, so that under span streaming Relay can infer the low-cardinality span name and the high-cardinality description from the same sentry-conventions rules.What changed
src/main/integrations/net-breadcrumbs.ts:`${method} ${sanitizedUrl}`viagetSanitizedUrlStringFromUrlObject(client spans don't branch the name; Relay derives both name and description from attributes).http.request.method,server.address,server.port,url.full,url.path,url.query,url.scheme(URLs/queries filtered for PII), replacing the bespokeurl/http.method/type: 'net.request'.onlyIfParentnow followshasSpanStreamingEnabled(client), so the span is emitted without an active parent under span streaming — matching the node/browser fetch instrumentation. Correct for bothtraceLifecycle: 'stream'(default) and'static'.sentry.origin(auto.http.electron.net) is kept.This mirrors
@sentry/node's undici/fetch instrumentation, minus the origin and the socket-derived extras (network.peer.*,http.request.method_original) which aren't needed for name/description inference.Scope
SDK side only (the emitting integration). The
electron.*startup ops and forwarded renderer spans are untouched — the startup ops are already static low-cardinality, and renderer spans are owned by@sentry/browser. Verifying/adding thehttp.clientrules lives ingetsentry/sentry-conventions.