Skip to content

Commit

Permalink
Merge branch 'master' into lforst-add-sdk-to-changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored Jul 25, 2024
2 parents 50cf033 + a7f0a5b commit f46ea5c
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 42 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/dependency-review.yml

This file was deleted.

2 changes: 1 addition & 1 deletion apps/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build": "prisma generate && next build",
"start": "next start",
"lint": "next lint",
"migrate:dev": "dotenv -e .env.development -- yarn prisma migrate reset"
Expand Down
51 changes: 40 additions & 11 deletions platform-includes/getting-started-use/javascript.nestjs.mdx
Original file line number Diff line number Diff line change
@@ -1,24 +1,53 @@
```javascript {filename: main.ts} {17}
```javascript {filename: main.ts}
// Import this first!
import './instrument';

// Now import other modules
import * as Sentry from "@sentry/nestjs";
import {
BaseExceptionFilter,
HttpAdapterHost,
NestFactory
} from '@nestjs/core';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const { httpAdapter } = app.get(HttpAdapterHost);

Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));

await app.listen(3000);
}

bootstrap();
```

Then you can add the SentryModule as a root module:

<Note>The SentryModule needs to be registered before any other module that should be instrumented by Sentry.</Note>

```javascript {filename: app.module.ts} {2, 8}
import { Module } from '@nestjs/common';
import { SentryModule } from '@sentry/nestjs/setup';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
imports: [
SentryModule.forRoot(),
// ...other modules
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
```

By default, exceptions with status code 4xx are not sent to Sentry. If you still want to capture these exceptions, you can do so manually with `Sentry.captureException()`:

```javascript {11}
import { ArgumentsHost, BadRequestException, Catch } from '@nestjs/common';
import { BaseExceptionFilter } from '@nestjs/core';
import { ExampleException } from './example.exception';
import * as Sentry from '@sentry/nestjs';

@Catch(ExampleException)
export class ExampleExceptionFilter extends BaseExceptionFilter {
catch(exception: unknown, host: ArgumentsHost) {
Sentry.captureException(exception);
return super.catch(new BadRequestException(exception.message), host)
}
}
```
2 changes: 1 addition & 1 deletion public/_platforms/_index.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"key": "javascript.next-performance-onboarding-1-install",
"key": "javascript.nextjs-performance-onboarding-1-install",
"type": "framework",
"doc_link": "https://docs.sentry.io/platforms/javascript/guides/nextjs/tracing/",
"name": "Next",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"key": "javascript.next-performance-onboarding-2-configure",
"key": "javascript.nextjs-performance-onboarding-2-configure",
"type": "framework",
"doc_link": "https://docs.sentry.io/platforms/javascript/guides/nextjs/tracing/",
"name": "Next",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"key": "javascript.next-performance-onboarding-3-verify",
"key": "javascript.nextjs-performance-onboarding-3-verify",
"type": "framework",
"doc_link": "https://docs.sentry.io/platforms/javascript/guides/nextjs/tracing/",
"name": "Next",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"key": "javascript.node-performance-onboarding-1-install",
"key": "node.performance-onboarding-1-install",
"type": "framework",
"doc_link": "https://docs.sentry.io/platforms/javascript/guides/node/tracing/",
"name": "Node",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"key": "javascript.node-performance-onboarding-2-configure",
"key": "node.performance-onboarding-2-configure",
"type": "framework",
"doc_link": "https://docs.sentry.io/platforms/javascript/guides/node/tracing/",
"name": "Node",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"key": "javascript.node-performance-onboarding-3-verify",
"key": "node.performance-onboarding-3-verify",
"type": "framework",
"doc_link": "https://docs.sentry.io/platforms/javascript/guides/node/tracing/",
"name": "Node",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"name": "PHP",
"aliases": [],
"categories": [],
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>To capture all errors and transactions, even the one during the startup of your application, you should initialize the Sentry PHP SDK as soon as possible.</p><div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript highlight\"><code class=\"language-javascript\"><span class=\"token punctuation\">\\</span>Sentry<span class=\"token punctuation\">\\</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">[</span>\n <span class=\"token literal-property property\">'dsn' </span><span class=\"token operator\">=></span> <span class=\"token string\">'___PUBLIC_DSN___'</span><span class=\"token punctuation\">,</span>\n <span class=\"token comment\">// Set tracesSampleRate to 1.0 to capture 100%</span>\n <span class=\"token comment\">// of transactions for performance monitoring.</span>\n <span class=\"token literal-property property\">'traces_sample_rate'</span> <span class=\"token operator\">=></span> <span class=\"token number\">1.0</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">]</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>We recommend adjusting the value of <code>tracesSampleRate</code> in production. Learn more about tracing <a href=\"https://docs.sentry.io/platforms/php/configuration/options/\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/php/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/php/configuration/sampling/\">sample transactions</a>.</p>"
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>To capture all errors and transactions, even the one during the startup of your application, you should initialize the Sentry PHP SDK as soon as possible.</p><div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript highlight\"><code class=\"language-javascript\"><span class=\"token punctuation\">\\</span>Sentry<span class=\"token punctuation\">\\</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">[</span>\n <span class=\"token literal-property property\">'dsn' </span><span class=\"token operator\">=></span> <span class=\"token string\">'___PUBLIC_DSN___'</span><span class=\"token punctuation\">,</span>\n\n <span class=\"token comment\">// Set tracesSampleRate to 1.0 to capture 100%</span>\n <span class=\"token comment\">// of transactions for performance monitoring.</span>\n <span class=\"token literal-property property\">'traces_sample_rate'</span> <span class=\"token operator\">=></span> <span class=\"token number\">1.0</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">]</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>We recommend adjusting the value of <code>tracesSampleRate</code> in production. Learn more about tracing <a href=\"https://docs.sentry.io/platforms/php/configuration/options/\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/php/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/php/configuration/sampling/\">sample transactions</a>.</p>"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"name": "Django",
"aliases": [],
"categories": [],
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>To configure the Sentry SDK, initialize it in your <code>settings.py</code> file:</p>\n<div class=\"gatsby-highlight\" data-language=\"python\"><pre class=\"language-Python highlight\"><code class=\"language-python\"><span class=\"token keyword\">import</span> sentry-sdk\n\nsentry_sdk<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">=</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">traces_sample_rate=1.0,</span>\n<span class=\"token punctuation\">)</span></code></pre></div>\n<p>Learn more about tracing <a href=\"https://docs.sentry.io/platforms/python/configuration/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">sample transactions</a>.</p>"
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>To configure the Sentry SDK, initialize it in your <code>settings.py</code> file:</p>\n<div class=\"gatsby-highlight\" data-language=\"python\"><pre class=\"language-Python highlight\"><code class=\"language-python\"><span class=\"token keyword\">import</span> sentry-sdk\n\nsentry_sdk<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">=</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n\n <span class=\"token comment\">// Set traces_sample_rate to 1.0 to capture 100%</span>\n <span class=\"token comment\">// of transactions for performance monitoring.</span>\n <span class=\"token literal-property property\">traces_sample_rate=1.0,</span>\n<span class=\"token punctuation\">)</span></code></pre></div>\n<p>Learn more about tracing <a href=\"https://docs.sentry.io/platforms/python/configuration/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">sample transactions</a>.</p>"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"name": "Flask",
"aliases": [],
"categories": [],
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>To configure the Sentry SDK, initialize it in your <code>settings.py</code> file:</p>\n<div class=\"gatsby-highlight\" data-language=\"python\"><pre class=\"language-Python highlight\"><code class=\"language-python\"><span class=\"token keyword\">import</span> sentry-sdk\n\nsentry_sdk<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">=</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">traces_sample_rate=1.0,</span>\n<span class=\"token punctuation\">)</span></code></pre></div>\n<p>Learn more about tracing <a href=\"https://docs.sentry.io/platforms/python/configuration/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">sample transactions</a>.</p>"
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>To configure the Sentry SDK, initialize it in your <code>settings.py</code> file:</p>\n<div class=\"gatsby-highlight\" data-language=\"python\"><pre class=\"language-Python highlight\"><code class=\"language-python\"><span class=\"token keyword\">import</span> sentry-sdk\n\nsentry_sdk<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">=</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n\n <span class=\"token comment\">// Set traces_sample_rate to 1.0 to capture 100%</span>\n <span class=\"token comment\">// of transactions for performance monitoring.</span>\n <span class=\"token literal-property property\">traces_sample_rate=1.0,</span>\n<span class=\"token punctuation\">)</span></code></pre></div>\n<p>Learn more about tracing <a href=\"https://docs.sentry.io/platforms/python/configuration/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">sample transactions</a>.</p>"
}
2 changes: 1 addition & 1 deletion src/build/resolveOpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {DeRefedOpenAPI} from './open-api/types';

// SENTRY_API_SCHEMA_SHA is used in the sentry-docs GHA workflow in getsentry/sentry-api-schema.
// DO NOT change variable name unless you change it in the sentry-docs GHA workflow in getsentry/sentry-api-schema.
const SENTRY_API_SCHEMA_SHA = '33ec19102e71772414275162bf836b9be8eff9df';
const SENTRY_API_SCHEMA_SHA = '0c6eb6d9beeaa731bb78f4027991a0d8ae020914';

const activeEnv = process.env.GATSBY_ENV || process.env.NODE_ENV || 'development';

Expand Down

0 comments on commit f46ea5c

Please sign in to comment.