Skip to content

Commit

Permalink
Cleanup Astro upload page (#9149)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
smeubank committed Feb 15, 2024
1 parent d910975 commit 8b822e1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ Next, upload your artifacts (minified sources and source maps):
sentry-cli sourcemaps upload --release=<release_name> /path/to/directory
```

<PlatformSection supported={["javascript.astro"]}>

## 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,
},
}),
],
});
```
</PlatformSection>


## 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).
Expand Down
45 changes: 3 additions & 42 deletions platform-includes/sourcemaps/overview/javascript.astro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
},
}),
],
});
```

0 comments on commit 8b822e1

Please sign in to comment.