File tree Expand file tree Collapse file tree
packages/dd-trace/src/plugins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,15 +8,12 @@ class ConsumerPlugin extends InboundPlugin {
88 static get type ( ) { return 'messaging' }
99
1010 startSpan ( options ) {
11- const spanDefaults = {
12- service : this . config . service || this . serviceName ( ) ,
13- kind : this . constructor . kind
11+ if ( ! options . service ) {
12+ options . service = this . config . service || this . serviceName ( )
13+ }
14+ if ( ! options . kind ) {
15+ options . kind = this . constructor . kind
1416 }
15- Object . keys ( spanDefaults ) . forEach (
16- key => {
17- if ( ! options [ key ] ) options [ key ] = spanDefaults [ key ]
18- }
19- )
2017 return super . startSpan ( this . operationName ( ) , options )
2118 }
2219}
Original file line number Diff line number Diff line change @@ -9,9 +9,11 @@ class ProducerPlugin extends OutboundPlugin {
99
1010 startSpan ( options ) {
1111 const spanDefaults = {
12- service : this . config . service || this . serviceName ( ) ,
1312 kind : this . constructor . kind
1413 }
14+ if ( ! options . service ) {
15+ options . service = this . config . service || this . serviceName ( )
16+ }
1517 Object . keys ( spanDefaults ) . forEach (
1618 key => {
1719 if ( ! options [ key ] ) options [ key ] = spanDefaults [ key ]
You can’t perform that action at this time.
0 commit comments