Skip to content

Commit

Permalink
chore: add version to gorilla/mux instrumentation (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
reggiemcdonald authored Sep 9, 2020
1 parent e066389 commit 5a0832b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion instrumentation/github.com/gorilla/mux/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (

"github.com/gorilla/mux"

otelcontrib "go.opentelemetry.io/contrib"

otelglobal "go.opentelemetry.io/otel/api/global"
otelpropagation "go.opentelemetry.io/otel/api/propagation"
oteltrace "go.opentelemetry.io/otel/api/trace"
Expand All @@ -42,7 +44,10 @@ func Middleware(service string, opts ...Option) mux.MiddlewareFunc {
if cfg.TracerProvider == nil {
cfg.TracerProvider = otelglobal.TraceProvider()
}
tracer := cfg.TracerProvider.Tracer(tracerName)
tracer := cfg.TracerProvider.Tracer(
tracerName,
oteltrace.WithInstrumentationVersion(otelcontrib.SemVersion()),
)
if cfg.Propagators == nil {
cfg.Propagators = otelglobal.Propagators()
}
Expand Down

0 comments on commit 5a0832b

Please sign in to comment.