From 8b822e1606a4c0f34a8d225b0b7a0f21ee00cf2b Mon Sep 17 00:00:00 2001 From: Steven Eubank <47563310+smeubank@users.noreply.github.com> Date: Thu, 15 Feb 2024 14:59:41 +0100 Subject: [PATCH] Cleanup Astro upload page (#9149) * Cleanup Astro upload page Astro's source map uploads includes a lot of snippet variations. I think this is distracting and we can stick what we promtoe and reduce the rest, and move the legacy token to the legacy uploading methods * Moving to legacy upload cuts down the main page * Update javascript.astro.mdx fix code text formatting --- .../legacy-uploading-methods/javascript.mdx | 23 ++++++++++ .../sourcemaps/overview/javascript.astro.mdx | 45 ++----------------- 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/platform-includes/sourcemaps/legacy-uploading-methods/javascript.mdx b/platform-includes/sourcemaps/legacy-uploading-methods/javascript.mdx index 7a05f98511af9..8b7da4c69cbc4 100644 --- a/platform-includes/sourcemaps/legacy-uploading-methods/javascript.mdx +++ b/platform-includes/sourcemaps/legacy-uploading-methods/javascript.mdx @@ -53,6 +53,29 @@ Next, upload your artifacts (minified sources and source maps): sentry-cli sourcemaps upload --release= /path/to/directory ``` + + +## 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 an old self-hosted Sentry version that doesn't yet support org-based tokens or you're using a different type of Sentry auth token, you'll need to additionally specify your `org` slug in your `sourceMapsUploadOptions`: + +```javascript {filename:astro.config.mjs} +export default defineConfig({ + integrations: [ + sentry({ + // Other Sentry options + sourceMapsUploadOptions: { + project: "___PROJECT_SLUG___", + org: "___ORG_SLUG___", + authToken: process.env.SENTRY_AUTH_TOKEN, + }, + }), + ], +}); +``` + + + ## Uploading using Sentry Webpack Plugin Version 1.x Assuming you have the `@sentry/webpack` package installed on version `1.x`, you can learn more on how to configure the plugin in the [Sentry webpack plugin v1 documentation](https://github.com/getsentry/sentry-webpack-plugin#readme). diff --git a/platform-includes/sourcemaps/overview/javascript.astro.mdx b/platform-includes/sourcemaps/overview/javascript.astro.mdx index d7651d3e2b7b6..8b17f8123ef53 100644 --- a/platform-includes/sourcemaps/overview/javascript.astro.mdx +++ b/platform-includes/sourcemaps/overview/javascript.astro.mdx @@ -30,20 +30,7 @@ export default defineConfig({ ### Disable Source Maps Upload -You can disable automatic source maps upload in your Astro config: - -```javascript {filename:astro.config.mjs} -export default defineConfig({ - integrations: [ - sentry({ - // Other Sentry options - sourceMapsUploadOptions: { - enabled: false, - }, - }), - ], -}); -``` +You can disable automatic source maps upload in your Astro configuration with `enabled: false` under `sourceMapsUploadOptions` ### Setting the Source Maps Assets Directory @@ -66,39 +53,13 @@ The specified patterns must follow the [glob syntax](https://www.npmjs.com/packa ### 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 an old self-hosted Sentry version that doesn't yet support org-based tokens or you're using a different type of Sentry auth token, you'll need to additionally specify your `org` slug in your `sourceMapsUploadOptions`: +Source maps work best with [organization-scoped auth tokens](/product/accounts/auth-tokens/#organization-auth-tokens). If you are using an old self-hosted Sentry version that doesn't yet support org-based tokens or you're using a different type of Sentry auth token, refer to our [legacy upload methods](/platforms/javascript/guides/astro/sourcemaps/troubleshooting_js/#working-with-old-authentication-tokens) for more information. -```javascript {filename:astro.config.mjs} -export default defineConfig({ - integrations: [ - sentry({ - // Other Sentry options - sourceMapsUploadOptions: { - project: "___PROJECT_SLUG___", - org: "___ORG_SLUG___", - authToken: process.env.SENTRY_AUTH_TOKEN, - }, - }), - ], -}); -``` ### Disabeling Telemetry Data Collection The Astro SDK uses the Sentry Vite plugin to upload source maps. This plugin collects telemetry data to help us improve the source map uploading experience. Read more about this in our [Vite plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin#telemetry). -You can disable telemetry collection by setting `telemetry` to `false`: +You can disable telemetry collection by setting `telemetry:false` under `sourceMapsUploadOptions`. -```javascript {filename:astro.config.mjs} -export default defineConfig({ - integrations: [ - sentry({ - // Other Sentry options - sourceMapsUploadOptions: { - telemetry: false, - }, - }), - ], -}); -```