@@ -27,7 +27,6 @@ import {
2727import { Span } from '@opentelemetry/api' ;
2828import * as http from 'http' ;
2929import { HttpInstrumentation } from '@opentelemetry/instrumentation-http' ;
30- import { ANONYMOUS_NAME } from '../src/instrumentation' ;
3130import { AttributeNames , FastifyInstrumentation } from '../src' ;
3231import { FastifyRequestInfo } from '../src/types' ;
3332
@@ -152,7 +151,10 @@ describe('fastify', () => {
152151 'plugin.name' : 'fastify -> @fastify/express' ,
153152 [ SemanticAttributes . HTTP_ROUTE ] : '/test' ,
154153 } ) ;
155- assert . strictEqual ( span . name , `request handler - ${ ANONYMOUS_NAME } ` ) ;
154+ assert . strictEqual (
155+ span . name ,
156+ 'request handler - fastify -> @fastify/express'
157+ ) ;
156158 const baseSpan = spans [ 1 ] ;
157159 assert . strictEqual ( span . parentSpanId , baseSpan . spanContext ( ) . spanId ) ;
158160 } ) ;
@@ -290,7 +292,7 @@ describe('fastify', () => {
290292 assert . strictEqual ( spans . length , 6 ) ;
291293 const baseSpan = spans [ 1 ] ;
292294 const span = spans [ 2 ] ;
293- assert . strictEqual ( span . name , ` middleware - ${ ANONYMOUS_NAME } ` ) ;
295+ assert . strictEqual ( span . name , ' middleware - subsystem' ) ;
294296 assert . deepStrictEqual ( span . attributes , {
295297 'fastify.type' : 'middleware' ,
296298 'plugin.name' : 'subsystem' ,
@@ -307,7 +309,7 @@ describe('fastify', () => {
307309
308310 assert . strictEqual ( spans . length , 6 ) ;
309311 const span = spans [ 3 ] ;
310- assert . strictEqual ( span . name , 'request handler - anonymous ' ) ;
312+ assert . strictEqual ( span . name , 'request handler - subsystem ' ) ;
311313 assert . deepStrictEqual ( span . status , {
312314 code : SpanStatusCode . ERROR ,
313315 message : 'foo' ,
0 commit comments