Skip to content

Commit abcdbbb

Browse files
authored
Merge branch 'develop' into sig/astro-4-tests
2 parents d12fb74 + 662da80 commit abcdbbb

File tree

47 files changed

+525
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+525
-277
lines changed

MIGRATION.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ These docs walk through how to migrate our JavaScript SDKs through different maj
66
- Upgrading from [SDK 6.x to 7.x](./docs/migration/v6-to-v7.md)
77
- Upgrading from [SDK 7.x to 8.x](./docs/migration/v7-to-v8.md)
88
- Upgrading from [SDK 8.x to 9.x](./docs/migration/v8-to-v9.md)
9-
<<<<<<< HEAD
10-
- # Upgrading from [SDK 9.x to 10.x](#upgrading-from-9x-to-10x)
11-
- Upgrading from [SDK 9.x to 10.x](#upgrading-from-8x-to-9x)
12-
> > > > > > > f726d5ab5 (chore: Add migration guide for v10 and move v8->v9 guide to docs)
9+
- Upgrading from [SDK 9.x to 10.x](#upgrading-from-9x-to-10x)
1310

1411
# Upgrading from 9.x to 10.x
1512

@@ -42,6 +39,27 @@ Updates and fixes for version 9 will be published as `SentryNodeServerlessSDKv9`
4239
- `BaseClient` was removed, use `Client` as a direct replacement.
4340
- `hasTracingEnabled` was removed, use `hasSpansEnabled` as a direct replacement.
4441
- `logger` and type `Logger` were removed, use `debug` and type `SentryDebugLogger` instead.
42+
- The `_experiments.enableLogs` and `_experiments.beforeSendLog` options were removed, use the top-level `enableLogs` and `beforeSendLog` options instead.
43+
44+
```js
45+
// before
46+
Sentry.init({
47+
_experiments: {
48+
enableLogs: true,
49+
beforeSendLog: log => {
50+
return log;
51+
},
52+
},
53+
});
54+
55+
// after
56+
Sentry.init({
57+
enableLogs: true,
58+
beforeSendLog: log => {
59+
return log;
60+
},
61+
});
62+
```
4563

4664
## No Version Support Timeline
4765

dev-packages/browser-integration-tests/suites/public-api/logger/init.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
7-
_experiments: {
8-
enableLogs: true,
9-
},
7+
enableLogs: true,
108
});

dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
7-
_experiments: {
8-
enableLogs: true,
9-
},
7+
enableLogs: true,
108
integrations: [Sentry.consoleLoggingIntegration()],
119
});

dev-packages/e2e-tests/test-applications/aws-lambda-layer-cjs/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
},
1919
"volta": {
2020
"extends": "../../package.json"
21+
},
22+
"sentryTest": {
23+
"skip": true
2124
}
2225
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "aws-lambda-layer-esm",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"start": "node src/run.mjs",
7+
"test": "playwright test",
8+
"clean": "npx rimraf node_modules pnpm-lock.yaml",
9+
"test:build": "pnpm install",
10+
"test:assert": "pnpm test"
11+
},
12+
"//": "Link from local Lambda layer build",
13+
"dependencies": {
14+
"@sentry/aws-serverless": "link:../../../../packages/aws-serverless/build/aws/dist-serverless/nodejs/node_modules/@sentry/aws-serverless"
15+
},
16+
"devDependencies": {
17+
"@sentry-internal/test-utils": "link:../../../test-utils",
18+
"@playwright/test": "~1.53.2"
19+
},
20+
"volta": {
21+
"extends": "../../package.json"
22+
},
23+
"sentryTest": {
24+
"skip": true
25+
}
26+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
2+
3+
export default getPlaywrightConfig();
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as Sentry from '@sentry/aws-serverless';
2+
3+
import * as http from 'node:http';
4+
5+
async function handle() {
6+
await Sentry.startSpan({ name: 'manual-span', op: 'test' }, async () => {
7+
await new Promise(resolve => {
8+
http.get('http://example.com', res => {
9+
res.on('data', d => {
10+
process.stdout.write(d);
11+
});
12+
13+
res.on('end', () => {
14+
resolve();
15+
});
16+
});
17+
});
18+
});
19+
}
20+
21+
export { handle };
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { handle } from './lambda-function.mjs';
2+
3+
const event = {};
4+
const context = {
5+
invokedFunctionArn: 'arn:aws:lambda:us-east-1:123453789012:function:my-lambda',
6+
functionName: 'my-lambda',
7+
};
8+
await handle(event, context);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import child_process from 'node:child_process';
2+
3+
child_process.execSync('node ./src/run-lambda.mjs', {
4+
stdio: 'inherit',
5+
env: {
6+
...process.env,
7+
// On AWS, LAMBDA_TASK_ROOT is usually /var/task but for testing, we set it to the CWD to correctly apply our handler
8+
LAMBDA_TASK_ROOT: process.cwd(),
9+
_HANDLER: 'src/lambda-function.handle',
10+
11+
NODE_OPTIONS: '--import @sentry/aws-serverless/awslambda-auto',
12+
SENTRY_DSN: 'http://public@localhost:3031/1337',
13+
SENTRY_TRACES_SAMPLE_RATE: '1.0',
14+
SENTRY_DEBUG: 'true',
15+
},
16+
cwd: process.cwd(),
17+
});

0 commit comments

Comments
 (0)