-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12073 from getsentry/prepare-release/8.2.0
meta(changelog): Update changelog for v8.2.0
- Loading branch information
Showing
39 changed files
with
1,029 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
dev-packages/e2e-tests/test-applications/node-express-esm-without-loader/.npmrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@sentry:registry=http://127.0.0.1:4873 | ||
@sentry-internal:registry=http://127.0.0.1:4873 |
24 changes: 24 additions & 0 deletions
24
dev-packages/e2e-tests/test-applications/node-express-esm-without-loader/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "node-express-esm-without-loader", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"start": "node src/app.mjs", | ||
"clean": "npx rimraf node_modules pnpm-lock.yaml", | ||
"test:build": "pnpm install", | ||
"test:assert": "playwright test" | ||
}, | ||
"dependencies": { | ||
"@sentry/node": "latest || *", | ||
"@sentry/opentelemetry": "latest || *", | ||
"express": "4.19.2" | ||
}, | ||
"devDependencies": { | ||
"@sentry-internal/event-proxy-server": "link:../../../event-proxy-server", | ||
"@playwright/test": "^1.27.1" | ||
}, | ||
"volta": { | ||
"extends": "../../package.json", | ||
"node": "18.19.1" | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
...packages/e2e-tests/test-applications/node-express-esm-without-loader/playwright.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import type { PlaywrightTestConfig } from '@playwright/test'; | ||
import { devices } from '@playwright/test'; | ||
|
||
// Fix urls not resolving to localhost on Node v17+ | ||
// See: https://github.com/axios/axios/issues/3821#issuecomment-1413727575 | ||
import { setDefaultResultOrder } from 'dns'; | ||
setDefaultResultOrder('ipv4first'); | ||
|
||
const eventProxyPort = 3031; | ||
const expressPort = 3030; | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
const config: PlaywrightTestConfig = { | ||
testDir: './tests', | ||
/* Maximum time one test can run for. */ | ||
timeout: 150_000, | ||
expect: { | ||
/** | ||
* Maximum time expect() should wait for the condition to be met. | ||
* For example in `await expect(locator).toHaveText();` | ||
*/ | ||
timeout: 5000, | ||
}, | ||
/* Run tests in files in parallel */ | ||
fullyParallel: true, | ||
/* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
forbidOnly: !!process.env.CI, | ||
/* Retry on CI only */ | ||
retries: 0, | ||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
reporter: 'list', | ||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
use: { | ||
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ | ||
actionTimeout: 0, | ||
|
||
/* Base URL to use in actions like `await page.goto('/')`. */ | ||
baseURL: `http://localhost:${expressPort}`, | ||
}, | ||
|
||
/* Configure projects for major browsers */ | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { | ||
...devices['Desktop Chrome'], | ||
}, | ||
}, | ||
], | ||
|
||
/* Run your local dev server before starting the tests */ | ||
webServer: [ | ||
{ | ||
command: 'node start-event-proxy.mjs', | ||
port: eventProxyPort, | ||
stdout: 'pipe', | ||
stderr: 'pipe', | ||
}, | ||
{ | ||
command: 'pnpm start', | ||
port: expressPort, | ||
stdout: 'pipe', | ||
stderr: 'pipe', | ||
}, | ||
], | ||
}; | ||
|
||
export default config; |
46 changes: 46 additions & 0 deletions
46
dev-packages/e2e-tests/test-applications/node-express-esm-without-loader/src/app.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import './instrument.mjs'; | ||
|
||
// Below other imports | ||
import * as Sentry from '@sentry/node'; | ||
import express from 'express'; | ||
|
||
const app = express(); | ||
const port = 3030; | ||
|
||
app.get('/test-success', function (req, res) { | ||
setTimeout(() => { | ||
res.status(200).end(); | ||
}, 100); | ||
}); | ||
|
||
app.get('/test-params/:param', function (req, res) { | ||
const { param } = req.params; | ||
Sentry.setTag(`param-${param}`, 'yes'); | ||
Sentry.captureException(new Error(`Error for param ${param}`)); | ||
|
||
setTimeout(() => { | ||
res.status(200).end(); | ||
}, 100); | ||
}); | ||
|
||
app.get('/test-error', function (req, res) { | ||
Sentry.captureException(new Error('This is an error')); | ||
setTimeout(() => { | ||
Sentry.flush(2000).then(() => { | ||
res.status(200).end(); | ||
}); | ||
}, 100); | ||
}); | ||
|
||
Sentry.setupExpressErrorHandler(app); | ||
|
||
app.use(function onError(err, req, res, next) { | ||
// The error id is attached to `res.sentry` to be returned | ||
// and optionally displayed to the user for support. | ||
res.statusCode = 500; | ||
res.end(res.sentry + '\n'); | ||
}); | ||
|
||
app.listen(port, () => { | ||
console.log(`Example app listening on port ${port}`); | ||
}); |
7 changes: 7 additions & 0 deletions
7
dev-packages/e2e-tests/test-applications/node-express-esm-without-loader/src/instrument.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as Sentry from '@sentry/node'; | ||
|
||
Sentry.init({ | ||
environment: 'qa', // dynamic sampling bias to keep transactions | ||
dsn: process.env.E2E_TEST_DSN, | ||
tunnel: `http://localhost:3031/`, // proxy server | ||
}); |
6 changes: 6 additions & 0 deletions
6
...ackages/e2e-tests/test-applications/node-express-esm-without-loader/start-event-proxy.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { startEventProxyServer } from '@sentry-internal/event-proxy-server'; | ||
|
||
startEventProxyServer({ | ||
port: 3031, | ||
proxyServerName: 'node-express-esm-without-loader', | ||
}); |
34 changes: 34 additions & 0 deletions
34
...packages/e2e-tests/test-applications/node-express-esm-without-loader/tests/server.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { waitForError } from '@sentry-internal/event-proxy-server'; | ||
|
||
test('Should record exceptions captured inside handlers', async ({ request }) => { | ||
const errorEventPromise = waitForError('node-express-esm-without-loader', errorEvent => { | ||
return !!errorEvent?.exception?.values?.[0]?.value?.includes('This is an error'); | ||
}); | ||
|
||
await request.get('/test-error'); | ||
|
||
await expect(errorEventPromise).resolves.toBeDefined(); | ||
}); | ||
|
||
test('Isolates requests', async ({ request }) => { | ||
const errorEventPromise = waitForError('node-express-esm-without-loader', errorEvent => { | ||
return !!errorEvent?.exception?.values?.[0]?.value?.includes('Error for param 1'); | ||
}); | ||
|
||
const errorEventPromise2 = waitForError('node-express-esm-without-loader', errorEvent => { | ||
return !!errorEvent?.exception?.values?.[0]?.value?.includes('Error for param 2'); | ||
}); | ||
|
||
await request.get('/test-params/1'); | ||
await request.get('/test-params/2'); | ||
|
||
const errorEvent1 = await errorEventPromise; | ||
const errorEvent2 = await errorEventPromise2; | ||
|
||
expect(errorEvent1.tags).toEqual({ 'param-1': 'yes' }); | ||
expect(errorEvent2.tags).toEqual({ 'param-2': 'yes' }); | ||
|
||
expect(errorEvent1.transaction).toBe('GET /test-params/1'); | ||
expect(errorEvent2.transaction).toBe('GET /test-params/2'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
dev-packages/node-integration-tests/suites/tracing/redis-cache/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '3.9' | ||
|
||
services: | ||
db: | ||
image: redis:latest | ||
restart: always | ||
container_name: integration-tests-redis | ||
ports: | ||
- '6379:6379' |
41 changes: 41 additions & 0 deletions
41
dev-packages/node-integration-tests/suites/tracing/redis-cache/scenario-ioredis.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const { loggingTransport } = require('@sentry-internal/node-integration-tests'); | ||
const Sentry = require('@sentry/node'); | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/1337', | ||
release: '1.0', | ||
tracesSampleRate: 1.0, | ||
transport: loggingTransport, | ||
integrations: [Sentry.redisIntegration({ cachePrefixes: ['ioredis-cache:'] })], | ||
}); | ||
|
||
// Stop the process from exiting before the transaction is sent | ||
setInterval(() => {}, 1000); | ||
|
||
const Redis = require('ioredis'); | ||
|
||
const redis = new Redis({ port: 6379 }); | ||
|
||
async function run() { | ||
await Sentry.startSpan( | ||
{ | ||
name: 'Test Span', | ||
op: 'test-span', | ||
}, | ||
async () => { | ||
try { | ||
await redis.set('test-key', 'test-value'); | ||
await redis.set('ioredis-cache:test-key', 'test-value'); | ||
|
||
await redis.get('test-key'); | ||
await redis.get('ioredis-cache:test-key'); | ||
await redis.get('ioredis-cache:unavailable-data'); | ||
} finally { | ||
await redis.disconnect(); | ||
} | ||
}, | ||
); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
run(); |
Oops, something went wrong.