File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
tracing-internal/src/node/integrations Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,8 @@ export class Span implements SpanInterface {
133
133
// eslint-disable-next-line deprecation/deprecation
134
134
this . instrumenter = spanContext . instrumenter || 'sentry' ;
135
135
136
- this . _attributes = dropUndefinedKeys ( {
136
+ this . _attributes = { } ;
137
+ this . setAttributes ( {
137
138
[ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ] : spanContext . origin || 'manual' ,
138
139
[ SEMANTIC_ATTRIBUTE_SENTRY_OP ] : spanContext . op ,
139
140
...spanContext . attributes ,
Original file line number Diff line number Diff line change 1
- import { getCurrentHub , startSpan } from '@sentry/core' ;
1
+ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN , getCurrentHub , startSpan } from '@sentry/core' ;
2
2
import type { Integration } from '@sentry/types' ;
3
3
import { addNonEnumerableProperty , logger } from '@sentry/utils' ;
4
4
@@ -104,7 +104,9 @@ export class Prisma implements Integration {
104
104
{
105
105
name : model ? `${ model } ${ action } ` : action ,
106
106
op : 'db.prisma' ,
107
- origin : 'auto.db.prisma' ,
107
+ attributes : {
108
+ [ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ] : 'auto.db.prisma' ,
109
+ } ,
108
110
data : { ...clientData , 'db.operation' : action } ,
109
111
} ,
110
112
( ) => next ( params ) ,
Original file line number Diff line number Diff line change @@ -305,8 +305,8 @@ describe('Hub', () => {
305
305
makeMain ( hub ) ;
306
306
hub . startTransaction ( { name : 'dogpark' , parentSampled : true } ) ;
307
307
308
- // length 1 because `sentry. origin` is set on span initialization
309
- expect ( Transaction . prototype . setAttribute ) . toHaveBeenCalledTimes ( 1 ) ;
308
+ // length 2 because origin and op are set as attributes on span initialization
309
+ expect ( Transaction . prototype . setAttribute ) . toHaveBeenCalledTimes ( 2 ) ;
310
310
} ) ;
311
311
312
312
it ( 'should record sampling method and rate when sampling decision comes from traceSampleRate' , ( ) => {
You can’t perform that action at this time.
0 commit comments