Skip to content

Comments

feat: Add support for propagateTraceparent#1277

Merged
timfish merged 1 commit intomasterfrom
feat/traceparent
Dec 17, 2025
Merged

feat: Add support for propagateTraceparent#1277
timfish merged 1 commit intomasterfrom
feat/traceparent

Conversation

@timfish
Copy link
Collaborator

@timfish timfish commented Dec 17, 2025

Closes #1275

@timfish timfish marked this pull request as ready for review December 17, 2025 11:12
@timfish timfish requested a review from Lms24 December 17, 2025 11:12
Comment on lines +90 to 92
{ tracing, breadcrumbs }: NetOptions,
{ enableLogs, tracePropagationTargets, propagateTraceparent }: ClientOptions,
): WrappedRequestMethodFactory {
Copy link

Choose a reason for hiding this comment

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

Bug: The getTraceData() function is called with an unsupported propagateTraceparent parameter. This option should be configured during SDK initialization, not passed directly to this function.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The getTraceData() function is being called with an object containing span and an unsupported propagateTraceparent parameter. The function's signature only accepts a Span or Scope object. Because propagateTraceparent is not a valid parameter for this function, it will be ignored, causing the feature to silently fail. Consequently, outgoing HTTP requests made through the Electron net module will not include the W3C traceparent header, even when the SDK is configured to do so, which defeats the purpose of the change.

💡 Suggested Fix

Remove the propagateTraceparent property from the object passed to getTraceData(). The SDK's instrumentation layer will automatically handle the traceparent header based on the global configuration provided during init(). The call should only pass the span object.

🤖 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: src/main/integrations/net-breadcrumbs.ts#L90-L92

Potential issue: The `getTraceData()` function is being called with an object containing
`span` and an unsupported `propagateTraceparent` parameter. The function's signature
only accepts a `Span` or `Scope` object. Because `propagateTraceparent` is not a valid
parameter for this function, it will be ignored, causing the feature to silently fail.
Consequently, outgoing HTTP requests made through the Electron `net` module will not
include the W3C `traceparent` header, even when the SDK is configured to do so, which
defeats the purpose of the change.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 7641719

Copy link
Collaborator Author

@timfish timfish Dec 17, 2025

Choose a reason for hiding this comment

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

You couldn't be more wrong. It's in the type definitions.

@timfish timfish enabled auto-merge (squash) December 17, 2025 12:36
},
spans: expect.arrayContaining([
expect.objectContaining({
op: 'http.client',
Copy link
Member

Choose a reason for hiding this comment

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

l: any way we can test against the traceparent header being part of the request?

No strong feelings, feel free to disregard since we test this in the JS SDKs.

@timfish timfish merged commit de85806 into master Dec 17, 2025
302 of 314 checks passed
@timfish timfish deleted the feat/traceparent branch December 17, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for propagateTraceparent to the Electron SDK

2 participants