Skip to content

Commit 6fc5e70

Browse files
committed
fix
1 parent 9b26672 commit 6fc5e70

File tree

1 file changed

+1
-6
lines changed
  • instrumentation/github.com/gin-gonic/gin/otelgin

1 file changed

+1
-6
lines changed

instrumentation/github.com/gin-gonic/gin/otelgin/gin.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ const (
3232
func Middleware(service string, opts ...Option) gin.HandlerFunc {
3333
cfg := config{}
3434

35-
defaultOpts := []Option{
36-
WithSpanStartOptions(oteltrace.WithSpanKind(oteltrace.SpanKindServer)),
37-
}
38-
39-
opts = append(defaultOpts, opts...)
40-
4135
for _, opt := range opts {
4236
opt.apply(&cfg)
4337
}
@@ -99,6 +93,7 @@ func Middleware(service string, opts ...Option) gin.HandlerFunc {
9993
opts := []oteltrace.SpanStartOption{
10094
oteltrace.WithAttributes(sc.RequestTraceAttrs(service, c.Request, requestTraceAttrOpts)...),
10195
oteltrace.WithAttributes(sc.Route(c.FullPath())),
96+
oteltrace.WithSpanKind(oteltrace.SpanKindServer),
10297
}
10398

10499
opts = append(opts, cfg.SpanStartOptions...)

0 commit comments

Comments
 (0)