Skip to content

[sentry plugin] Adds an error before using the rootSpan if it's not been set up #1431

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

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

orta
Copy link
Contributor

@orta orta commented Jun 27, 2022

Description

👋 It is possible to set up Sentry so that rootSpan = Sentry.startTransaction returns null. This is always a user-side sentry setup issue, but because it will crash the plugin I wasn't seeing any logs about what was going on. getsentry/sentry-javascript#4731

Fixes (no issue, didn't seem worth it for a more explicit log)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Too small to warrant, but I did run this code in my app's node_modules first

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@vercel
Copy link

vercel bot commented Jun 27, 2022

@orta is attempting to deploy a commit to the The Guild Team on Vercel.

A member of the Team first needs to authorize it.

if (!rootSpan) {
const error = [
`Could not create the root Sentry transaction for the GraphQL operation "${transactionName}".`,
`It's very likely that this is because you have not included the Sentry tracing SDK in your app's runtime before handling the request.`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@orta Do you think it would be nice to also include a link here that points to the corresponding sentry documentation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can do this in a follow-up PR.

@changeset-bot
Copy link

changeset-bot bot commented Jun 27, 2022

🦋 Changeset detected

Latest commit: 8bf11fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@envelop/sentry Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@n1ru4l n1ru4l merged commit b1851eb into graphql-hive:main Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants