Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
0f6ef9a
ci(v8): Ensure CI runs on v8 & v9 branches (#14604) (#14727)
mydea Dec 16, 2024
323a38c
meta(changelog): Update changelog for 8.45.1 (#14722)
andreiborza Dec 16, 2024
3690d62
release: 8.45.1
getsentry-bot Dec 16, 2024
f6ef5a1
Merge branch 'release/8.45.1' into v8
Dec 16, 2024
85952db
chore(craft): Publish only aws v8 layer (#14703)
andreiborza Dec 16, 2024
c698ad9
feat: Allow capture of more than 1 ANR event [v8] (#14713)
timfish Dec 16, 2024
6e682c4
fix: Normalise ANR debug image file paths if appRoot was supplied [v8…
timfish Dec 16, 2024
9527563
feat(node): Detect Railway release name [v8] (#14714)
AbhiPrasad Dec 16, 2024
d32bf15
fix(nuxt): Remove build config from tsconfig (#14737)
s1gr1d Dec 16, 2024
dcc5742
ref(flags): don't export FeatureFlagContext in types-hoist/context.ts…
aliu39 Dec 16, 2024
0e5e77a
meta(changelog): Update changelog for 8.46.0
s1gr1d Dec 16, 2024
ea72950
Merge pull request #14739 from getsentry/changelog-8.46.0
s1gr1d Dec 17, 2024
5387fde
release: 8.46.0
getsentry-bot Dec 17, 2024
e80eefe
Merge branch 'release/8.46.0' into v8
Dec 17, 2024
3a7743c
feat(core): Add `updateSpanName` helper function [v8] (#14736)
Lms24 Dec 17, 2024
9c53d48
feat(v8/node/deps): Bump @prisma/instrumentation from 5.19.1 to 5.22.…
mydea Dec 17, 2024
8e0db86
chore(docs): Add docs for how to publish a release for previous major…
andreiborza Dec 18, 2024
37fbd75
feat(v8/node): Do not overwrite prisma `db.system` in newer Prisma ve…
mydea Dec 18, 2024
b1d393e
ref(v8/nextjs): Fix typo in source maps deletion warning (#14776)
Lms24 Dec 18, 2024
8107512
feat(v8/replay): Mask srcdoc iframe contents per default (#14779)
chargome Dec 18, 2024
8a7b29e
meta: Update changelog for 8.47.0 (#14777)
Lms24 Dec 18, 2024
eac1a88
release: 8.47.0
getsentry-bot Dec 18, 2024
b6c84fa
Merge branch 'release/8.47.0' into v8
Dec 18, 2024
01a2571
fix(nestjs/v8): Use correct main/module path in package.json (#14791)
AbhiPrasad Dec 19, 2024
d3f52cf
feat(v8/core): Deprecate `getDomElement` method (#14799)
mydea Dec 19, 2024
e7b3530
fix(v8/node): Ensure `NODE_OPTIONS` is not passed to worker threads (…
timfish Dec 23, 2024
bc7e87f
fix(v8/node): Correctly resolve debug IDs for ANR events with custom …
timfish Dec 23, 2024
3693a5d
fix(v8/angular): Fall back to element `tagName` when name is not prov…
Lms24 Dec 23, 2024
b578a71
fix(aws-lambda): Remove version suffix from lambda layer (#14843)
andreiborza Dec 27, 2024
75ca8b9
meta(changelog): Update changelog for 8.48.0 (#14844)
andreiborza Dec 27, 2024
576a1ad
fix(v8/core): Use consistent `continueTrace` implementation in core (…
s1gr1d Dec 30, 2024
960dd9b
fix(v8/node): Ensure express requests are properly handled (#14851)
mydea Dec 30, 2024
dbd3296
feat(v8/node): Add `openTelemetrySpanProcessors` option (#14853)
mydea Dec 30, 2024
845b7aa
fix(v8/react): Improve handling of routes nested under path="/" (#14897)
onurtemizkan Jan 3, 2025
6fa3797
feat(v8/core): Add `normalizedRequest` to `samplingContext` (#14903)
s1gr1d Jan 7, 2025
77cabfb
fix(v8/react): Use `Set` as the `allRoutes` container. (#14878) (#14884)
chargome Jan 7, 2025
8b03e0b
fix(v8/feedback): Avoid lazy loading code for `syncFeedbackIntegratio…
mydea Jan 7, 2025
8e2ed6f
meta(changelog): Update changelog for 8.48.0 (#14919)
andreiborza Jan 7, 2025
405ceb4
release: 8.48.0
getsentry-bot Jan 7, 2025
e31e1c5
Merge branch 'release/8.48.0' into v8
Jan 7, 2025
785aab3
fix(profiling/v8): Don't put `require`, `__filename` and `__dirname` …
Jan 9, 2025
8926cb7
fix(v8/vue): Re-throw error when no errorHandler exists (#14943)
s1gr1d Jan 9, 2025
af00c8f
fix(v8/sveltekit): Ensure source maps deletion is called after source…
Lms24 Jan 9, 2025
5182853
chore(v8/repo): Add missing v7 changelog entries (#14961)
Lms24 Jan 10, 2025
fda1aee
feat(v8/react): Add a `handled` prop to ErrorBoundary (#14978)
Lms24 Jan 10, 2025
0c3b2a4
fix(v8/replay): Disable mousemove sampling in rrweb for iOS browsers …
chargome Jan 10, 2025
798a932
feat(v8/browser): Flush offline queue on flush and browser online eve…
timfish Jan 13, 2025
286f6b0
test(v8/e2e): Fix node-express test transitive dependency (#15004)
mydea Jan 14, 2025
f5ac627
fix(v8/node): Enforce that ContextLines integration does not leave op…
AbhiPrasad Jan 14, 2025
629fba2
meta(changelog): Update CHANGELOG for 8.49.0 (#15019)
AbhiPrasad Jan 15, 2025
db51933
release: 8.49.0
getsentry-bot Jan 15, 2025
5144754
Merge branch 'release/8.49.0' into v8
Jan 15, 2025
6f9bc8b
feat(v8/react): Add support for React Router `createMemoryRouter` (#1…
onurtemizkan Jan 15, 2025
b93864e
meta(changelog): Update changelog for 8.50.0 (#15025)
Jan 15, 2025
70efdde
release: 8.50.0
getsentry-bot Jan 15, 2025
9ccf2bf
Merge branch 'release/8.50.0' into v8
Jan 15, 2025
40d9b9f
test(v8/browser): Unflake browser request test (#15055)
Lms24 Jan 17, 2025
50b0294
fix(v8/aws-lambda): Avoid overwriting root span name (#15054)
Lms24 Jan 17, 2025
2bc3584
feat(v8/browser): Add `multiplexedtransport.js` CDN bundle (#15043) (…
Lms24 Jan 17, 2025
dd2201e
chore(v8/deps): Upgrade to Vitest 2.1.8 and Vite 5.4.11 (#15038)
nwalters512 Jan 17, 2025
d296ce0
fix(v8/core): `fatal` events should set session as crashed (#15073)
timfish Jan 20, 2025
8b870ba
fix(v8/node/nestjs): Use method on current fastify request (#15104)
chargome Jan 21, 2025
5f47fbb
chore(v8/deps): Deduplicate yarn.lock (#15094)
nwalters512 Jan 21, 2025
b0dc860
feat(flags/v8): Add Unleash integration (#14948)
aliu39 Jan 21, 2025
79c2c2a
feat(deno): Deprecate Deno SDK as published on deno.land (#15121)
Jan 22, 2025
d7aa93f
feat(v8/sveltekit): Deprecate `fetchProxyScriptNonce` option (#15011)
Lms24 Jan 22, 2025
d9138ff
feat(node/v8): Add `prismaInstrumentation` option to Prisma integrati…
Jan 22, 2025
e9a5f00
meta: Update Changelog for 8.51.0 (#15113)
Lms24 Jan 22, 2025
3a0e160
release: 8.51.0
getsentry-bot Jan 22, 2025
d5f80af
Merge branch 'release/8.51.0' into v8
Jan 22, 2025
a76f243
feat(v8/solidstart): Add `withSentry` wrapper for SolidStart config (…
s1gr1d Jan 23, 2025
b468ab0
feat(v8/core): Add client outcomes for breadcrumbs buffer (#15149)
AbhiPrasad Jan 24, 2025
a3ddff6
feat(v8/core): Improve error formatting in ZodErrors integration (#15…
AbhiPrasad Jan 24, 2025
fe0272a
fix(v8/bun): Ensure instrumentation of `Bun.serve` survives a server …
AbhiPrasad Jan 27, 2025
3fa3510
test(v8/e2e): Unflake replay recording data optional e2e test (#15168…
Lms24 Jan 27, 2025
4a83c9a
test(v8/e2e): Avoid making request to example.com in nextjs e2e test …
Lms24 Jan 27, 2025
cb6aca7
fix(v8/core): Pass `module` into `loadModule` (#15139) (#15166)
Lms24 Jan 27, 2025
a6f7300
meta(changelog): Update CHANGELOG for 8.52.0 (#15177)
AbhiPrasad Jan 27, 2025
bbafacb
release: 8.52.0
getsentry-bot Jan 27, 2025
42969d7
Merge branch 'release/8.52.0' into v8
Jan 28, 2025
0cfcd6f
ci(v8): Pin node-integration-test version to `18.20.5` (#15221)
mydea Jan 29, 2025
4574acc
test(v8): Fix nextjs build warning (#15226)
mydea Jan 29, 2025
a0470da
ref(v8/core): Don't set `this.name` to `new.target.prototype.construc…
mydea Jan 30, 2025
6152ef5
ref(v8/browser): Add protocol attributes to resource spans (#15224)
Lms24 Jan 30, 2025
0114ba4
meta: Update changelog for 8.52.1 (#15230)
Lms24 Jan 30, 2025
42011b5
release: 8.52.1
getsentry-bot Jan 30, 2025
36bdc47
Merge branch 'release/8.52.1' into v8
Jan 30, 2025
4df3759
feat(v8/nuxt): Add `url` to `SourcemapsUploadOptions` (#15202)
Lms24 Jan 31, 2025
ef4f210
fix(v8/react): From location can be undefined in Tanstack Router Inst…
Lms24 Jan 31, 2025
f08e613
meta: Update Changelog for 8.53.0 (#15243)
Lms24 Jan 31, 2025
3d8b132
release: 8.53.0
getsentry-bot Jan 31, 2025
13aadde
Merge branch 'release/8.53.0' into v8
Jan 31, 2025
3673689
feat(v8/deps): Upgrade all OpenTelemetry dependencies (#15098)
nwalters512 Jan 31, 2025
b6a4a4a
fix(node/v8): Add compatibility layer for Prisma v5 (#15210)
Feb 3, 2025
ff4fb5f
meta(changelog): Update changelog for 8.54.0 (#15261)
andreiborza Feb 3, 2025
e9a45fe
release: 8.54.0
getsentry-bot Feb 3, 2025
d7ec8a9
Merge branch 'release/8.54.0' into v8
Feb 3, 2025
d459577
fix(v8/svelte): Guard component tracking `beforeUpdate` call (#15262)
Lms24 Feb 3, 2025
6305a0c
fix(v8/nuxt): Detect Azure Function runtime for flushing with timeout…
s1gr1d Feb 5, 2025
ca47b56
ref(flags): rename unleash integration param w/backwards compatibilit…
aliu39 Feb 7, 2025
a29b61e
Biome check
aliu39 Feb 7, 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(v8/angular): Fall back to element tagName when name is not prov…
…ided to `TraceDirective` (#14828)

Backport of #14778

---------

Co-authored-by: Artur <[email protected]>
  • Loading branch information
Lms24 and arturovt authored Dec 23, 2024
commit 3693a5d09edffd7719edfeace2c35c062baea228
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

Work in this release was contributed by @arturovt. Thank you for your contribution!

## 8.47.0

- feat(v8/core): Add `updateSpanName` helper function (#14736)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { SampleComponent } from '../sample-component/sample-component.components
selector: 'app-cancel',
standalone: true,
imports: [TraceModule, SampleComponent],
template: `<app-sample-component [trace]="'sample-component'"></app-sample-component>`,
template: `
<app-sample-component [trace]="'sample-component'"></app-sample-component>
<app-sample-component trace></app-sample-component>
`,
})
@TraceClass({ name: 'ComponentTrackingComponent' })
export class ComponentTrackingComponent implements OnInit, AfterViewInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ test.describe('finish routing span', () => {
});

test.describe('TraceDirective', () => {
test('creates a child tracingSpan with component name as span name on ngOnInit', async ({ page }) => {
test('creates a child span with the component name as span name on ngOnInit', async ({ page }) => {
const navigationTxnPromise = waitForTransaction('angular-17', async transactionEvent => {
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'navigation';
});
Expand All @@ -201,23 +201,36 @@ test.describe('TraceDirective', () => {
// immediately navigate to a different route
const [_, navigationTxn] = await Promise.all([page.locator('#componentTracking').click(), navigationTxnPromise]);

const traceDirectiveSpan = navigationTxn.spans?.find(
const traceDirectiveSpans = navigationTxn.spans?.filter(
span => span?.data && span?.data[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] === 'auto.ui.angular.trace_directive',
);

expect(traceDirectiveSpan).toBeDefined();
expect(traceDirectiveSpan).toEqual(
expect.objectContaining({
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.angular.init',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive',
},
description: '<sample-component>',
op: 'ui.angular.init',
origin: 'auto.ui.angular.trace_directive',
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
}),
expect(traceDirectiveSpans).toHaveLength(2);
expect(traceDirectiveSpans).toEqual(
expect.arrayContaining([
expect.objectContaining({
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.angular.init',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive',
},
description: '<sample-component>', // custom component name passed to trace directive
op: 'ui.angular.init',
origin: 'auto.ui.angular.trace_directive',
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
}),
expect.objectContaining({
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.angular.init',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive',
},
description: '<app-sample-component>', // fallback selector name
op: 'ui.angular.init',
origin: 'auto.ui.angular.trace_directive',
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
}),
]),
);
});
});
Expand Down
2 changes: 2 additions & 0 deletions dev-packages/e2e-tests/test-applications/angular-19/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@sentry:registry=http://127.0.0.1:4873
@sentry-internal:registry=http://127.0.0.1:4873
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import { TraceClass, TraceMethod, TraceModule } from '@sentry/angular';
import { SampleComponent } from '../sample-component/sample-component.components';

@Component({
selector: 'app-cancel',
selector: 'app-component-tracking',
standalone: true,
imports: [TraceModule, SampleComponent],
template: `<app-sample-component [trace]="'sample-component'"></app-sample-component>`,
template: `
<app-sample-component trace="sample-component"></app-sample-component>
<app-sample-component trace></app-sample-component>
`,
})
@TraceClass({ name: 'ComponentTrackingComponent' })
export class ComponentTrackingComponent implements OnInit, AfterViewInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ test.describe('finish routing span', () => {
});

test.describe('TraceDirective', () => {
test('creates a child tracingSpan with component name as span name on ngOnInit', async ({ page }) => {
test('creates a child span with the component name as span name on ngOnInit', async ({ page }) => {
const navigationTxnPromise = waitForTransaction('angular-18', async transactionEvent => {
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'navigation';
});
Expand All @@ -201,23 +201,36 @@ test.describe('TraceDirective', () => {
// immediately navigate to a different route
const [_, navigationTxn] = await Promise.all([page.locator('#componentTracking').click(), navigationTxnPromise]);

const traceDirectiveSpan = navigationTxn.spans?.find(
const traceDirectiveSpans = navigationTxn.spans?.filter(
span => span?.data && span?.data[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] === 'auto.ui.angular.trace_directive',
);

expect(traceDirectiveSpan).toBeDefined();
expect(traceDirectiveSpan).toEqual(
expect.objectContaining({
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.angular.init',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive',
},
description: '<sample-component>',
op: 'ui.angular.init',
origin: 'auto.ui.angular.trace_directive',
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
}),
expect(traceDirectiveSpans).toHaveLength(2);
expect(traceDirectiveSpans).toEqual(
expect.arrayContaining([
expect.objectContaining({
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.angular.init',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive',
},
description: '<sample-component>', // custom component name passed to trace directive
op: 'ui.angular.init',
origin: 'auto.ui.angular.trace_directive',
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
}),
expect.objectContaining({
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.angular.init',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive',
},
description: '<app-sample-component>', // fallback selector name
op: 'ui.angular.init',
origin: 'auto.ui.angular.trace_directive',
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
}),
]),
);
});
});
Expand Down
23 changes: 19 additions & 4 deletions packages/angular/src/tracing.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
import { ElementRef } from '@angular/core';
import type { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
import { Directive, Injectable, Input, NgModule } from '@angular/core';
import type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router';
Expand Down Expand Up @@ -235,24 +237,37 @@ export class TraceService implements OnDestroy {
}
}

const UNKNOWN_COMPONENT = 'unknown';

/**
* A directive that can be used to capture initialization lifecycle of the whole component.
* Captures the initialization lifecycle of the component this directive is applied to.
* Specifically, this directive measures the time between `ngOnInit` and `ngAfterViewInit`
* of the component.
*
* Falls back to the component's selector if no name is provided.
*
* @example
* ```html
* <app-my-component trace="myComponent"></app-my-component>
* ```
*/
@Directive({ selector: '[trace]' })
export class TraceDirective implements OnInit, AfterViewInit {
@Input('trace') public componentName?: string;

private _tracingSpan?: Span;

public constructor(private readonly _host: ElementRef<HTMLElement>) {}

/**
* Implementation of OnInit lifecycle method
* @inheritdoc
*/
public ngOnInit(): void {
if (!this.componentName) {
this.componentName = UNKNOWN_COMPONENT;
// Technically, the `trace` binding should always be provided.
// However, if it is incorrectly declared on the element without a
// value (e.g., `<app-component trace />`), we fall back to using `tagName`
// (which is e.g. `APP-COMPONENT`).
this.componentName = this._host.nativeElement.tagName.toLowerCase();
}

if (getActiveSpan()) {
Expand Down
Loading