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

Sentry next plugin and layer0 #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jillesmc
Copy link
Collaborator

@jillesmc jillesmc commented May 20, 2021

Sentry-demos/with-typescript-eslint-jest

Setup

1. Create a Layer0 account

2. Clone this repository

3. install dependencies:

yarn install

4. Update .env file variables:

NEXT_PUBLIC_SENTRY_DSN=
SENTRY_AUTH_TOKEN=
SENTRY_ORG=
SENTRY_PROJECT=

5. Run the command layer0 login to create a authorization token

yarn layer0 login

6. Now you can you can deploy using layer0

yarn layer0 deploy

This will:

  • create a new project in layer0 if it doesn't exist
  • build the nextjs application
  • deploy the application to layer0

Deploying using Github Actions after the project creation in Layer0

This strategy will decouple the build and deploy phases.

1. Access the Layer0 dashboard

2. Go to: {Your Project} > Settings > Create New Deploy Token

name: GITHUB_ACTION_TOKEN

3. Copy the token value

4. Go to the github repository: Settings > Secrets > Actions > New Repository secret

name: LAYER0_DEPLOY_TOKEN

value: {the value of GITHUB_ACTION_TOKEN from Layer0}

5. You also should create some sentry variables as githib action secrets

SENTRY_AUTH_TOKEN
SENTRY_ORG
SENTRY_PROJECT

@jillesmc jillesmc force-pushed the sentry-next-plugin-and-layer0 branch from 1bd82eb to 95579cb Compare May 20, 2021 16:09
@thinkocapo thinkocapo self-requested a review May 20, 2021 16:10
@jillesmc jillesmc force-pushed the sentry-next-plugin-and-layer0 branch 2 times, most recently from 3f568ce to 5b609a2 Compare May 20, 2021 16:19
@HazAT
Copy link

HazAT commented May 26, 2021

Hey, thank you for the repro.
As soon as we shipped the next version of our next.js SDK we'll take a look at how to fix this.

@jillesmc jillesmc force-pushed the sentry-next-plugin-and-layer0 branch from 5b609a2 to f7d90dc Compare May 30, 2021 21:56
@chrillep
Copy link

ping

@jillesmc
Copy link
Collaborator Author

Hey guys,
I've updated this pull request with an almost working example.
At least it is working if you disable autoInstrumentServerFunctions and uses the Sentry's wrappers like withSentry.
However this pull request has autoInstrumentServerFunctions enabled and does not use the Sentry's wrappers on purpose.

The problem I'm facing is that instead of showing the source it is showing some kind of default template.
image

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.

3 participants