Content-Length: 366477 | pFad | https://github.com/getsentry/sentry-javascript/pull/15597

F3 feat(nuxt): Add Cloudflare Nitro plugin by s1gr1d · Pull Request #15597 · getsentry/sentry-javascript · GitHub
Skip to content

feat(nuxt): Add Cloudflare Nitro plugin #15597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Mar 5, 2025

⚠️ This PR is a work-in-progress and APIs and naming might change

A plugin which initializes Sentry when deployed to Cloudflare.

  1. Remove the previous server config file: sentry.server.config.ts

  2. Add a plugin in server/plugins (e.g. server/plugins/sentry-cloudflare-setup.ts)

  3. Add this code in your plugin file

    // server/plugins/sentry-cloudflare-setup.ts (filename does not matter)
    import { sentryCloudflareNitroPlugin } from '@sentry/nuxt/module/plugins'
    
    export default defineNitroPlugin(sentryCloudflareNitroPlugin({
        dsn: 'https://dsn',
        tracesSampleRate: 1.0,
    }))

    or with access to nitroApp:

    export default defineNitroPlugin(sentryCloudflareNitroPlugin((nitroApp: NitroApp) => {
      return  ({
        dsn: 'https://417c51af5466942533c989cdec3036b8@o447951.ingest.us.sentry.io/4508873430466560',
        tracesSampleRate: 1.0,
      })
    }))

@rth
Copy link

rth commented Apr 8, 2025

Thanks for working on this! By any chance you wouldn't have a suggestion on how to install this from github with pnpm? Tried,

pnpm add github:getsentry/sentry-javascript#sig/nuxt-cloudflare

but this installs the @sentry package not @sentry/nuxt..

@s1gr1d s1gr1d force-pushed the sig/nuxt-cloudflare branch from bc63ab4 to fc62672 Compare June 5, 2025 09:01
@s1gr1d s1gr1d force-pushed the sig/nuxt-cloudflare branch from 243b681 to 0800086 Compare June 23, 2025 10:50
*
* @default false
*/
continueTraceFromPropagationContext?: boolean;
Copy link
Member Author

@s1gr1d s1gr1d Jun 26, 2025

Choose a reason for hiding this comment

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

@AbhiPrasad Is this a good place for adding the option? As it's only needed in the requestHandler, I added it only here and not in the general Cloudflare SDK options.

Actually, I don't need this option because it would always take same trace ID from the Cloudflare environment which leads to multiple pageload spans within a trace as they all have the same trace ID in the meta tags.

@s1gr1d s1gr1d marked this pull request as ready for review June 26, 2025 12:47
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.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/getsentry/sentry-javascript/pull/15597

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy