From 1fd4aeba2a38bd329a256274deb744814301411c Mon Sep 17 00:00:00 2001 From: Reginald McDonald <40721169+reggiemcdonald@users.noreply.github.com> Date: Tue, 8 Sep 2020 08:57:40 -0700 Subject: [PATCH] chore: add version to echo instrumentation (#327) --- instrumentation/github.com/labstack/echo/echo.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/instrumentation/github.com/labstack/echo/echo.go b/instrumentation/github.com/labstack/echo/echo.go index d805de47833..4d269d6daf1 100644 --- a/instrumentation/github.com/labstack/echo/echo.go +++ b/instrumentation/github.com/labstack/echo/echo.go @@ -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" @@ -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() }