Skip to content

fix(node-sdk): document headersToSpanAttributes on nativeNodeFetchIntegration#67

Merged
HazAT merged 2 commits intomainfrom
copilot/skill-drift-update-sentry-sdk
Mar 23, 2026
Merged

fix(node-sdk): document headersToSpanAttributes on nativeNodeFetchIntegration#67
HazAT merged 2 commits intomainfrom
copilot/skill-drift-update-sentry-sdk

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

Since @opentelemetry/instrumentation-undici@0.22.0, response headers like content-length are no longer captured automatically on outgoing fetch/undici spans. getsentry/sentry-javascript#19770 exposed headersToSpanAttributes on nativeNodeFetchIntegration() to restore this as opt-in behavior. The skill had no documentation for this integration's options.

Changes

  • references/tracing.md: Added "Capturing HTTP Headers on Fetch Spans" subsection under HTTP & Web with the breaking change context, working example, and options table. Updated the Configuration Reference code block to include the integration.
  • SKILL.md: Added nativeNodeFetchIntegration() Options subsection to Config Reference with options table (breadcrumbs, headersToSpanAttributes.requestHeaders, headersToSpanAttributes.responseHeaders).

Usage

Sentry.init({
  integrations: [
    Sentry.nativeNodeFetchIntegration({
      headersToSpanAttributes: {
        requestHeaders: ["x-request-id"],
        responseHeaders: ["content-length", "content-type"],
      },
    }),
  ],
});
Original prompt

This section details on the original issue you should resolve

<issue_title>[skill-drift] sentry-node-sdk may need updates</issue_title>
<issue_description>cc @getsentry/team-javascript-sdks

SDK Changes Detected

The following PRs were merged to getsentry/sentry-javascript in the last 7 days that may affect the sentry-node-sdk skill:

Potential Skill Gaps

  1. New Config Option: nativeNodeFetchIntegration() now accepts a headersToSpanAttributes option to capture specific HTTP headers as span attributes. Example:
    Sentry.init({
      integrations: [
        Sentry.nativeNodeFetchIntegration({
          headersToSpanAttributes: {
            requestHeaders: ['x-request-id', 'x-custom-header'],
            responseHeaders: ['content-length', 'content-type'],
          },
        }),
      ],
    });
    This is especially relevant because response headers like content-length were previously captured automatically but became opt-in after @opentelemetry/instrumentation-undici@0.22.0. The skill's Config Reference does not mention any options for nativeNodeFetchIntegration.

Skill Files to Review

  • skills/sentry-node-sdk/SKILL.md

Priority

MEDIUM — new opt-in configuration option that users may need to restore previously-automatic header capture behavior.

Generated by SDK Skill Drift Detector ·

  • expires on Mar 30, 2026, 11:02 PM UTC

Comments on the Issue (you are @copilot in this section)

Custom agent used: skill-updater
Expert Sentry SDK skill author that updates and creates SDK skill bundles. Specializes in researching SDK changes, verifying APIs against official docs and source code, and producing high-quality wizard flows with deep-dive reference files. Use when updating skills after SDK changes, creating new skills for new platforms, or fixing skill drift issues.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…etchIntegration

Addresses skill drift from getsentry/sentry-javascript#19770.
The nativeNodeFetchIntegration() now accepts headersToSpanAttributes
to capture specific HTTP headers as span attributes, which became
opt-in after @opentelemetry/instrumentation-undici@0.22.0.

Co-Authored-By: Claude (Anthropic)

Co-authored-by: HazAT <363802+HazAT@users.noreply.github.com>
Copilot AI changed the title [WIP] [skill-drift] Update sentry-node-sdk for new features fix(node-sdk): document headersToSpanAttributes on nativeNodeFetchIntegration Mar 17, 2026
Copilot AI requested a review from HazAT March 17, 2026 10:10
@HazAT HazAT marked this pull request as ready for review March 23, 2026 09:48
@HazAT HazAT merged commit ae58c8d into main Mar 23, 2026
5 checks passed
@HazAT HazAT deleted the copilot/skill-drift-update-sentry-sdk branch March 23, 2026 09:49
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.

[skill-drift] sentry-node-sdk may need updates

2 participants