Skip to content

feat(js): Add Documentation for Sentry Astro SDK #8267

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 7 commits into from
Oct 23, 2023
Merged

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 17, 2023

Pre-merge checklist

If you work at Sentry, you're able to merge your own PR without review, but please don't unless there's a good reason.

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs
  • PR was reviewed and approved by a member of the Sentry docs team

Description of changes

This PR adds SDK docs for the new Sentry Astro SDK. It's still in Alpha which we clearly point out in the new docs.

This PR includes adjustments for Astro in the following pages:

  • Getting Started shows the semi-automatic setup via the astro CLI
  • Added "Manual Setup" page similarly, to SvelteKit, Remix and NextJS with all possible configuration options
  • Adjusted source map docs to not display the full range of source maps upload material. The Astro SDK ships with the Vite plugin, so there shouldn't be too much need for other resources than troubleshooting.
  • Added Astro specific setup for Replay (This is the first SDK that actually enables Replay by default. However, there are two ways how users can manually customize or add Replay).
  • Added various platform includes for performance monitoring snippets

ref: getsentry/sentry-javascript#9182

@vercel
Copy link

vercel bot commented Oct 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2023 9:43am

@Lms24 Lms24 requested review from mydea, lforst and AbhiPrasad October 17, 2023 15:07
@Lms24 Lms24 marked this pull request as ready for review October 17, 2023 15:07
@Lms24 Lms24 requested review from a team October 17, 2023 15:07
@Lms24 Lms24 self-assigned this Oct 17, 2023
@shanamatthews
Copy link
Contributor

Hey @Lms24 - Is there a date you'd like to get this out by? It might take me a bit longer to review it since it's a bigger PR and this week is a bit busier than usual!

@Lms24
Copy link
Member Author

Lms24 commented Oct 18, 2023

Is there a date you'd like to get this out by?

Hi @shanamatthews ideally until the beginning of next week. I'm currently working on the getting started pages in sentry but can only add full Astro support to the Sentry frontend once these docs are live. Lmk if this is too soon (no problem then, just have to plan around it).
Also, we can iterate on the docs later, the SDK is still in alpha state.

@shanamatthews
Copy link
Contributor

Sounds good, thanks @Lms24 ! I'm going to start on this today and hopefully finish up by tomorrow. Good to know that the SDK is still in alpha!

Co-authored-by: Shana Matthews <shana.l.matthews@gmail.com>
@@ -38,7 +38,7 @@ export function OrgAuthTokenNote() {
<ExternalLink href={`https://sentry.io/auth/login/?next=${url}`}>
sign in
</ExternalLink>{' '}
to create a token directly from the docs.
to create a token directly from this page.
Copy link
Contributor

Choose a reason for hiding this comment

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

Good change

integrations: [new BrowserTracing()],
tracePropagationTargets: [
"https://myproject.org",
"https://.*.otherservice.org/.*",
Copy link
Contributor

Choose a reason for hiding this comment

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

h: Do we actually support globbing here? I thought we only do regexp.match() or naive string.contains().

Copy link
Member Author

@Lms24 Lms24 Oct 23, 2023

Choose a reason for hiding this comment

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

Hmm probably not the best example, let me come up with a better one (copy 🍝 so maybe also relevant for other pages)

.* is valid regex syntax though 🤔 scratch that, I see the problem now 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed this for Astro in 7d18a09 but we have the same invalid string in a bunch of places. Will open a separate PR to fix there. Also asked mobile folks because the same string is used in flutter and apple docs.

Comment on lines +1 to +5
We recommend installing the SDK by using the `astro` CLI:

```bash
npx astro add @sentry/astro
```
Copy link
Contributor

Choose a reason for hiding this comment

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

l: Wondering, is there a chance that astro will change some API and this will break? If so, will it make sense to build and recommend a wizard of some sort that will work independently of the astro CLI? (no action required right now, just sharing my thoughts)

Copy link
Member Author

Choose a reason for hiding this comment

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

Afaict, this is pretty stable for now (but the current approach has its limitations). We should keep an eye open for if they change things (I need to finally write up that RFC for Astro I've mentioned some time ago).

We could build a wizard because right now, folks still need to manually add their DSN, source maps config, etc. Ideally, the Astro CLI would invoke it for us, so we could retain the "Astro native" approach. But I guess that's just wishful thinking at this point 😅


### Working With Old Authentication Tokens

Source maps work best with [organization-scoped auth tokens](/product/accounts/auth-tokens/#organization-auth-tokens). If you are using a different type of Sentry auth token, you'll need to additionally specify your `org` slug in your `sourceMapsUploadOptions`:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add here when people might want to follow this step, ie. when they're on an old self-hosted version that doesn't have org auth tokens.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Lms24 Lms24 merged commit 648c30f into master Oct 23, 2023
@Lms24 Lms24 deleted the lms/feat-add-astro-docs branch October 23, 2023 09:59
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants