Skip to content

Commit 89c2c42

Browse files
AbhiPrasadonurtemizkan
authored andcommitted
fix(tracing): Add express category to express middleware spans (#4223)
As per: https://develop.sentry.dev/sdk/performance/span-operations/#web-frameworks
1 parent 542ff1d commit 89c2c42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/tracing/src/integrations/node/express.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function wrap(fn: Function, method: Method): (...args: any[]) => void {
111111
if (transaction) {
112112
const span = transaction.startChild({
113113
description: fn.name,
114-
op: `middleware.${method}`,
114+
op: `express.middleware.${method}`,
115115
});
116116
res.once('finish', () => {
117117
span.finish();
@@ -130,7 +130,7 @@ function wrap(fn: Function, method: Method): (...args: any[]) => void {
130130
const transaction = res.__sentry_transaction;
131131
const span = transaction?.startChild({
132132
description: fn.name,
133-
op: `middleware.${method}`,
133+
op: `express.middleware.${method}`,
134134
});
135135
fn.call(this, req, res, function(this: NodeJS.Global, ...args: unknown[]): void {
136136
span?.finish();
@@ -149,7 +149,7 @@ function wrap(fn: Function, method: Method): (...args: any[]) => void {
149149
const transaction = res.__sentry_transaction;
150150
const span = transaction?.startChild({
151151
description: fn.name,
152-
op: `middleware.${method}`,
152+
op: `express.middleware.${method}`,
153153
});
154154
fn.call(this, err, req, res, function(this: NodeJS.Global, ...args: unknown[]): void {
155155
span?.finish();

0 commit comments

Comments
 (0)