GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(node): Allow to pass instrumentation config to `httpIntegration` by mydea · Pull Request #12761 · getsentry/sentry-javascript

Conversation

@mydea

@mydea mydea commented Jul 4, 2024

Copy link
Copy Markdown
Member

Today, it is not (easily) possible to use custom config for the OTEL HttpInstrumentation. We depend on our own integration for various things, so overwriting this will lead to lots of problems.

With this PR, you can now pass some config through directly, in an "allowlisted" way, + there is an escape hatch to add arbitrary other config:

Sentry.init({
  integrations: [
    Sentry.httpIntegration({ instrumentation: {
      // these three are "vetted"
      requestHook: (span, req) => span.setAttribute('custom', req.method),
      responseHook: (span, res) => span.setAttribute('custom', res.method),
      applyCustomAttributesOnSpan: (span, req, res) => span.setAttribute('custom', req.method),
      // escape hatch: Can add arbitrary other config that is passed through
      _experimentalConfig: {
        serverName: 'xxx'
      }
    })
  ]
});

Closes #12672

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mydea
mydea requested review from AbhiPrasad and lforst July 4, 2024 12:37
@mydea mydea self-assigned this Jul 4, 2024
@github-actions

github-actions Bot commented Jul 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
@sentry/browser 22.28 KB (0%)
@sentry/browser (incl. Tracing) 33.43 KB (0%)
@sentry/browser (incl. Tracing, Replay) 69.18 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.51 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 73.24 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 85.85 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 87.71 KB (0%)
@sentry/browser (incl. metrics) 26.57 KB (0%)
@sentry/browser (incl. Feedback) 38.92 KB (0%)
@sentry/browser (incl. sendFeedback) 26.9 KB (0%)
@sentry/browser (incl. FeedbackAsync) 31.51 KB (0%)
@sentry/react 25.02 KB (0%)
@sentry/react (incl. Tracing) 36.48 KB (0%)
@sentry/vue 26.39 KB (0%)
@sentry/vue (incl. Tracing) 35.29 KB (0%)
@sentry/svelte 22.41 KB (0%)
CDN Bundle 23.49 KB (0%)
CDN Bundle (incl. Tracing) 35.18 KB (0%)
CDN Bundle (incl. Tracing, Replay) 69.28 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.47 KB (0%)
CDN Bundle - uncompressed 68.94 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 103.96 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 214.35 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 227.06 KB (0%)
@sentry/nextjs (client) 36.35 KB (0%)
@sentry/sveltekit (client) 34.07 KB (0%)
@sentry/node 130.8 KB (+0.06% 🔺)
@sentry/node - without tracing 91.83 KB (+0.09% 🔺)
@sentry/aws-serverless 117 KB (+0.07% 🔺)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lforst
lforst approved these changes Jul 4, 2024
View reviewed changes
@mydea
feat(node): Allow to pass instrumentation config to httpIntegration
28a397f
@mydea
mydea force-pushed the fn/http-integration-options branch from d37def1 to 28a397f Compare July 5, 2024 07:05
@mydea
skip test on node 14
4780fe5
@mydea
mydea merged commit a2dcb28 into develop Jul 5, 2024
@mydea
mydea deleted the fn/http-integration-options branch July 5, 2024 10:41
This was referenced Jul 30, 2024
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.16.0 https-quantumblockchainai-atlassian-net/ossinsight#787
Open
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.17.0 https-quantumblockchainai-atlassian-net/ossinsight#791
Open
@amykapernick amykapernick mentioned this pull request Aug 1, 2024
[Snyk] Upgrade @sentry/nextjs from 8.14.0 to 8.17.0 amykapernick/wedding#12
Open
@wkylin wkylin mentioned this pull request Aug 1, 2024
[Snyk] Upgrade @sentry/react from 8.15.0 to 8.17.0 wkylin/pro-react-admin#370
Closed
@q1blue q1blue mentioned this pull request Aug 6, 2024
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.18.0 https-quantumblockchainai-atlassian-net/ossinsight#799
Open
@wkylin wkylin mentioned this pull request Aug 7, 2024
[Snyk] Upgrade @sentry/react from 8.15.0 to 8.18.0 wkylin/pro-react-admin#371
Merged
This was referenced Aug 9, 2024
[Snyk] Upgrade @sentry/react from 7.118.0 to 8.19.0 Stanislav1975/win11React#4
Open
[Snyk] Upgrade @sentry/node from 6.17.4 to 8.19.0 Stanislav1975/shields#596
Open
@q1blue q1blue mentioned this pull request Aug 9, 2024
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.19.0 https-quantumblockchainai-atlassian-net/ossinsight#802
Open
@FengShangWuQi FengShangWuQi mentioned this pull request Aug 11, 2024
[Snyk] Upgrade @sentry/gatsby from 7.20.0 to 8.19.0 FengShangWuQi/fengshangwuqi.github.io#1914
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AbhiPrasad AbhiPrasad Awaiting requested review from AbhiPrasad
1 more reviewer
@lforst lforst lforst approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mydea mydea

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support custom @opentelemetry/instrumentation-http config

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mydea @lforst
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.