Skip to content
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

feat(solidstart)!: Default to --import setup and add autoInjectServerSentry #14862

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

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Dec 30, 2024

This PR adds a withSentry wrapper for SolidStart's config to build and place instrument.server.ts alongside the server build output so that it doesn't have to be placed in /public anymore to be discoverable.

The setup is changed to be aligned with Nuxt.
First, the instrument.server.ts file is added to the build output (the sentry release injection file needs to be copied as well - this is not ideal at the moment as there could be other imports as well, but it's okay for now)

Then, there are two options to set up the SDK:

  1. Users provide an --import CLI flag to their start command like this:
    node --import ./.output/server/instrument.server.mjs .output/server/index.mjs
  2. Users can add autoInjectServerSentry: 'top-level-import' and the Sentry config will be imported at the top of the server entry
// app.config.ts
import { defineConfig } from '@solidjs/start/config';
import { withSentry } from '@sentry/solidstart';

export default defineConfig(withSentry(
    { /* ... */ },
    { 
      autoInjectServerSentry: 'top-level-import' // optional
    })
 );

builds on top of the idea in this PR: #13784

@s1gr1d s1gr1d changed the title Ab/solidstart withsentry feat(solidstart)!: Default to --import setup and add autoInjectServerSentry Dec 30, 2024
@s1gr1d s1gr1d changed the title feat(solidstart)!: Default to --import setup and add autoInjectServerSentry feat(solidstart)!: Default to --import setup and add autoInjectServerSentry Dec 30, 2024
@s1gr1d s1gr1d requested a review from andreiborza December 30, 2024 14:21
@s1gr1d s1gr1d force-pushed the ab/solidstart-withsentry branch from e7b59a0 to b402fe1 Compare December 30, 2024 14:22
Copy link

codecov bot commented Dec 30, 2024

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
254 3 251 8
View the top 3 failed tests by shortest run time
errors.server.test.ts server-side errorscaptures server action error
Stack Traces | 30s run time
errors.server.test.ts:5:3 captures server action error
performance.server.test.ts sends a server action transaction on pageload
Stack Traces | 30s run time
performance.server.test.ts:9:1 sends a server action transaction on pageload
performance.server.test.ts sends a server action transaction on client navigation
Stack Traces | 30s run time
performance.server.test.ts:32:1 sends a server action transaction on client navigation

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

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