feat(angular): Emit low cardinality TraceMethod span name and preserve description - #24239
feat(angular): Emit low cardinality TraceMethod span name and preserve description#24239Lms24 wants to merge 6 commits into
TraceMethod span name and preserve description#24239Conversation
TraceMethod span name and preserve description
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c0dbb63. Configure here.
size-limit report 📦
|
nicohrubec
left a comment
There was a problem hiding this comment.
not sure if this assertion was dropped on purpose, but other than that lgtm
| attributes: expect.objectContaining({ | ||
| 'sentry.op': { type: 'string', value: 'function' }, | ||
| 'sentry.origin': { type: 'string', value: 'auto.ui.angular.trace_method_decorator' }, | ||
| 'code.function.name': { type: 'string', value: 'ngAfterViewInit' }, |
There was a problem hiding this comment.
q/l: why is this gone? the implementation falls back to the value we used before so iiuc the value should still be there
There was a problem hiding this comment.
added it back. I removed the logic to set this previously because I thought it was weird that span description was unnamed but we had this attribute. I then walked back on this to keep as much information as possible but forgot to read the assertion 😅
There was a problem hiding this comment.
This is only an issue if users don't pass a name to the decorator, which is generally what we recommend to avoid mangled/minified function names
| attributes: expect.objectContaining({ | ||
| 'sentry.op': { type: 'string', value: 'function' }, | ||
| 'sentry.origin': { type: 'string', value: 'auto.ui.angular.trace_method_decorator' }, | ||
| 'code.function.name': { type: 'string', value: 'ngOnInit' }, |
There was a problem hiding this comment.
for instance here we keep the assertion

Adjusts the
functionspan name for@TraceMethoddecorator spans in the Angular SDK:sentry.descriptionattribute. We can't model the special case we had here previously with convention description inference rules, so we need to override inference by directly setting this attribute.ref #23954