Skip to content

CLOSED - add node support for generic featureFlagsIntegration and move utils to core #16537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
70ccac1
Dup integration and utils to core, todos in index and integration
aliu39 Jun 10, 2025
6381f91
Import utils from core with _INTERNAL_ prefix
aliu39 Jun 10, 2025
a93b0e0
Delete old browser utils and integration and yarn fix
aliu39 Jun 10, 2025
4366e5a
Keep browser in docstr example
aliu39 Jun 10, 2025
868cd71
Export from same pkgs as zodErrorsIntegration, except remix, solidsta…
aliu39 Jun 10, 2025
2b9a867
Merge branch 'aliu/span-flags-v2' into aliu/move-ffs-to-core
aliu39 Jun 10, 2025
1611330
Add on error node tests. TODO export/import buffer sizes as _INTERNAL
aliu39 Jun 10, 2025
8124a40
Merge branch 'aliu/move-ffs-to-core' of https://github.com/getsentry/…
aliu39 Jun 10, 2025
f56cc3e
fix(sveltekit): Add import attribute for node exports (#16528)
eltigerchino Jun 11, 2025
70a57e6
chore: Add external contributor to CHANGELOG.md (#16543)
HazAT Jun 11, 2025
0b0942f
meta(changelog): Update changelog for 9.28.1
Lms24 Jun 11, 2025
1ce9e77
Merge pull request #16544 from getsentry/prepare-release/9.28.1
Lms24 Jun 11, 2025
111db4a
release: 9.28.1
getsentry-bot Jun 11, 2025
a72ca10
chore(otel-v2-tests): Fix formatting and linting errors (#16546)
Lms24 Jun 11, 2025
0ce6dc5
Merge branch 'release/9.28.1'
Jun 11, 2025
5fc0388
feat(ember): Stop warning for `onError` usage (#16547)
mydea Jun 11, 2025
91ee98d
Merge pull request #16548 from getsentry/master
github-actions[bot] Jun 11, 2025
fee86b0
fix(browser): Ensure `suppressTracing` does not leak when async (#16545)
mydea Jun 11, 2025
88e3f8f
feat(node): Allow to force activate `vercelAiIntegration` (#16551)
mydea Jun 11, 2025
eb59604
feat(deps): Bump @sentry/rollup-plugin from 3.4.0 to 3.5.0 (#16524)
dependabot[bot] Jun 11, 2025
ba3728d
feat(node): Introduce `ignoreLayersType` option to koa integration (#…
AbhiPrasad Jun 11, 2025
65310d5
chore: Document `process.env.DEBUG` in node integration tests README …
AbhiPrasad Jun 11, 2025
6fc18fe
feat(browser): Update `web-vitals` to 5.0.2 (#16492)
Lms24 Jun 12, 2025
6b656b4
fix(vue): Ensure root component render span always ends (#16488)
Lms24 Jun 12, 2025
cbfada0
test(node): Fix nestjs-11 E2E test by pinning version
mydea Jun 12, 2025
e26e334
test(trpc): Fix E2E test by pinning to 11.3.0
mydea Jun 12, 2025
038cb5d
test: Fix E2E tests by pinning dependencies (#16569)
mydea Jun 12, 2025
6882abf
meta(changelog): Update changelog for 9.29.0
Lms24 Jun 12, 2025
65d6bd4
chore(deps): Upgrade tpml to 1.0.5 (#16512)
AbhiPrasad Jun 12, 2025
3bb5ac8
Merge pull request #16563 from getsentry/prepare-release/9.29.0
Lms24 Jun 12, 2025
6d70326
release: 9.29.0
getsentry-bot Jun 12, 2025
9cce949
Add flags to attrs directly on eval
aliu39 Jun 12, 2025
52385ee
Rename util
aliu39 Jun 12, 2025
90d9289
Move FF type to core utils file
aliu39 Jun 12, 2025
bca65dd
Export buffer sizes from core as _INTERNAL_
aliu39 Jun 12, 2025
c92a9b0
feat(node): Ensure `modulesIntegration` works in more environments (#…
mydea Jun 13, 2025
afe49dd
Merge branch 'release/9.29.0'
Jun 13, 2025
2e4d243
Merge pull request #16576 from getsentry/master
github-actions[bot] Jun 13, 2025
d35030d
feat(node): Automatically enable `vercelAiIntegration` when `ai` modu…
mydea Jun 13, 2025
4e7c7ef
feat(browser): Add detail to measure spans and add regression tests (…
AbhiPrasad Jun 13, 2025
db2fa33
Remove allowEviction
aliu39 Jun 15, 2025
b3d746b
Merge branch 'develop' of https://github.com/getsentry/sentry-javascr…
aliu39 Jun 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(vue): Ensure root component render span always ends (#16488)
This PR fixes a bug discovered in
#16486 (comment)
where the root component span would not end correctly if
`trackComponents` was `false`.

Also added a comment to explain the purpose of the root component
`ui.vue.render` span. We might want to look into renaming or removing
this span in the future but for now, let's fix the behaviour.
  • Loading branch information
Lms24 authored Jun 12, 2025
commit 6b656b4009f8f8ec51f379ed517494a0deaaaeef
18 changes: 13 additions & 5 deletions packages/vue/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const HOOKS: { [key in Operation]: Hook[] } = {
update: ['beforeUpdate', 'updated'],
};

/** Finish top-level component span and activity with a debounce configured using `timeout` option */
function finishRootComponentSpan(vm: VueSentry, timestamp: number, timeout: number): void {
/** End the top-level component span and activity with a debounce configured using `timeout` option */
function maybeEndRootComponentSpan(vm: VueSentry, timestamp: number, timeout: number): void {
if (vm.$_sentryRootComponentSpanTimer) {
clearTimeout(vm.$_sentryRootComponentSpanTimer);
}
Expand Down Expand Up @@ -66,6 +66,8 @@ export const createTracingMixins = (options: Partial<TracingOptions> = {}): Mixi

const mixins: Mixins = {};

const rootComponentSpanFinalTimeout = options.timeout || 2000;

for (const operation of hooks) {
// Retrieve corresponding hooks from Vue lifecycle.
// eg. mount => ['beforeMount', 'mounted']
Expand All @@ -91,6 +93,9 @@ export const createTracingMixins = (options: Partial<TracingOptions> = {}): Mixi
},
onlyIfParent: true,
});

// call debounced end function once directly, just in case no child components call it
maybeEndRootComponentSpan(this, timestampInSeconds(), rootComponentSpanFinalTimeout);
}

// 2. Component tracking filter
Expand All @@ -102,7 +107,10 @@ export const createTracingMixins = (options: Partial<TracingOptions> = {}): Mixi
? findTrackComponent(options.trackComponents, componentName)
: options.trackComponents);

// We always want to track root component
if (!shouldTrack) {
// even if we don't track `this` component, we still want to end the root span eventually
maybeEndRootComponentSpan(this, timestampInSeconds(), rootComponentSpanFinalTimeout);
return;
}

Expand All @@ -117,7 +125,7 @@ export const createTracingMixins = (options: Partial<TracingOptions> = {}): Mixi
if (activeSpan) {
// Cancel any existing span for this operation (safety measure)
// We're actually not sure if it will ever be the case that cleanup hooks were not called.
// However, we had users report that spans didn't get finished, so we finished the span before
// However, we had users report that spans didn't end, so we end the span before
// starting a new one, just to be sure.
const oldSpan = this.$_sentryComponentSpans[operation];
if (oldSpan) {
Expand All @@ -142,8 +150,8 @@ export const createTracingMixins = (options: Partial<TracingOptions> = {}): Mixi
if (!span) return; // Skip if no span was created in the "before" hook
span.end();

// For any "after" hook, also schedule the root component span to finish
finishRootComponentSpan(this, timestampInSeconds(), options.timeout || 2000);
// For any "after" hook, also schedule the root component span to end
maybeEndRootComponentSpan(this, timestampInSeconds(), rootComponentSpanFinalTimeout);
}
};
}
Expand Down
39 changes: 20 additions & 19 deletions packages/vue/test/tracing/tracingMixin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ vi.mock('../../src/vendor/components', () => {
};
});

const mockSpanFactory = (): { name?: string; op?: string; end: Mock; startChild: Mock } => ({
const mockSpanFactory = (): { name?: string; op?: string; end: Mock } => ({
name: undefined,
op: undefined,
end: vi.fn(),
startChild: vi.fn(),
});

vi.useFakeTimers();
Expand Down Expand Up @@ -127,23 +126,25 @@ describe('Vue Tracing Mixins', () => {
);
});

it('should finish root component span on timer after component spans end', () => {
// todo/fixme: This root component span is only finished if trackComponents is true --> it should probably be always finished
const mixins = createTracingMixins({ trackComponents: true, timeout: 1000 });
const rootMockSpan = mockSpanFactory();
mockRootInstance.$_sentryRootComponentSpan = rootMockSpan;

// Create and finish a component span
mixins.beforeMount.call(mockVueInstance);
mixins.mounted.call(mockVueInstance);

// Root component span should not end immediately
expect(rootMockSpan.end).not.toHaveBeenCalled();

// After timeout, root component span should end
vi.advanceTimersByTime(1001);
expect(rootMockSpan.end).toHaveBeenCalled();
});
it.each([true, false])(
'should finish root component span on timer after component spans end, if trackComponents is %s',
trackComponents => {
const mixins = createTracingMixins({ trackComponents, timeout: 1000 });
const rootMockSpan = mockSpanFactory();
mockRootInstance.$_sentryRootComponentSpan = rootMockSpan;

// Create and finish a component span
mixins.beforeMount.call(mockVueInstance);
mixins.mounted.call(mockVueInstance);

// Root component span should not end immediately
expect(rootMockSpan.end).not.toHaveBeenCalled();

// After timeout, root component span should end
vi.advanceTimersByTime(1001);
expect(rootMockSpan.end).toHaveBeenCalled();
},
);
});

describe('Component Span Lifecycle', () => {
Expand Down
Loading