Skip to content

Commit f795461

Browse files
committed
feat(core): Deprecate startTransaction()
1 parent 5eeb8a9 commit f795461

File tree

48 files changed

+241
-148
lines changed

Some content is hidden

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

48 files changed

+241
-148
lines changed

MIGRATION.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ npx @sentry/migr8@latest
88

99
This will let you select which updates to run, and automatically update your code. Make sure to still review all code changes!
1010

11+
## Deprecate `startTransaction()`
12+
13+
In v8, the old performance API `startTransaction()` (as well as `hub.startTransaction()`) will be removed.
14+
Instead, you have to use the new performance APIs:
15+
16+
* `startSpan()`
17+
* `startSpanManual()`
18+
* `startInactiveSpan()`
19+
20+
You can [read more about the new performance APIs here](./docs/v8-new-performance-apis.md).
21+
1122
## Deprecate `Sentry.lastEventId()` and `hub.lastEventId()`
1223

1324
`Sentry.lastEventId()` sometimes causes race conditons, so we are deprecating it in favour of the `beforeSend` callback.

dev-packages/e2e-tests/test-applications/create-next-app/pages/api/success.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as Sentry from '@sentry/nextjs';
33
import type { NextApiRequest, NextApiResponse } from 'next';
44

55
export default function handler(req: NextApiRequest, res: NextApiResponse) {
6+
// eslint-disable-next-line deprecation/deprecation
67
const transaction = Sentry.startTransaction({ name: 'test-transaction', op: 'e2e-test' });
78
Sentry.getCurrentHub().getScope().setSpan(transaction);
89

dev-packages/e2e-tests/test-applications/node-express-app/src/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ app.get('/test-param/:param', function (req, res) {
3434
});
3535

3636
app.get('/test-transaction', async function (req, res) {
37+
// eslint-disable-next-line deprecation/deprecation
3738
const transaction = Sentry.startTransaction({ name: 'test-transaction', op: 'e2e-test' });
3839
Sentry.getCurrentScope().setSpan(transaction);
3940

dev-packages/node-integration-tests/suites/public-api/startTransaction/basic-usage/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Sentry.init({
99
tracesSampleRate: 1.0,
1010
});
1111

12+
// eslint-disable-next-line deprecation/deprecation
1213
const transaction = Sentry.startTransaction({ name: 'test_transaction_1' });
1314

1415
transaction.end();

dev-packages/node-integration-tests/suites/public-api/startTransaction/with-nested-spans/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Sentry.init({
88
tracesSampleRate: 1.0,
99
});
1010

11+
// eslint-disable-next-line deprecation/deprecation
1112
const transaction = Sentry.startTransaction({ name: 'test_transaction_1' });
1213
const span_1 = transaction.startChild({
1314
op: 'span_1',

dev-packages/node-integration-tests/suites/tracing-new/apollo-graphql/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const server = new ApolloServer({
2727
resolvers,
2828
});
2929

30+
// eslint-disable-next-line deprecation/deprecation
3031
const transaction = Sentry.startTransaction({ name: 'test_transaction', op: 'transaction' });
3132

3233
Sentry.getCurrentScope().setSpan(transaction);

dev-packages/node-integration-tests/suites/tracing-new/auto-instrument/mongodb/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const client = new MongoClient(process.env.MONGO_URL || '', {
1616
});
1717

1818
async function run(): Promise<void> {
19+
// eslint-disable-next-line deprecation/deprecation
1920
const transaction = Sentry.startTransaction({
2021
name: 'Test Transaction',
2122
op: 'transaction',

dev-packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withConnect/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ connection.connect(function (err: unknown) {
1919
}
2020
});
2121

22+
// eslint-disable-next-line deprecation/deprecation
2223
const transaction = Sentry.startTransaction({
2324
op: 'transaction',
2425
name: 'Test Transaction',

dev-packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutCallback/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ connection.connect(function (err: unknown) {
1919
}
2020
});
2121

22+
// eslint-disable-next-line deprecation/deprecation
2223
const transaction = Sentry.startTransaction({
2324
op: 'transaction',
2425
name: 'Test Transaction',

dev-packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutConnect/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const connection = mysql.createConnection({
1313
password: 'docker',
1414
});
1515

16+
// eslint-disable-next-line deprecation/deprecation
1617
const transaction = Sentry.startTransaction({
1718
op: 'transaction',
1819
name: 'Test Transaction',

0 commit comments

Comments
 (0)