diff --git a/AGENTS.md b/AGENTS.md index c1ac68c704ff..7d82bc26a0ad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -94,6 +94,7 @@ Uses **Git Flow** (see `docs/gitflow.md`). - Only use libraries already in the codebase - Never expose secrets or keys - When modifying files, cover all occurrences (including `src/` and `test/`) +- Use the constants from `@sentry/conventions/attributes` (e.g. `SENTRY_ORIGIN`) and `@sentry/conventions/op` instead of string literals for attribute names and span ops, in both source and tests. Use a literal only when no constant exists or the package can't depend on `@sentry/conventions` (e.g. most E2E test apps). - **Write few comments; default to none.** Comments explain **why**, never **what** — never add a comment that restates what the code does or narrates the change being made. Only add one when the reasoning isn't clear from the code itself, or to flag a tradeoff or something that would otherwise look surprising to a reader. When in doubt, leave it out. - Do not use `expect(someSpy.mock.calls[0]?.[0])` or similar constructs to check what a spy was called with. Instead use `expect(someSpy).toHaveBeenCalledWith(...)` or derivatives for a more readable and less brittle test assertion. diff --git a/dev-packages/browser-integration-tests/suites/public-api/startSpan/basic/test.ts b/dev-packages/browser-integration-tests/suites/public-api/startSpan/basic/test.ts index 824220e5133f..6796a6514332 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/startSpan/basic/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/startSpan/basic/test.ts @@ -1,4 +1,4 @@ -import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_ORIGIN, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import { expect } from '@playwright/test'; import { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '@sentry/browser'; import { sentryTest } from '../../../../utils/fixtures'; @@ -24,6 +24,7 @@ sentryTest( [SENTRY_ORIGIN]: 'manual', [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1, [SENTRY_SEGMENT_NAME_SOURCE]: 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }); expect(transaction.transaction_info?.source).toBe('custom'); diff --git a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-animation-frame-enabled/test.ts b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-animation-frame-enabled/test.ts index 937662e117a4..21cd31785087 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-animation-frame-enabled/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-animation-frame-enabled/test.ts @@ -1,4 +1,4 @@ -import { SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { SENTRY_OP, SENTRY_ORIGIN, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { Route } from '@playwright/test'; import { expect } from '@playwright/test'; import type { Event } from '@sentry/core'; @@ -46,6 +46,7 @@ sentryTest( 'browser.script.invoker_type': 'classic-script', [SENTRY_OP]: 'ui.long_animation_frame', [SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, }), ); @@ -100,6 +101,7 @@ sentryTest( 'code.file.path': 'https://sentry-test-site.example/path/to/script.js', [SENTRY_OP]: 'ui.long_animation_frame', [SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, }), ); diff --git a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-tasks-and-animation-frame-enabled/test.ts b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-tasks-and-animation-frame-enabled/test.ts index b571a7d6a306..8bff40470e67 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-tasks-and-animation-frame-enabled/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-tasks-and-animation-frame-enabled/test.ts @@ -1,4 +1,4 @@ -import { SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { SENTRY_OP, SENTRY_ORIGIN, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { Route } from '@playwright/test'; import { expect } from '@playwright/test'; import type { Event } from '@sentry/core'; @@ -48,6 +48,7 @@ sentryTest( 'browser.script.invoker_type': 'classic-script', [SENTRY_OP]: 'ui.long_animation_frame', [SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, }), ); @@ -102,6 +103,7 @@ sentryTest( 'code.file.path': 'https://sentry-test-site.example/path/to/script.js', [SENTRY_OP]: 'ui.long_animation_frame', [SENTRY_ORIGIN]: 'auto.ui.browser.metrics', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, }), ); diff --git a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-redirect/multiple-redirects/test.ts b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-redirect/multiple-redirects/test.ts index caa2b6afb328..3cb13f818506 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-redirect/multiple-redirects/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-redirect/multiple-redirects/test.ts @@ -8,6 +8,7 @@ import { URL_PATH, SENTRY_OP, SENTRY_ORIGIN, + SENTRY_TRACE_LIFECYCLE, } from '@sentry/conventions/attributes'; sentryTest( @@ -58,6 +59,7 @@ sentryTest( data: { 'sentry.op': 'navigation.redirect', 'sentry.origin': 'auto.navigation.browser', + [SENTRY_TRACE_LIFECYCLE]: 'static', [URL_FULL]: expect.any(String), [URL_PATH]: expect.any(String), }, diff --git a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-redirect/pageload-redirect/test.ts b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-redirect/pageload-redirect/test.ts index fc126da536f3..9ba83903b9f7 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-redirect/pageload-redirect/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-redirect/pageload-redirect/test.ts @@ -8,6 +8,7 @@ import { URL_PATH, SENTRY_OP, SENTRY_ORIGIN, + SENTRY_TRACE_LIFECYCLE, } from '@sentry/conventions/attributes'; sentryTest('creates a pageload root span with navigation.redirect childspan', async ({ getLocalTestUrl, page }) => { @@ -54,6 +55,7 @@ sentryTest('creates a pageload root span with navigation.redirect childspan', as data: { 'sentry.op': 'navigation.redirect', 'sentry.origin': 'auto.navigation.browser', + [SENTRY_TRACE_LIFECYCLE]: 'static', [URL_FULL]: 'http://sentry-test.io/sub-page', [URL_PATH]: '/sub-page', }, diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts index 276234385fae..ffbb2f307857 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts @@ -1,4 +1,4 @@ -import { SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { SENTRY_OP, SENTRY_ORIGIN, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { Route } from '@playwright/test'; import { expect } from '@playwright/test'; import { type Event } from '@sentry/core'; @@ -98,6 +98,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU 'network.protocol.version': 'unknown', [SENTRY_OP]: 'resource.img', [SENTRY_ORIGIN]: 'auto.resource.browser.metrics', + [SENTRY_TRACE_LIFECYCLE]: 'static', 'server.address': 'sentry-test-site.example', 'url.domain': 'sentry-test-site.example', 'http.request.same_origin': false, @@ -151,6 +152,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU 'network.protocol.version': 'unknown', [SENTRY_OP]: 'resource.link', [SENTRY_ORIGIN]: 'auto.resource.browser.metrics', + [SENTRY_TRACE_LIFECYCLE]: 'static', 'server.address': 'sentry-test-site.example', 'url.domain': 'sentry-test-site.example', 'http.request.same_origin': false, @@ -197,6 +199,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU 'network.protocol.version': 'unknown', 'sentry.op': 'resource.script', 'sentry.origin': 'auto.resource.browser.metrics', + [SENTRY_TRACE_LIFECYCLE]: 'static', 'server.address': 'sentry-test-site.example', 'url.domain': 'sentry-test-site.example', 'http.request.same_origin': false, diff --git a/dev-packages/browser-integration-tests/suites/tracing/user-timing/pageload-measure-spans/test.ts b/dev-packages/browser-integration-tests/suites/tracing/user-timing/pageload-measure-spans/test.ts index 365bc082372f..900e97feac59 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/user-timing/pageload-measure-spans/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/user-timing/pageload-measure-spans/test.ts @@ -1,3 +1,4 @@ +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import { expect } from '@playwright/test'; import type { Event } from '@sentry/core'; import { sentryTest } from '../../../../utils/fixtures'; @@ -31,5 +32,6 @@ sentryTest('should add browser-related spans to pageload transaction', async ({ 'sentry.browser.measure_start_time': expect.any(Number), 'sentry.op': 'measure', 'sentry.origin': 'auto.browser.user_timing.measure', + [SENTRY_TRACE_LIFECYCLE]: 'static', }); }); diff --git a/dev-packages/bundler-plugin-integration-tests/fixtures/esbuild/telemetry.test.ts b/dev-packages/bundler-plugin-integration-tests/fixtures/esbuild/telemetry.test.ts index 972a967bbe09..b71f8c933f57 100644 --- a/dev-packages/bundler-plugin-integration-tests/fixtures/esbuild/telemetry.test.ts +++ b/dev-packages/bundler-plugin-integration-tests/fixtures/esbuild/telemetry.test.ts @@ -6,7 +6,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { expect(readOutputFiles()).toMatchInlineSnapshot(` { "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":true,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"ok","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], - [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"esbuild","bundler-major-version":"28"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], + [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3,"sentry.trace_lifecycle":"static"},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"esbuild","bundler-major-version":"28"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], [{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", "telemetry.js": "(() => { diff --git a/dev-packages/bundler-plugin-integration-tests/fixtures/rolldown/telemetry.test.ts b/dev-packages/bundler-plugin-integration-tests/fixtures/rolldown/telemetry.test.ts index f8004bc8ee3c..586d740c829d 100644 --- a/dev-packages/bundler-plugin-integration-tests/fixtures/rolldown/telemetry.test.ts +++ b/dev-packages/bundler-plugin-integration-tests/fixtures/rolldown/telemetry.test.ts @@ -18,7 +18,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { //#endregion ", "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":true,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"ok","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], - [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"rollup","bundler-major-version":"4"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], + [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3,"sentry.trace_lifecycle":"static"},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"rollup","bundler-major-version":"4"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], [{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", } diff --git a/dev-packages/bundler-plugin-integration-tests/fixtures/rollup3/telemetry.test.ts b/dev-packages/bundler-plugin-integration-tests/fixtures/rollup3/telemetry.test.ts index 648a01c4719b..d66e532c7197 100644 --- a/dev-packages/bundler-plugin-integration-tests/fixtures/rollup3/telemetry.test.ts +++ b/dev-packages/bundler-plugin-integration-tests/fixtures/rollup3/telemetry.test.ts @@ -9,7 +9,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="00000000-0000-0000-0000-000000000000",e._sentryDebugIdIdentifier="sentry-dbid-00000000-0000-0000-0000-000000000000");}catch(e){}}();console.log("hello world"); ", "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":true,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"ok","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], - [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"rollup","bundler-major-version":"3"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], + [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3,"sentry.trace_lifecycle":"static"},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"rollup","bundler-major-version":"3"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], [{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", } diff --git a/dev-packages/bundler-plugin-integration-tests/fixtures/rollup4/telemetry.test.ts b/dev-packages/bundler-plugin-integration-tests/fixtures/rollup4/telemetry.test.ts index 94c6834500fd..6c5282acac1d 100644 --- a/dev-packages/bundler-plugin-integration-tests/fixtures/rollup4/telemetry.test.ts +++ b/dev-packages/bundler-plugin-integration-tests/fixtures/rollup4/telemetry.test.ts @@ -9,7 +9,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="00000000-0000-0000-0000-000000000000",e._sentryDebugIdIdentifier="sentry-dbid-00000000-0000-0000-0000-000000000000");}catch(e){}}();console.log("hello world"); ", "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":true,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"ok","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], - [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"rollup","bundler-major-version":"4"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], + [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3,"sentry.trace_lifecycle":"static"},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"rollup","bundler-major-version":"4"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], [{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", } diff --git a/dev-packages/bundler-plugin-integration-tests/fixtures/vite4/telemetry.test.ts b/dev-packages/bundler-plugin-integration-tests/fixtures/vite4/telemetry.test.ts index 1f3f77b816df..707016763226 100644 --- a/dev-packages/bundler-plugin-integration-tests/fixtures/vite4/telemetry.test.ts +++ b/dev-packages/bundler-plugin-integration-tests/fixtures/vite4/telemetry.test.ts @@ -17,7 +17,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { console.log("hello world"); ", "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":true,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"ok","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], - [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"vite","bundler-major-version":"4"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], + [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3,"sentry.trace_lifecycle":"static"},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"vite","bundler-major-version":"4"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], [{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", } diff --git a/dev-packages/bundler-plugin-integration-tests/fixtures/vite7/telemetry.test.ts b/dev-packages/bundler-plugin-integration-tests/fixtures/vite7/telemetry.test.ts index ac0e8b7b217f..1a76ebdd7ce1 100644 --- a/dev-packages/bundler-plugin-integration-tests/fixtures/vite7/telemetry.test.ts +++ b/dev-packages/bundler-plugin-integration-tests/fixtures/vite7/telemetry.test.ts @@ -17,7 +17,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { console.log("hello world"); ", "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":true,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"ok","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], - [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"vite","bundler-major-version":"7"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], + [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3,"sentry.trace_lifecycle":"static"},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"vite","bundler-major-version":"7"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], [{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", } diff --git a/dev-packages/bundler-plugin-integration-tests/fixtures/vite8/telemetry.test.ts b/dev-packages/bundler-plugin-integration-tests/fixtures/vite8/telemetry.test.ts index 608d363246ba..d6ebfd9ad190 100644 --- a/dev-packages/bundler-plugin-integration-tests/fixtures/vite8/telemetry.test.ts +++ b/dev-packages/bundler-plugin-integration-tests/fixtures/vite8/telemetry.test.ts @@ -18,7 +18,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { //#endregion ", "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":true,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"ok","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], - [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"vite","bundler-major-version":"8"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], + [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3,"sentry.trace_lifecycle":"static"},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"vite","bundler-major-version":"8"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], [{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", } diff --git a/dev-packages/bundler-plugin-integration-tests/fixtures/webpack5/telemetry.test.ts b/dev-packages/bundler-plugin-integration-tests/fixtures/webpack5/telemetry.test.ts index e8b0d915de0e..40b903ed8d45 100644 --- a/dev-packages/bundler-plugin-integration-tests/fixtures/webpack5/telemetry.test.ts +++ b/dev-packages/bundler-plugin-integration-tests/fixtures/webpack5/telemetry.test.ts @@ -13,7 +13,7 @@ test(import.meta.url, ({ runBundler, readOutputFiles, runFileInNode }) => { /******/ })() ;", "sentry-telemetry.json": "[{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":true,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"ok","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], - [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"webpack","bundler-major-version":"5"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], + [{"event_id":"UUID","sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"},"trace":{"environment":"production","release":"PLUGIN_VERSION","public_key":"UUID","trace_id":"UUID","org_id":"1","transaction":"Sentry Bundler Plugin execution","sampled":"true","sample_rand":"SAMPLE_RAND","sample_rate":"0.3"}},[[{"type":"transaction"},{"contexts":{"trace":{"span_id":"SHORT_UUID","trace_id":"UUID","data":{"sentry.origin":"manual","sentry.segment.name.source":"custom","sentry.sample_rate":0.3,"sentry.trace_lifecycle":"static"},"status":"ok","origin":"manual"},"runtime":{"name":"node","version":"NODE_VERSION"}},"spans":[],"start_timestamp":START_TIMESTAMP,"timestamp":TIMESTAMP,"transaction":"Sentry Bundler Plugin execution","type":"transaction","transaction_info":{"source":"custom"},"platform":"PLATFORM","event_id":"UUID","environment":"production","release":"PLUGIN_VERSION","tags":{"upload-legacy-sourcemaps":false,"module-metadata":false,"inject-build-information":false,"set-commits":"auto","finalize-release":true,"deploy-options":false,"custom-error-handler":false,"sourcemaps-assets":false,"delete-after-upload":false,"sourcemaps-disabled":false,"react-annotate":false,"node":"NODE_VERSION","platform":"PLATFORM","meta-framework":"none","application-key-set":false,"ci":true,"project":"undefined","bundler":"webpack","bundler-major-version":"5"},"user":{},"sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION","integrations":[],"packages":[{"name":"npm:@sentry/node","version":"SDK_VERSION"}]}}]]], [{"sent_at":"TIMESTAMP","sdk":{"name":"sentry.javascript.node","version":"SDK_VERSION"}},[[{"type":"session"},{"sid":"UUID","init":false,"started":"TIMESTAMP","timestamp":"TIMESTAMP","status":"exited","errors":0,"duration":DURATION,"attrs":{"release":"PLUGIN_VERSION","environment":"production"}}]]], ", } diff --git a/dev-packages/e2e-tests/test-applications/angular-19/tests/performance.test.ts b/dev-packages/e2e-tests/test-applications/angular-19/tests/performance.test.ts index b78206f5566c..a0786bbf1e39 100644 --- a/dev-packages/e2e-tests/test-applications/angular-19/tests/performance.test.ts +++ b/dev-packages/e2e-tests/test-applications/angular-19/tests/performance.test.ts @@ -1,4 +1,4 @@ -import { SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { SENTRY_OP, SENTRY_ORIGIN, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import { expect, test } from '@playwright/test'; import { waitForTransaction } from '@sentry-internal/test-utils'; @@ -267,6 +267,7 @@ test.describe('TraceDirective', () => { [SENTRY_OP]: 'ui.mount', [SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive', 'ui.component_name': 'sample-component', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', // custom component name passed to trace directive op: 'ui.mount', @@ -279,6 +280,7 @@ test.describe('TraceDirective', () => { [SENTRY_OP]: 'ui.mount', [SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive', 'ui.component_name': 'app-sample-component', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', // fallback selector name op: 'ui.mount', @@ -313,6 +315,7 @@ test.describe('TraceClass Decorator', () => { [SENTRY_OP]: 'ui.mount', [SENTRY_ORIGIN]: 'auto.ui.angular.trace_class_decorator', 'ui.component_name': 'ComponentTrackingComponent', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', op: 'ui.mount', @@ -346,6 +349,7 @@ test.describe('TraceMethod Decorator', () => { [SENTRY_OP]: 'function', [SENTRY_ORIGIN]: 'auto.ui.angular.trace_method_decorator', 'code.function.name': 'ngOnInit', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', op: 'function', @@ -377,6 +381,7 @@ test.describe('TraceMethod Decorator', () => { [SENTRY_OP]: 'function', [SENTRY_ORIGIN]: 'auto.ui.angular.trace_method_decorator', 'code.function.name': 'ngAfterViewInit', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', op: 'function', diff --git a/dev-packages/e2e-tests/test-applications/aws-serverless-layer/tests/layer.test.ts b/dev-packages/e2e-tests/test-applications/aws-serverless-layer/tests/layer.test.ts index 862c956d7883..0e6f9eb4b5df 100644 --- a/dev-packages/e2e-tests/test-applications/aws-serverless-layer/tests/layer.test.ts +++ b/dev-packages/e2e-tests/test-applications/aws-serverless-layer/tests/layer.test.ts @@ -47,6 +47,7 @@ test.describe('Lambda layer', () => { 'faas.name': 'LayerTracingCjs', 'faas.coldstart': true, 'sentry.kind': 'server', + 'sentry.trace_lifecycle': 'static', }, op: 'function.aws', origin: 'auto.aws_lambda', @@ -118,6 +119,7 @@ test.describe('Lambda layer', () => { 'faas.name': 'LayerTracingEsm', 'faas.coldstart': true, 'sentry.kind': 'server', + 'sentry.trace_lifecycle': 'static', }, op: 'function.aws', origin: 'auto.aws_lambda', @@ -244,6 +246,7 @@ test.describe('Lambda layer', () => { 'faas.name': 'LayerStreaming', 'faas.coldstart': true, 'sentry.kind': 'server', + 'sentry.trace_lifecycle': 'static', }, op: 'function.aws', origin: 'auto.aws_lambda', diff --git a/dev-packages/e2e-tests/test-applications/ember-strict-resolver/tests/sentry-performance.test.ts b/dev-packages/e2e-tests/test-applications/ember-strict-resolver/tests/sentry-performance.test.ts index 00a5eefc6d6e..46937130498e 100644 --- a/dev-packages/e2e-tests/test-applications/ember-strict-resolver/tests/sentry-performance.test.ts +++ b/dev-packages/e2e-tests/test-applications/ember-strict-resolver/tests/sentry-performance.test.ts @@ -169,6 +169,7 @@ test('captures correct spans for navigation', async ({ page }) => { data: { 'sentry.op': 'router', 'sentry.origin': 'auto.ui.ember', + 'sentry.trace_lifecycle': 'static', }, description: 'route:tracing -> route:slow-loading-route.index', op: 'router', @@ -187,6 +188,7 @@ test('captures correct spans for navigation', async ({ page }) => { 'code.function.name': 'beforeModel', 'sentry.op': 'function', 'sentry.origin': 'auto.ui.ember', + 'sentry.trace_lifecycle': 'static', }, description: 'slow-loading-route', op: 'function', @@ -203,6 +205,7 @@ test('captures correct spans for navigation', async ({ page }) => { 'code.function.name': 'beforeModel', 'sentry.op': 'function', 'sentry.origin': 'auto.ui.ember', + 'sentry.trace_lifecycle': 'static', }, description: 'slow-loading-route.index', op: 'function', @@ -222,6 +225,7 @@ test('captures correct spans for navigation', async ({ page }) => { 'code.function.name': 'model', 'sentry.op': 'function', 'sentry.origin': 'auto.ui.ember', + 'sentry.trace_lifecycle': 'static', }, description: 'slow-loading-route', op: 'function', @@ -238,6 +242,7 @@ test('captures correct spans for navigation', async ({ page }) => { 'code.function.name': 'model', 'sentry.op': 'function', 'sentry.origin': 'auto.ui.ember', + 'sentry.trace_lifecycle': 'static', }, description: 'slow-loading-route.index', op: 'function', @@ -257,6 +262,7 @@ test('captures correct spans for navigation', async ({ page }) => { 'code.function.name': 'afterModel', 'sentry.op': 'function', 'sentry.origin': 'auto.ui.ember', + 'sentry.trace_lifecycle': 'static', }, description: 'slow-loading-route', op: 'function', @@ -273,6 +279,7 @@ test('captures correct spans for navigation', async ({ page }) => { 'code.function.name': 'afterModel', 'sentry.op': 'function', 'sentry.origin': 'auto.ui.ember', + 'sentry.trace_lifecycle': 'static', }, description: 'slow-loading-route.index', op: 'function', @@ -291,6 +298,7 @@ test('captures correct spans for navigation', async ({ page }) => { 'ember.runloop.queue': 'render', 'sentry.op': 'ui.task', 'sentry.origin': 'auto.ui.ember', + 'sentry.trace_lifecycle': 'static', }, description: 'runloop', op: 'ui.task', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/span-decorator.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/span-decorator.test.ts index c4b646b7abc3..a27d65ab3744 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/span-decorator.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/span-decorator.test.ts @@ -25,6 +25,7 @@ test('Transaction includes span and correct value for decorated async function', 'sentry.origin': 'auto.function.nestjs.sentry_traced', 'sentry.op': 'wait and return a string', 'code.function.name': 'wait', + 'sentry.trace_lifecycle': 'static', }, description: 'wait', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -61,6 +62,7 @@ test('Transaction includes span and correct value for decorated sync function', 'sentry.origin': 'auto.function.nestjs.sentry_traced', 'sentry.op': 'return a string', 'code.function.name': 'getString', + 'sentry.trace_lifecycle': 'static', }, description: 'getString', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), diff --git a/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/transactions.test.ts index 1667a68372c0..5888da112301 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/transactions.test.ts @@ -46,6 +46,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.request.header.host': [expect.any(String)], 'http.request.header.sec-fetch-mode': ['cors'], 'http.request.header.user-agent': ['node'], + 'sentry.trace_lifecycle': 'static', }, op: 'http.server', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -64,6 +65,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', 'sentry.origin': 'auto.http.express', 'sentry.op': 'handler', + 'sentry.trace_lifecycle': 'static', }, op: 'handler', description: '/test-transaction', @@ -78,6 +80,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { { data: { 'sentry.origin': 'manual', + 'sentry.trace_lifecycle': 'static', }, description: 'test-span', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -91,6 +94,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { { data: { 'sentry.origin': 'manual', + 'sentry.trace_lifecycle': 'static', }, description: 'child-span', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -111,6 +115,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'nestjs.version': expect.any(String), 'nestjs.type': 'handler', 'nestjs.callback': 'testTransaction', + 'sentry.trace_lifecycle': 'static', }, description: 'testTransaction', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -154,6 +159,7 @@ test('API route transaction includes nest middleware span. Spans created in and data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs', + 'sentry.trace_lifecycle': 'static', }, description: 'ExampleMiddleware', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -234,6 +240,7 @@ test('API route transaction includes nest guard span and span started in guard i data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs.guard', + 'sentry.trace_lifecycle': 'static', }, description: 'ExampleGuard', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -298,6 +305,7 @@ test('API route transaction includes nest pipe span for valid request', async ({ data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs.pipe', + 'sentry.trace_lifecycle': 'static', }, description: 'ParseIntPipe', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -335,6 +343,7 @@ test('API route transaction includes nest pipe span for invalid request', async data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs.pipe', + 'sentry.trace_lifecycle': 'static', }, description: 'ParseIntPipe', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -374,6 +383,7 @@ test('API route transaction includes nest interceptor spans before route executi data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs.interceptor', + 'sentry.trace_lifecycle': 'static', }, description: 'ExampleInterceptor1', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -389,6 +399,7 @@ test('API route transaction includes nest interceptor spans before route executi data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs.interceptor', + 'sentry.trace_lifecycle': 'static', }, description: 'ExampleInterceptor2', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -492,6 +503,7 @@ test('API route transaction includes exactly one nest interceptor span after rou data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs.interceptor', + 'sentry.trace_lifecycle': 'static', }, description: 'Interceptors - After Route', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -574,6 +586,7 @@ test('API route transaction includes nest async interceptor spans before route e data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs.interceptor', + 'sentry.trace_lifecycle': 'static', }, description: 'AsyncInterceptor', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -659,6 +672,7 @@ test('API route transaction includes exactly one nest async interceptor span aft data: { 'sentry.op': 'middleware', 'sentry.origin': 'auto.middleware.nestjs.interceptor', + 'sentry.trace_lifecycle': 'static', }, description: 'Interceptors - After Route', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/middleware.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/middleware.test.ts index 8852e0883eb7..0a0501ce345b 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/middleware.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/middleware.test.ts @@ -125,6 +125,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru 'sentry.kind': 'client', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.node_fetch', + 'sentry.trace_lifecycle': 'static', 'server.address': 'localhost', 'server.port': 3030, 'url.domain': 'localhost', diff --git a/dev-packages/e2e-tests/test-applications/node-express-static/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-static/tests/transactions.test.ts index 0ba20e57da0e..1877390ec78b 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-static/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-static/tests/transactions.test.ts @@ -46,6 +46,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.request.header.host': [expect.any(String)], 'http.request.header.sec-fetch-mode': ['cors'], 'http.request.header.user-agent': ['node'], + 'sentry.trace_lifecycle': 'static', }, op: 'http.server', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -72,7 +73,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { // Manually started span expect(spans).toContainEqual({ - data: { 'sentry.origin': 'manual' }, + data: { 'sentry.origin': 'manual', 'sentry.trace_lifecycle': 'static' }, description: 'test-span', origin: 'manual', parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -90,6 +91,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.op': 'middleware', 'express.name': 'query', 'express.type': 'middleware', + 'sentry.trace_lifecycle': 'static', }, description: 'query', op: 'middleware', @@ -108,6 +110,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.op': 'middleware', 'express.name': 'expressInit', 'express.type': 'middleware', + 'sentry.trace_lifecycle': 'static', }, description: 'expressInit', op: 'middleware', @@ -127,6 +130,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', 'express.name': '/test-transaction', 'express.type': 'request_handler', + 'sentry.trace_lifecycle': 'static', }, description: '/test-transaction', op: 'handler', @@ -166,6 +170,7 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'sentry.op': 'middleware', 'express.name': 'query', 'express.type': 'middleware', + 'sentry.trace_lifecycle': 'static', }, description: 'query', op: 'middleware', @@ -184,6 +189,7 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'sentry.op': 'middleware', 'express.name': 'expressInit', 'express.type': 'middleware', + 'sentry.trace_lifecycle': 'static', }, description: 'expressInit', op: 'middleware', @@ -204,6 +210,7 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) 'express.name': '/test-exception/:id', 'express.type': 'request_handler', 'error.type': 'Error', + 'sentry.trace_lifecycle': 'static', }, description: '/test-exception/:id', op: 'handler', diff --git a/dev-packages/e2e-tests/test-applications/solidstart-static/tests/performance.server.test.ts b/dev-packages/e2e-tests/test-applications/solidstart-static/tests/performance.server.test.ts index 814908bf80e4..6a567376a301 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart-static/tests/performance.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart-static/tests/performance.server.test.ts @@ -1,4 +1,4 @@ -import { SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { SENTRY_OP, SENTRY_ORIGIN, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import { expect, test } from '@playwright/test'; import { waitForTransaction } from '@sentry-internal/test-utils'; @@ -19,6 +19,7 @@ test('sends a server action transaction on pageload', async ({ page }) => { [SENTRY_OP]: 'function', [SENTRY_ORIGIN]: 'auto.function.solidstart', 'code.function.name': 'getPrefecture', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, }), ]), @@ -44,6 +45,7 @@ test('sends a server action transaction on client navigation', async ({ page }) [SENTRY_OP]: 'function', [SENTRY_ORIGIN]: 'auto.function.solidstart', 'code.function.name': 'getPrefecture', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, }), ]), diff --git a/dev-packages/e2e-tests/test-applications/svelte-5-static/tests/performance.test.ts b/dev-packages/e2e-tests/test-applications/svelte-5-static/tests/performance.test.ts index f9b5c2f24e55..e4fbfdbf7adf 100644 --- a/dev-packages/e2e-tests/test-applications/svelte-5-static/tests/performance.test.ts +++ b/dev-packages/e2e-tests/test-applications/svelte-5-static/tests/performance.test.ts @@ -32,6 +32,7 @@ test('sends a pageload transaction with component tracking init spans', async ({ 'sentry.op': 'ui.mount', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'App', + 'sentry.trace_lifecycle': 'static', }, }), expect.objectContaining({ @@ -41,6 +42,7 @@ test('sends a pageload transaction with component tracking init spans', async ({ 'sentry.op': 'ui.mount', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'Counter', + 'sentry.trace_lifecycle': 'static', }, }), ]), diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2-static/tests/performance.client.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2-static/tests/performance.client.test.ts index 631fbdfe7ac2..dc88e514cc9e 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2-static/tests/performance.client.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2-static/tests/performance.client.test.ts @@ -96,25 +96,45 @@ test.describe('client-specific performance events', () => { expect(componentTxnEvent.spans).toEqual( expect.arrayContaining([ expect.objectContaining({ - data: { 'sentry.op': 'ui.mount', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'components/+page' }, + data: { + 'sentry.op': 'ui.mount', + 'sentry.origin': 'auto.ui.svelte', + 'sentry.trace_lifecycle': 'static', + 'ui.component_name': 'components/+page', + }, description: '', op: 'ui.mount', origin: 'auto.ui.svelte', }), expect.objectContaining({ - data: { 'sentry.op': 'ui.mount', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'Component1' }, + data: { + 'sentry.op': 'ui.mount', + 'sentry.origin': 'auto.ui.svelte', + 'sentry.trace_lifecycle': 'static', + 'ui.component_name': 'Component1', + }, description: '', op: 'ui.mount', origin: 'auto.ui.svelte', }), expect.objectContaining({ - data: { 'sentry.op': 'ui.mount', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'Component2' }, + data: { + 'sentry.op': 'ui.mount', + 'sentry.origin': 'auto.ui.svelte', + 'sentry.trace_lifecycle': 'static', + 'ui.component_name': 'Component2', + }, description: '', op: 'ui.mount', origin: 'auto.ui.svelte', }), expect.objectContaining({ - data: { 'sentry.op': 'ui.mount', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'Component3' }, + data: { + 'sentry.op': 'ui.mount', + 'sentry.origin': 'auto.ui.svelte', + 'sentry.trace_lifecycle': 'static', + 'ui.component_name': 'Component3', + }, description: '', op: 'ui.mount', origin: 'auto.ui.svelte', @@ -123,6 +143,7 @@ test.describe('client-specific performance events', () => { data: { 'sentry.op': 'ui.update', 'sentry.origin': 'auto.ui.svelte', + 'sentry.trace_lifecycle': 'static', 'ui.component_name': 'components/+page', }, description: '', @@ -130,19 +151,34 @@ test.describe('client-specific performance events', () => { origin: 'auto.ui.svelte', }), expect.objectContaining({ - data: { 'sentry.op': 'ui.update', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'Component1' }, + data: { + 'sentry.op': 'ui.update', + 'sentry.origin': 'auto.ui.svelte', + 'sentry.trace_lifecycle': 'static', + 'ui.component_name': 'Component1', + }, description: '', op: 'ui.update', origin: 'auto.ui.svelte', }), expect.objectContaining({ - data: { 'sentry.op': 'ui.update', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'Component2' }, + data: { + 'sentry.op': 'ui.update', + 'sentry.origin': 'auto.ui.svelte', + 'sentry.trace_lifecycle': 'static', + 'ui.component_name': 'Component2', + }, description: '', op: 'ui.update', origin: 'auto.ui.svelte', }), expect.objectContaining({ - data: { 'sentry.op': 'ui.update', 'sentry.origin': 'auto.ui.svelte', 'ui.component_name': 'Component3' }, + data: { + 'sentry.op': 'ui.update', + 'sentry.origin': 'auto.ui.svelte', + 'sentry.trace_lifecycle': 'static', + 'ui.component_name': 'Component3', + }, description: '', op: 'ui.update', origin: 'auto.ui.svelte', diff --git a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts index 3cbe232bb061..a1fe396d3d21 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -1,5 +1,5 @@ import { createTestServer } from '@sentry-internal/test-utils'; -import { URL_FULL, URL_PATH } from '@sentry/conventions/attributes'; +import { SENTRY_TRACE_LIFECYCLE, URL_FULL, URL_PATH } from '@sentry/conventions/attributes'; import { afterAll, describe, expect, test } from 'vitest'; import { cleanupChildProcesses, createEsmAndCjsTests, createRunner } from '../../../utils/runner'; import { RUNTIME } from '../../../utils'; @@ -116,6 +116,7 @@ describe('httpIntegration', () => { 'sentry.origin': 'auto.http.http_server', 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'route', + [SENTRY_TRACE_LIFECYCLE]: 'static', [URL_FULL]: `http://localhost:${port}/test?a=1&b=2`, [URL_PATH]: '/test', ...getCommonHttpRequestHeaders(), @@ -159,6 +160,7 @@ describe('httpIntegration', () => { 'sentry.origin': 'auto.http.http_server', 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'route', + [SENTRY_TRACE_LIFECYCLE]: 'static', [URL_FULL]: `http://localhost:${port}/test?a=1&b=2`, [URL_PATH]: '/test', 'http.request.header.content-length': ['9'], diff --git a/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts b/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts index f0f45e51f35c..eb18fac7ebeb 100644 --- a/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts @@ -53,6 +53,7 @@ describe('MongoDB auto-instrumentation', () => { 'server.port': expect.any(Number), 'db.query.text': '{"title":"?"}', 'sentry.kind': 'client', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '{"title":"?"}', op: 'db', @@ -72,6 +73,7 @@ describe('MongoDB auto-instrumentation', () => { 'server.port': expect.any(Number), 'db.query.text': '{"title":"?","_id":{"_bsontype":"?","id":"?"}}', 'sentry.kind': 'client', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '{"title":"?","_id":{"_bsontype":"?","id":"?"}}', op: 'db', @@ -92,6 +94,7 @@ describe('MongoDB auto-instrumentation', () => { 'db.query.text': '{"ismaster":"?","client":{"driver":{"name":"?","version":"?"},"os":{"type":"?","name":"?","architecture":"?","version":"?"},"platform":"?"},"compression":[],"helloOk":"?"}', 'sentry.kind': 'client', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '{"ismaster":"?","client":{"driver":{"name":"?","version":"?"},"os":{"type":"?","name":"?","architecture":"?","version":"?"},"platform":"?"},"compression":[],"helloOk":"?"}', @@ -112,6 +115,7 @@ describe('MongoDB auto-instrumentation', () => { 'server.port': expect.any(Number), 'db.query.text': '{"title":"?"}', 'sentry.kind': 'client', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '{"title":"?"}', op: 'db', @@ -146,6 +150,7 @@ describe('MongoDB auto-instrumentation', () => { 'server.port': expect.any(Number), 'db.query.text': '{"endSessions":[{"id":{"_bsontype":"?","sub_type":"?","position":"?","buffer":"?"}}]}', 'sentry.kind': 'client', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '{"endSessions":[{"id":{"_bsontype":"?","sub_type":"?","position":"?","buffer":"?"}}]}', op: 'db', diff --git a/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v5/test.ts b/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v5/test.ts index 33b8c89d0ec3..93e2534e055a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v5/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v5/test.ts @@ -1,3 +1,4 @@ +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { TransactionEvent } from '@sentry/core'; import { afterAll, describe, expect } from 'vitest'; import { cleanupChildProcesses, createEsmAndCjsTests, describeWithDockerCompose } from '../../../utils/runner'; @@ -41,6 +42,7 @@ function expectPrismaV5Spans(transaction: TransactionEvent): void { model: 'User', name: 'User.create', 'sentry.origin': 'auto.db.prisma', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'prisma:client:operation', status: 'ok', @@ -51,6 +53,7 @@ function expectPrismaV5Spans(transaction: TransactionEvent): void { model: 'User', name: 'User.findMany', 'sentry.origin': 'auto.db.prisma', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'prisma:client:operation', status: 'ok', @@ -58,6 +61,7 @@ function expectPrismaV5Spans(transaction: TransactionEvent): void { expect.objectContaining({ data: { 'sentry.origin': 'auto.db.prisma', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'prisma:client:serialize', status: 'ok', @@ -65,6 +69,7 @@ function expectPrismaV5Spans(transaction: TransactionEvent): void { expect.objectContaining({ data: { 'sentry.origin': 'auto.db.prisma', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'prisma:client:connect', status: 'ok', @@ -77,6 +82,7 @@ function expectPrismaV5Spans(transaction: TransactionEvent): void { 'sentry.kind': 'client', 'sentry.op': 'db', 'sentry.origin': 'auto.db.prisma', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'db', description: expect.stringContaining('INSERT INTO'), @@ -90,6 +96,7 @@ function expectPrismaV5Spans(transaction: TransactionEvent): void { 'sentry.kind': 'client', 'sentry.op': 'db', 'sentry.origin': 'auto.db.prisma', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'db', description: expect.stringContaining('SELECT'), @@ -103,6 +110,7 @@ function expectPrismaV5Spans(transaction: TransactionEvent): void { 'sentry.kind': 'client', 'sentry.op': 'db', 'sentry.origin': 'auto.db.prisma', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'db', description: expect.stringContaining('DELETE'), diff --git a/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v6/test.ts b/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v6/test.ts index 542c482a0fa1..3b1080445fe3 100644 --- a/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v6/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v6/test.ts @@ -1,3 +1,4 @@ +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { SpanJSON } from '@sentry/core'; import { afterAll, expect } from 'vitest'; import { cleanupChildProcesses, createEsmAndCjsTests, describeWithDockerCompose } from '../../../utils/runner'; @@ -44,6 +45,7 @@ describeWithDockerCompose('Prisma ORM v6 Tests', { workingDirectory: [__dirname] data: { ...span.data, 'sentry.origin': 'auto.db.prisma', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, status: 'ok', }), diff --git a/packages/cloudflare/test/instrumentations/worker/instrumentEmail.test.ts b/packages/cloudflare/test/instrumentations/worker/instrumentEmail.test.ts index 2c15f5a39966..ed358cd6340f 100644 --- a/packages/cloudflare/test/instrumentations/worker/instrumentEmail.test.ts +++ b/packages/cloudflare/test/instrumentations/worker/instrumentEmail.test.ts @@ -2,6 +2,7 @@ // Although this is not ideal, this is the best we can do until we have a better way to test cloudflare workers. import type { ExecutionContext, ForwardableEmailMessage } from '@cloudflare/workers-types'; +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { Event } from '@sentry/core'; import * as SentryCore from '@sentry/core'; import { beforeEach, describe, expect, onTestFinished, test, vi } from 'vitest'; @@ -271,6 +272,7 @@ describe('instrumentEmail', () => { 'faas.trigger': 'email', 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'task', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'function', origin: 'auto.faas.cloudflare.email', diff --git a/packages/cloudflare/test/instrumentations/worker/instrumentQueue.test.ts b/packages/cloudflare/test/instrumentations/worker/instrumentQueue.test.ts index afe51790adfd..bbf6a2a6be8e 100644 --- a/packages/cloudflare/test/instrumentations/worker/instrumentQueue.test.ts +++ b/packages/cloudflare/test/instrumentations/worker/instrumentQueue.test.ts @@ -2,6 +2,7 @@ // Although this is not ideal, this is the best we can do until we have a better way to test cloudflare workers. import type { ExecutionContext, MessageBatch } from '@cloudflare/workers-types'; +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { Event } from '@sentry/core'; import * as SentryCore from '@sentry/core'; import { beforeEach, describe, expect, onTestFinished, test, vi } from 'vitest'; @@ -287,6 +288,7 @@ describe('instrumentQueue', () => { 'messaging.message.retry.count': batch.messages.reduce((acc, message) => acc + message.attempts - 1, 0), 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'task', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'queue.process', origin: 'auto.faas.cloudflare.queue', diff --git a/packages/cloudflare/test/instrumentations/worker/instrumentScheduled.test.ts b/packages/cloudflare/test/instrumentations/worker/instrumentScheduled.test.ts index 46090684daea..9fc9d1e34fe9 100644 --- a/packages/cloudflare/test/instrumentations/worker/instrumentScheduled.test.ts +++ b/packages/cloudflare/test/instrumentations/worker/instrumentScheduled.test.ts @@ -2,6 +2,7 @@ // Although this is not ideal, this is the best we can do until we have a better way to test cloudflare workers. import type { ExecutionContext, ScheduledController } from '@cloudflare/workers-types'; +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { Event } from '@sentry/core'; import * as SentryCore from '@sentry/core'; import { beforeEach, describe, expect, onTestFinished, test, vi } from 'vitest'; @@ -266,6 +267,7 @@ describe('instrumentScheduled', () => { 'faas.trigger': 'timer', 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'task', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'function', origin: 'auto.faas.cloudflare.scheduled', diff --git a/packages/cloudflare/test/opentelemetry.test.ts b/packages/cloudflare/test/opentelemetry.test.ts index afc4575fa343..2fff5351de7e 100644 --- a/packages/cloudflare/test/opentelemetry.test.ts +++ b/packages/cloudflare/test/opentelemetry.test.ts @@ -1,4 +1,5 @@ import { trace } from '@opentelemetry/api'; +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { TransactionEvent } from '@sentry/core'; import { getActiveSpan, spanToJSON, startSpan } from '@sentry/core'; import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels'; @@ -81,6 +82,7 @@ describe('opentelemetry compatibility', () => { 'sentry.origin': 'manual', 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }); expect(transactionEvent2?.spans?.length).toBe(1); @@ -90,6 +92,7 @@ describe('opentelemetry compatibility', () => { 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'custom', 'test.attribute': 'test', + [SENTRY_TRACE_LIFECYCLE]: 'static', }); expect(transactionEvent2?.spans).toEqual([ @@ -98,6 +101,7 @@ describe('opentelemetry compatibility', () => { data: { 'sentry.origin': 'manual', 'test.attribute': 'test2', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, }), ]); @@ -135,6 +139,7 @@ describe('opentelemetry compatibility', () => { 'sentry.origin': 'manual', 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }); expect(transactionEvent?.spans).toEqual([ @@ -142,6 +147,7 @@ describe('opentelemetry compatibility', () => { description: 'otel span', data: { 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, }), ]); diff --git a/packages/cloudflare/test/request.test.ts b/packages/cloudflare/test/request.test.ts index ae30155c3c6a..5e6d78d2d8bd 100644 --- a/packages/cloudflare/test/request.test.ts +++ b/packages/cloudflare/test/request.test.ts @@ -2,6 +2,7 @@ // Although this is not ideal, this is the best we can do until we have a better way to test cloudflare workers. import type { ExecutionContext } from '@cloudflare/workers-types'; +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { Event } from '@sentry/core'; import * as SentryCore from '@sentry/core'; import { beforeAll, beforeEach, describe, expect, onTestFinished, test, vi } from 'vitest'; @@ -638,6 +639,7 @@ describe('withSentry', () => { 'http.response.status_code': 200, 'http.request.body.size': 10, 'http.request.header.content-length': ['10'], + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'http.server', origin: 'auto.http.cloudflare', diff --git a/packages/core/src/tracing/sentrySpan.ts b/packages/core/src/tracing/sentrySpan.ts index f0285f63eb27..b07e3a8f525a 100644 --- a/packages/core/src/tracing/sentrySpan.ts +++ b/packages/core/src/tracing/sentrySpan.ts @@ -7,6 +7,7 @@ import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_OP, SENTRY_ORIGIN, + SENTRY_TRACE_LIFECYCLE, } from '@sentry/conventions/attributes'; import { SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME } from '../semanticAttributes'; import type { Client } from '../client'; @@ -456,6 +457,7 @@ export class SentrySpan implements Span { let hasGenAiSpans = false; spans.forEach(span => { delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + span.data = { ...span.data, [SENTRY_TRACE_LIFECYCLE]: 'static' }; if (span.op?.startsWith('gen_ai.')) { hasGenAiSpans = true; } diff --git a/packages/core/src/utils/spanUtils.ts b/packages/core/src/utils/spanUtils.ts index e1615b9bf5c4..10958c8970f9 100644 --- a/packages/core/src/utils/spanUtils.ts +++ b/packages/core/src/utils/spanUtils.ts @@ -10,6 +10,7 @@ import { SENTRY_STATUS_MESSAGE, SENTRY_OP, SENTRY_ORIGIN, + SENTRY_TRACE_LIFECYCLE, } from '@sentry/conventions/attributes'; import { SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME } from '../semanticAttributes'; import type { SentrySpan } from '../tracing/sentrySpan'; @@ -51,7 +52,7 @@ export function spanToTransactionTraceContext(span: Span): TraceContext { parent_span_id, span_id, trace_id, - data, + data: { ...data, [SENTRY_TRACE_LIFECYCLE]: 'static' }, op, status, origin, diff --git a/packages/core/test/lib/tracing/sentrySpan.test.ts b/packages/core/test/lib/tracing/sentrySpan.test.ts index a38ebe5c1ffe..e0ba3e4835c1 100644 --- a/packages/core/test/lib/tracing/sentrySpan.test.ts +++ b/packages/core/test/lib/tracing/sentrySpan.test.ts @@ -15,7 +15,7 @@ import type { Span, SpanJSON } from '../../../src/types/span'; import { getRootSpan, spanToStaticSpanJSON, TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED } from '../../../src/utils/spanUtils'; import { timestampInSeconds } from '../../../src/utils/time'; import { getDefaultTestClientOptions, TestClient } from '../../mocks/client'; -import { SENTRY_SEGMENT_NAME_SOURCE } from '@sentry/conventions/attributes'; +import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; function childSpansOf(span: Span): Set { return (span as unknown as { _sentryChildSpans?: Set })._sentryChildSpans ?? new Set(); @@ -425,6 +425,7 @@ describe('SentrySpan', () => { trace: { data: { 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, origin: 'manual', span_id: expect.stringMatching(/^[a-f0-9]{16}$/), @@ -450,6 +451,41 @@ describe('SentrySpan', () => { type: 'transaction', }); }); + + test('sets the static trace lifecycle on the transaction and its child spans without mutating them', () => { + const client = new TestClient( + getDefaultTestClientOptions({ + dsn: 'https://username@domain/123', + tracesSampleRate: 1, + }), + ); + setCurrentClient(client); + + const captureEventSpy = vi.spyOn(getCurrentScope(), 'captureEvent').mockImplementation(() => 'testId'); + + const rootSpan = new SentrySpan({ name: 'root', startTimestamp: 1, sampled: true }); + const childSpan = withActiveSpan(rootSpan, () => startInactiveSpan({ name: 'child' })); + childSpan.end(); + rootSpan.end(); + + expect(captureEventSpy).toHaveBeenCalledWith( + expect.objectContaining({ + contexts: { + trace: expect.objectContaining({ + data: expect.objectContaining({ [SENTRY_TRACE_LIFECYCLE]: 'static' }), + }), + }, + spans: [ + expect.objectContaining({ + description: 'child', + data: expect.objectContaining({ [SENTRY_TRACE_LIFECYCLE]: 'static' }), + }), + ], + }), + ); + expect(spanToStaticSpanJSON(rootSpan).data[SENTRY_TRACE_LIFECYCLE]).toBeUndefined(); + expect(spanToStaticSpanJSON(childSpan).data[SENTRY_TRACE_LIFECYCLE]).toBeUndefined(); + }); }); describe('setAttribute', () => { diff --git a/packages/core/test/lib/tracing/trace.test.ts b/packages/core/test/lib/tracing/trace.test.ts index 5d7ab473b1b8..4f70eb69863e 100644 --- a/packages/core/test/lib/tracing/trace.test.ts +++ b/packages/core/test/lib/tracing/trace.test.ts @@ -31,7 +31,12 @@ import { getActiveSpan, getRootSpan, getSpanDescendants, spanIsSampled } from '. import { getDefaultTestClientOptions, TestClient } from '../../mocks/client'; import { SUPPRESS_TRACING_KEY } from '../../../src/tracing/constants'; import { resetGlobals } from '../../testutils'; -import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { + SENTRY_SEGMENT_NAME_SOURCE, + SENTRY_OP, + SENTRY_ORIGIN, + SENTRY_TRACE_LIFECYCLE, +} from '@sentry/conventions/attributes'; const enum Type { Sync = 'sync', @@ -565,6 +570,7 @@ describe('startSpan', () => { 'sentry.segment.name.source': 'custom', 'sentry.sample_rate': 1, 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/), @@ -590,6 +596,7 @@ describe('startSpan', () => { data: { 'sentry.segment.name.source': 'custom', 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, parent_span_id: innerParentSpanId, span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -1145,6 +1152,7 @@ describe('startSpanManual', () => { 'sentry.segment.name.source': 'custom', 'sentry.sample_rate': 1, 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/), @@ -1170,6 +1178,7 @@ describe('startSpanManual', () => { data: { 'sentry.segment.name.source': 'custom', 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, parent_span_id: innerParentSpanId, span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -1608,6 +1617,7 @@ describe('startInactiveSpan', () => { 'sentry.segment.name.source': 'custom', 'sentry.sample_rate': 1, 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/), @@ -1633,6 +1643,7 @@ describe('startInactiveSpan', () => { data: { 'sentry.segment.name.source': 'custom', 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, parent_span_id: innerParentSpanId, span_id: expect.stringMatching(/[a-f0-9]{16}/), diff --git a/packages/node/test/integration/scope.test.ts b/packages/node/test/integration/scope.test.ts index 0572224bc360..1c511cff26a0 100644 --- a/packages/node/test/integration/scope.test.ts +++ b/packages/node/test/integration/scope.test.ts @@ -1,3 +1,4 @@ +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import { getCapturedScopesOnSpan, getCurrentScope, getClient } from '@sentry/core'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import * as Sentry from '../../src/'; @@ -108,6 +109,7 @@ describe('Integration | Scope', () => { 'sentry.origin': 'manual', 'sentry.segment.name.source': 'custom', 'sentry.sample_rate': 1, + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: spanId, status: 'ok', diff --git a/packages/node/test/integration/transactions.test.ts b/packages/node/test/integration/transactions.test.ts index 681c988eef10..3ccbf33761cd 100644 --- a/packages/node/test/integration/transactions.test.ts +++ b/packages/node/test/integration/transactions.test.ts @@ -1,4 +1,4 @@ -import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_ORIGIN, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import { context, trace, TraceFlags } from '@opentelemetry/api'; import type { ErrorEvent, TransactionEvent } from '@sentry/core'; import { afterEach, describe, expect, it, vi } from 'vitest'; @@ -80,6 +80,7 @@ describe('Integration | Transactions', () => { 'sentry.segment.name.source': 'task', 'sentry.sample_rate': 1, 'test.outer': 'test value', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'test op', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -124,6 +125,7 @@ describe('Integration | Transactions', () => { { data: { 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'inner span 1', origin: 'manual', @@ -138,6 +140,7 @@ describe('Integration | Transactions', () => { data: { 'test.inner': 'test value', 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'inner span 2', origin: 'manual', @@ -234,6 +237,7 @@ describe('Integration | Transactions', () => { 'sentry.segment.name.source': 'task', 'test.outer': 'test value', 'sentry.sample_rate': 1, + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'test op', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -272,6 +276,7 @@ describe('Integration | Transactions', () => { 'sentry.segment.name.source': 'custom', 'test.outer': 'test value b', 'sentry.sample_rate': 1, + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'test op b', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -376,6 +381,7 @@ describe('Integration | Transactions', () => { 'sentry.segment.name.source': 'custom', 'test.outer': 'test value', 'sentry.sample_rate': 1, + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', @@ -411,6 +417,7 @@ describe('Integration | Transactions', () => { 'sentry.segment.name.source': 'custom', 'test.outer': 'test value b', 'sentry.sample_rate': 1, + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', @@ -482,6 +489,7 @@ describe('Integration | Transactions', () => { 'sentry.op': 'test op', 'sentry.origin': 'auto.test', 'sentry.segment.name.source': 'task', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'test op', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -515,6 +523,7 @@ describe('Integration | Transactions', () => { { data: { 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'inner span 1', origin: 'manual', @@ -528,6 +537,7 @@ describe('Integration | Transactions', () => { { data: { 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'inner span 2', origin: 'manual', diff --git a/packages/opentelemetry/test/integration/scope.test.ts b/packages/opentelemetry/test/integration/scope.test.ts index 7e9b520df289..2a604032fe37 100644 --- a/packages/opentelemetry/test/integration/scope.test.ts +++ b/packages/opentelemetry/test/integration/scope.test.ts @@ -1,3 +1,4 @@ +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import { captureException, getCapturedScopesOnSpan, @@ -109,6 +110,7 @@ describe('Integration | Scope', () => { 'sentry.origin': 'manual', 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: spanId, status: 'ok', diff --git a/packages/opentelemetry/test/integration/transactions.test.ts b/packages/opentelemetry/test/integration/transactions.test.ts index 21f24a0f8555..32d3527e1774 100644 --- a/packages/opentelemetry/test/integration/transactions.test.ts +++ b/packages/opentelemetry/test/integration/transactions.test.ts @@ -1,4 +1,4 @@ -import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_ORIGIN, SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { SpanContext } from '@opentelemetry/api'; import { context, ROOT_CONTEXT, trace, TraceFlags } from '@opentelemetry/api'; import { TraceState } from '../../src/utils/TraceState'; @@ -80,6 +80,7 @@ describe('Integration | Transactions', () => { 'sentry.segment.name.source': 'task', 'sentry.sample_rate': 1, 'test.outer': 'test value', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'test op', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -121,6 +122,7 @@ describe('Integration | Transactions', () => { { data: { 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'inner span 1', origin: 'manual', @@ -135,6 +137,7 @@ describe('Integration | Transactions', () => { data: { 'test.inner': 'test value', 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'inner span 2', origin: 'manual', @@ -229,6 +232,7 @@ describe('Integration | Transactions', () => { 'sentry.segment.name.source': 'task', 'test.outer': 'test value', 'sentry.sample_rate': 1, + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'test op', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -267,6 +271,7 @@ describe('Integration | Transactions', () => { 'test.outer': 'test value b', 'sentry.sample_rate': 1, 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'test op b', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -340,6 +345,7 @@ describe('Integration | Transactions', () => { 'sentry.op': 'test op', 'sentry.origin': 'auto.test', 'sentry.segment.name.source': 'task', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'test op', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -373,6 +379,7 @@ describe('Integration | Transactions', () => { { data: { 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'inner span 1', origin: 'manual', @@ -386,6 +393,7 @@ describe('Integration | Transactions', () => { { data: { 'sentry.origin': 'manual', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: 'inner span 2', origin: 'manual', diff --git a/packages/opentelemetry/test/trace.test.ts b/packages/opentelemetry/test/trace.test.ts index 448692f6a505..ee139cdcb68d 100644 --- a/packages/opentelemetry/test/trace.test.ts +++ b/packages/opentelemetry/test/trace.test.ts @@ -1,7 +1,13 @@ /* eslint-disable typescript/no-deprecated */ import type { Span, TimeInput } from '@opentelemetry/api'; import { context, ROOT_CONTEXT, trace, TraceFlags } from '@opentelemetry/api'; -import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_KIND, SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { + SENTRY_SEGMENT_NAME_SOURCE, + SENTRY_KIND, + SENTRY_OP, + SENTRY_ORIGIN, + SENTRY_TRACE_LIFECYCLE, +} from '@sentry/conventions/attributes'; import type { Event, Scope } from '@sentry/core'; import { getCapturedScopesOnSpan, @@ -459,6 +465,7 @@ describe('trace', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/), @@ -483,6 +490,7 @@ describe('trace', () => { data: { 'sentry.origin': 'manual', 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, parent_span_id: innerParentSpanId, span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -787,6 +795,7 @@ describe('trace', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/), @@ -811,6 +820,7 @@ describe('trace', () => { data: { 'sentry.origin': 'manual', 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, parent_span_id: innerParentSpanId, span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -1172,6 +1182,7 @@ describe('trace', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/), @@ -1196,6 +1207,7 @@ describe('trace', () => { data: { 'sentry.origin': 'manual', 'sentry.segment.name.source': 'custom', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, parent_span_id: innerParentSpanId, span_id: expect.stringMatching(/[a-f0-9]{16}/), diff --git a/packages/svelte/test/performance.test.ts b/packages/svelte/test/performance.test.ts index ccfe14e3c2f5..208277848e5d 100644 --- a/packages/svelte/test/performance.test.ts +++ b/packages/svelte/test/performance.test.ts @@ -2,6 +2,7 @@ * @vitest-environment jsdom */ +import { SENTRY_TRACE_LIFECYCLE } from '@sentry/conventions/attributes'; import type { TransactionEvent } from '@sentry/core'; import { getMainCarrier, spanToJSON, UI_MOUNT_SPAN_NAME_FALLBACK } from '@sentry/core'; import { act, render } from '@testing-library/svelte'; @@ -55,6 +56,7 @@ describe('Sentry.trackComponent()', () => { data: { 'sentry.op': 'ui.mount', 'sentry.origin': 'auto.ui.svelte', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', exclusive_time: undefined, @@ -100,6 +102,7 @@ describe('Sentry.trackComponent()', () => { data: { 'sentry.op': 'ui.mount', 'sentry.origin': 'auto.ui.svelte', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', exclusive_time: undefined, @@ -120,6 +123,7 @@ describe('Sentry.trackComponent()', () => { data: { 'sentry.op': 'ui.update', 'sentry.origin': 'auto.ui.svelte', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', exclusive_time: undefined, @@ -140,6 +144,7 @@ describe('Sentry.trackComponent()', () => { data: { 'sentry.op': 'ui.update', 'sentry.origin': 'auto.ui.svelte', + [SENTRY_TRACE_LIFECYCLE]: 'static', }, description: '', exclusive_time: undefined, diff --git a/packages/sveltekit/test/server-common/load.test.ts b/packages/sveltekit/test/server-common/load.test.ts index 97b3a6390c08..f4702020436d 100644 --- a/packages/sveltekit/test/server-common/load.test.ts +++ b/packages/sveltekit/test/server-common/load.test.ts @@ -1,4 +1,9 @@ -import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes'; +import { + SENTRY_SEGMENT_NAME_SOURCE, + SENTRY_OP, + SENTRY_ORIGIN, + SENTRY_TRACE_LIFECYCLE, +} from '@sentry/conventions/attributes'; import type { Client, Event } from '@sentry/core'; import * as SentryCore from '@sentry/core'; import { NodeClient, setCurrentClient } from '@sentry/node'; @@ -263,6 +268,7 @@ describe('wrapServerLoadWithSentry calls `startSpan`', () => { 'http.request.method': 'GET', 'url.path': '/users/123', 'sentry.sample_rate': 1, + [SENTRY_TRACE_LIFECYCLE]: 'static', }, op: 'function', span_id: expect.stringMatching(/[a-f0-9]{16}/),