We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b26672 commit 6fc5e70Copy full SHA for 6fc5e70
instrumentation/github.com/gin-gonic/gin/otelgin/gin.go
@@ -32,12 +32,6 @@ const (
32
func Middleware(service string, opts ...Option) gin.HandlerFunc {
33
cfg := config{}
34
35
- defaultOpts := []Option{
36
- WithSpanStartOptions(oteltrace.WithSpanKind(oteltrace.SpanKindServer)),
37
- }
38
-
39
- opts = append(defaultOpts, opts...)
40
41
for _, opt := range opts {
42
opt.apply(&cfg)
43
}
@@ -99,6 +93,7 @@ func Middleware(service string, opts ...Option) gin.HandlerFunc {
99
93
opts := []oteltrace.SpanStartOption{
100
94
oteltrace.WithAttributes(sc.RequestTraceAttrs(service, c.Request, requestTraceAttrOpts)...),
101
95
oteltrace.WithAttributes(sc.Route(c.FullPath())),
96
+ oteltrace.WithSpanKind(oteltrace.SpanKindServer),
102
97
103
98
104
opts = append(opts, cfg.SpanStartOptions...)
0 commit comments