Skip to content

Commit

Permalink
chore: add version to echo instrumentation (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
reggiemcdonald authored Sep 8, 2020
1 parent 824feff commit 1fd4aeb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion instrumentation/github.com/labstack/echo/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (

"github.com/labstack/echo/v4"

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 @@ -40,7 +42,10 @@ func Middleware(service string, opts ...Option) echo.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 1fd4aeb

Please sign in to comment.