@@ -43,7 +43,6 @@ func New(opts ...RouterOption) *Router {
4343 cfg .spanOpts = append (cfg .spanOpts , tracer .Measured ())
4444 cfg .spanOpts = append (cfg .spanOpts , tracer .Tag (ext .SpanKind , ext .SpanKindServer ))
4545 cfg .spanOpts = append (cfg .spanOpts , tracer .Tag (ext .Component , componentName ))
46- cfg .spanOpts = append (cfg .spanOpts , instrumentation .ServiceNameWithSource (cfg .serviceName , cfg .serviceSource ))
4746 instr .Logger ().Debug ("contrib/dimfeld/httptreemux.v5: Configuring Router: %#v" , cfg )
4847 return & Router {httptreemux .New (), cfg }
4948}
@@ -54,11 +53,12 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
5453 route , _ := getRoute (r .TreeMux , w , req )
5554 // pass r.TreeMux to avoid a circular reference panic on calling r.ServeHTTP
5655 httptrace .TraceAndServe (r .TreeMux , w , req , & httptrace.ServeConfig {
57- Framework : "github.com/dimfeld/httptreemux/v5" ,
58- Service : r .config .serviceName ,
59- Resource : resource ,
60- SpanOpts : r .config .spanOpts ,
61- Route : route ,
56+ Framework : "github.com/dimfeld/httptreemux/v5" ,
57+ Service : r .config .serviceName ,
58+ ServiceSource : r .config .serviceSource ,
59+ Resource : resource ,
60+ SpanOpts : r .config .spanOpts ,
61+ Route : route ,
6262 })
6363}
6464
@@ -80,7 +80,6 @@ func NewWithContext(opts ...RouterOption) *ContextRouter {
8080 cfg .spanOpts = append (cfg .spanOpts , tracer .Measured ())
8181 cfg .spanOpts = append (cfg .spanOpts , tracer .Tag (ext .SpanKind , ext .SpanKindServer ))
8282 cfg .spanOpts = append (cfg .spanOpts , tracer .Tag (ext .Component , componentName ))
83- cfg .spanOpts = append (cfg .spanOpts , instrumentation .ServiceNameWithSource (cfg .serviceName , cfg .serviceSource ))
8483 instr .Logger ().Debug ("contrib/dimfeld/httptreemux.v5: Configuring ContextRouter: %#v" , cfg )
8584 return & ContextRouter {httptreemux .NewContextMux (), cfg }
8685}
@@ -91,11 +90,12 @@ func (r *ContextRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
9190 route , _ := getRoute (r .TreeMux , w , req )
9291 // pass r.TreeMux to avoid a circular reference panic on calling r.ServeHTTP
9392 httptrace .TraceAndServe (r .TreeMux , w , req , & httptrace.ServeConfig {
94- Framework : "github.com/dimfeld/httptreemux/v5" ,
95- Service : r .config .serviceName ,
96- Resource : resource ,
97- SpanOpts : r .config .spanOpts ,
98- Route : route ,
93+ Framework : "github.com/dimfeld/httptreemux/v5" ,
94+ Service : r .config .serviceName ,
95+ ServiceSource : r .config .serviceSource ,
96+ Resource : resource ,
97+ SpanOpts : r .config .spanOpts ,
98+ Route : route ,
9999 })
100100}
101101
0 commit comments