Skip to content

Commit

Permalink
feat(server): use convetional 'op', force transaction, provide more d…
Browse files Browse the repository at this point in the history
…ata to Sentry
  • Loading branch information
dirkdev98 committed Apr 15, 2024
1 parent 0d7e9c7 commit cc9203e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/server/src/middleware/sentry.js
Expand Up @@ -22,7 +22,9 @@ export function sentry() {
}

return async (ctx, next) => {
let traceParentData;
let traceParentData = {
forceTransaction: true,
};
if (ctx.request.get("sentry-trace")) {
// @ts-expect-error
traceParentData = _compasSentryExport.extractTraceparentData(
Expand All @@ -33,9 +35,14 @@ export function sentry() {
// @ts-expect-error
return await _compasSentryExport.startSpanManual(
{
op: "http",
op: "http.server",
name: "http",
description: "http",
...traceParentData,
data: {
"http.request.method": ctx.method,
"http.request.url": ctx.url,
},
},
async () => {
return await next();
Expand Down

0 comments on commit cc9203e

Please sign in to comment.