diff --git a/CHANGELOG.md b/CHANGELOG.md index ddaf721e7df..63e3ef81a73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] -### Changed +### Additions - Add `emicklei/go-restful/v3` trace instrumentation. (#115) + +### Changed + +- Move all github.com package instrumentation under a github.com directory. (#118) - Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#114) - Create this `CHANGELOG.md`. (#114) diff --git a/instrumentation/gin-gonic/gin/doc.go b/instrumentation/github.com/gin-gonic/gin/doc.go similarity index 97% rename from instrumentation/gin-gonic/gin/doc.go rename to instrumentation/github.com/gin-gonic/gin/doc.go index 4ee598c9019..efb07e1c70c 100644 --- a/instrumentation/gin-gonic/gin/doc.go +++ b/instrumentation/github.com/gin-gonic/gin/doc.go @@ -19,4 +19,4 @@ // instrumenting the routing of a received message (the Middleware // function) and instrumenting the response generation through // template evaluation (the HTML function). -package gin // import "go.opentelemetry.io/contrib/instrumentation/gin-gonic/gin" +package gin // import "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin" diff --git a/instrumentation/gin-gonic/gin/example/Dockerfile b/instrumentation/github.com/gin-gonic/gin/example/Dockerfile similarity index 92% rename from instrumentation/gin-gonic/gin/example/Dockerfile rename to instrumentation/github.com/gin-gonic/gin/example/Dockerfile index b8ed4646d50..7d491261bba 100644 --- a/instrumentation/gin-gonic/gin/example/Dockerfile +++ b/instrumentation/github.com/gin-gonic/gin/example/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. FROM golang:alpine AS base COPY . /src/ -WORKDIR /src/instrumentation/gin-gonic/gin +WORKDIR /src/instrumentation/github.com/gin-gonic/gin FROM base AS gin-server RUN go install ./example/server.go diff --git a/instrumentation/gin-gonic/gin/example/README.md b/instrumentation/github.com/gin-gonic/gin/example/README.md similarity index 100% rename from instrumentation/gin-gonic/gin/example/README.md rename to instrumentation/github.com/gin-gonic/gin/example/README.md diff --git a/instrumentation/gin-gonic/gin/example/docker-compose.yml b/instrumentation/github.com/gin-gonic/gin/example/docker-compose.yml similarity index 97% rename from instrumentation/gin-gonic/gin/example/docker-compose.yml rename to instrumentation/github.com/gin-gonic/gin/example/docker-compose.yml index 46aa7e43918..71c9ca083e9 100644 --- a/instrumentation/gin-gonic/gin/example/docker-compose.yml +++ b/instrumentation/github.com/gin-gonic/gin/example/docker-compose.yml @@ -26,7 +26,7 @@ services: gin-server: build: dockerfile: $PWD/Dockerfile - context: ../../../.. + context: ../../../../.. ports: - "8080:80" command: diff --git a/instrumentation/gin-gonic/gin/example/server.go b/instrumentation/github.com/gin-gonic/gin/example/server.go similarity index 96% rename from instrumentation/gin-gonic/gin/example/server.go rename to instrumentation/github.com/gin-gonic/gin/example/server.go index b2ec88ab134..d53083c7611 100644 --- a/instrumentation/gin-gonic/gin/example/server.go +++ b/instrumentation/github.com/gin-gonic/gin/example/server.go @@ -22,7 +22,7 @@ import ( "github.com/gin-gonic/gin" - gintrace "go.opentelemetry.io/contrib/instrumentation/gin-gonic/gin" + gintrace "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin" otelglobal "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/kv" oteltrace "go.opentelemetry.io/otel/api/trace" diff --git a/instrumentation/gin-gonic/gin/gintrace.go b/instrumentation/github.com/gin-gonic/gin/gintrace.go similarity index 97% rename from instrumentation/gin-gonic/gin/gintrace.go rename to instrumentation/github.com/gin-gonic/gin/gintrace.go index 0c3eac25e6a..6709958f74a 100644 --- a/instrumentation/gin-gonic/gin/gintrace.go +++ b/instrumentation/github.com/gin-gonic/gin/gintrace.go @@ -31,7 +31,7 @@ import ( const ( tracerKey = "otel-go-contrib-tracer" - tracerName = "go.opentelemetry.io/contrib/instrumentation/gin-gonic/gin" + tracerName = "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin" ) // Middleware returns middleware that will trace incoming requests. diff --git a/instrumentation/gin-gonic/gin/gintrace_test.go b/instrumentation/github.com/gin-gonic/gin/gintrace_test.go similarity index 99% rename from instrumentation/gin-gonic/gin/gintrace_test.go rename to instrumentation/github.com/gin-gonic/gin/gintrace_test.go index a47adf17b32..6cac53b7647 100644 --- a/instrumentation/gin-gonic/gin/gintrace_test.go +++ b/instrumentation/github.com/gin-gonic/gin/gintrace_test.go @@ -52,7 +52,7 @@ func TestChildSpanFromGlobalTracer(t *testing.T) { spanTracer := span.Tracer() mockTracer, ok := spanTracer.(*mocktrace.Tracer) require.True(t, ok) - assert.Equal(t, "go.opentelemetry.io/contrib/instrumentation/gin-gonic/gin", mockTracer.Name) + assert.Equal(t, "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin", mockTracer.Name) }) r := httptest.NewRequest("GET", "/user/123", nil) diff --git a/instrumentation/gin-gonic/gin/go.mod b/instrumentation/github.com/gin-gonic/gin/go.mod similarity index 60% rename from instrumentation/gin-gonic/gin/go.mod rename to instrumentation/github.com/gin-gonic/gin/go.mod index fdef2ba2471..8bef96c5377 100644 --- a/instrumentation/gin-gonic/gin/go.mod +++ b/instrumentation/github.com/gin-gonic/gin/go.mod @@ -1,8 +1,8 @@ -module go.opentelemetry.io/contrib/instrumentation/gin-gonic/gin +module go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin go 1.14 -replace go.opentelemetry.io/contrib => ../../.. +replace go.opentelemetry.io/contrib => ../../../.. require ( github.com/gin-gonic/gin v1.6.3 diff --git a/instrumentation/gin-gonic/gin/go.sum b/instrumentation/github.com/gin-gonic/gin/go.sum similarity index 100% rename from instrumentation/gin-gonic/gin/go.sum rename to instrumentation/github.com/gin-gonic/gin/go.sum diff --git a/instrumentation/gin-gonic/gin/option.go b/instrumentation/github.com/gin-gonic/gin/option.go similarity index 93% rename from instrumentation/gin-gonic/gin/option.go rename to instrumentation/github.com/gin-gonic/gin/option.go index 01206e3ff35..d8195dee03d 100644 --- a/instrumentation/gin-gonic/gin/option.go +++ b/instrumentation/github.com/gin-gonic/gin/option.go @@ -31,8 +31,8 @@ type Option func(*Config) // WithTracer specifies a tracer to use for creating spans. If none is // specified, a tracer named -// "go.opentelemetry.io/contrib/instrumentation/gin-gonic/gin" from the global -// provider is used. +// "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin" +// from the global provider is used. func WithTracer(tracer oteltrace.Tracer) Option { return func(cfg *Config) { cfg.Tracer = tracer diff --git a/instrumentation/gorilla/mux/config.go b/instrumentation/github.com/gorilla/mux/config.go similarity index 93% rename from instrumentation/gorilla/mux/config.go rename to instrumentation/github.com/gorilla/mux/config.go index 816fb8d55de..a126e738183 100644 --- a/instrumentation/gorilla/mux/config.go +++ b/instrumentation/github.com/gorilla/mux/config.go @@ -30,8 +30,8 @@ type Option func(*Config) // WithTracer specifies a tracer to use for creating spans. If none is // specified, a tracer named -// "go.opentelemetry.io/contrib/instrumentation/gorilla/mux" from the global -// provider is used. +// "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux" +// from the global provider is used. func WithTracer(tracer oteltrace.Tracer) Option { return func(cfg *Config) { cfg.Tracer = tracer diff --git a/instrumentation/gorilla/mux/doc.go b/instrumentation/github.com/gorilla/mux/doc.go similarity index 97% rename from instrumentation/gorilla/mux/doc.go rename to instrumentation/github.com/gorilla/mux/doc.go index bc68ccec8e9..d590866e6f1 100644 --- a/instrumentation/gorilla/mux/doc.go +++ b/instrumentation/github.com/gorilla/mux/doc.go @@ -17,4 +17,4 @@ // // Currently only the routing of a received message can be // instrumented. To do it, use the Middleware function. -package mux // import "go.opentelemetry.io/contrib/instrumentation/gorilla/mux" +package mux // import "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux" diff --git a/instrumentation/gorilla/mux/example/Dockerfile b/instrumentation/github.com/gorilla/mux/example/Dockerfile similarity index 93% rename from instrumentation/gorilla/mux/example/Dockerfile rename to instrumentation/github.com/gorilla/mux/example/Dockerfile index 36a2c212114..024b27370cd 100644 --- a/instrumentation/gorilla/mux/example/Dockerfile +++ b/instrumentation/github.com/gorilla/mux/example/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. FROM golang:alpine AS base COPY . /src/ -WORKDIR /src/instrumentation/gorilla/mux +WORKDIR /src/instrumentation/github.com/gorilla/mux FROM base AS mux-server RUN go install ./example/server.go diff --git a/instrumentation/gorilla/mux/example/README.md b/instrumentation/github.com/gorilla/mux/example/README.md similarity index 100% rename from instrumentation/gorilla/mux/example/README.md rename to instrumentation/github.com/gorilla/mux/example/README.md diff --git a/instrumentation/gorilla/mux/example/docker-compose.yml b/instrumentation/github.com/gorilla/mux/example/docker-compose.yml similarity index 97% rename from instrumentation/gorilla/mux/example/docker-compose.yml rename to instrumentation/github.com/gorilla/mux/example/docker-compose.yml index eb7b2c768ce..77c0a75c910 100644 --- a/instrumentation/gorilla/mux/example/docker-compose.yml +++ b/instrumentation/github.com/gorilla/mux/example/docker-compose.yml @@ -26,7 +26,7 @@ services: mux-server: build: dockerfile: $PWD/Dockerfile - context: ../../../.. + context: ../../../../.. ports: - "8080:80" command: diff --git a/instrumentation/gorilla/mux/example/server.go b/instrumentation/github.com/gorilla/mux/example/server.go similarity index 96% rename from instrumentation/gorilla/mux/example/server.go rename to instrumentation/github.com/gorilla/mux/example/server.go index a73f9915154..24ce5ed5cb4 100644 --- a/instrumentation/gorilla/mux/example/server.go +++ b/instrumentation/github.com/gorilla/mux/example/server.go @@ -22,7 +22,7 @@ import ( "github.com/gorilla/mux" - muxtrace "go.opentelemetry.io/contrib/instrumentation/gorilla/mux" + muxtrace "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux" otelglobal "go.opentelemetry.io/otel/api/global" otelkv "go.opentelemetry.io/otel/api/kv" oteltrace "go.opentelemetry.io/otel/api/trace" diff --git a/instrumentation/gorilla/mux/go.mod b/instrumentation/github.com/gorilla/mux/go.mod similarity index 55% rename from instrumentation/gorilla/mux/go.mod rename to instrumentation/github.com/gorilla/mux/go.mod index cb9ca404026..6a448a08213 100644 --- a/instrumentation/gorilla/mux/go.mod +++ b/instrumentation/github.com/gorilla/mux/go.mod @@ -1,8 +1,8 @@ -module go.opentelemetry.io/contrib/instrumentation/gorilla/mux +module go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux go 1.14 -replace go.opentelemetry.io/contrib => ../../.. +replace go.opentelemetry.io/contrib => ../../../.. require ( github.com/gorilla/mux v1.7.4 diff --git a/instrumentation/gorilla/mux/go.sum b/instrumentation/github.com/gorilla/mux/go.sum similarity index 100% rename from instrumentation/gorilla/mux/go.sum rename to instrumentation/github.com/gorilla/mux/go.sum diff --git a/instrumentation/gorilla/mux/mux.go b/instrumentation/github.com/gorilla/mux/mux.go similarity index 97% rename from instrumentation/gorilla/mux/mux.go rename to instrumentation/github.com/gorilla/mux/mux.go index faafb0dc0b4..0d24255f3c3 100644 --- a/instrumentation/gorilla/mux/mux.go +++ b/instrumentation/github.com/gorilla/mux/mux.go @@ -28,7 +28,7 @@ import ( ) const ( - tracerName = "go.opentelemetry.io/contrib/instrumentation/gorilla/mux" + tracerName = "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux" ) // Middleware sets up a handler to start tracing the incoming diff --git a/instrumentation/gorilla/mux/mux_test.go b/instrumentation/github.com/gorilla/mux/mux_test.go similarity index 99% rename from instrumentation/gorilla/mux/mux_test.go rename to instrumentation/github.com/gorilla/mux/mux_test.go index e3ee06def72..03d22aa7d06 100644 --- a/instrumentation/gorilla/mux/mux_test.go +++ b/instrumentation/github.com/gorilla/mux/mux_test.go @@ -43,7 +43,7 @@ func TestChildSpanFromGlobalTracer(t *testing.T) { spanTracer := span.Tracer() mockTracer, ok := spanTracer.(*mocktrace.Tracer) require.True(t, ok) - assert.Equal(t, "go.opentelemetry.io/contrib/instrumentation/gorilla/mux", mockTracer.Name) + assert.Equal(t, "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux", mockTracer.Name) w.WriteHeader(http.StatusOK) })) diff --git a/instrumentation/labstack/echo/config.go b/instrumentation/github.com/labstack/echo/config.go similarity index 92% rename from instrumentation/labstack/echo/config.go rename to instrumentation/github.com/labstack/echo/config.go index 07614bc52f7..cf90b04ed10 100644 --- a/instrumentation/labstack/echo/config.go +++ b/instrumentation/github.com/labstack/echo/config.go @@ -30,8 +30,8 @@ type Option func(*Config) // WithTracer specifies a tracer to use for creating spans. If none is // specified, a tracer named -// "go.opentelemetry.io/contrib/instrumentation/labstack/echo" from the global -// provider is used. +// "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo" +// from the global provider is used. func WithTracer(tracer oteltrace.Tracer) Option { return func(cfg *Config) { cfg.Tracer = tracer diff --git a/instrumentation/github.com/labstack/echo/doc.go b/instrumentation/github.com/labstack/echo/doc.go new file mode 100644 index 00000000000..aaa4af34373 --- /dev/null +++ b/instrumentation/github.com/labstack/echo/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package echo provides functions to trace the labstack/echo package +// (https://github.com/labstack/echo). +// +// Currently only the routing of a received message can be +// instrumented. To do so, use the Middleware function. +package echo // import "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo" diff --git a/instrumentation/labstack/echo/echo.go b/instrumentation/github.com/labstack/echo/echo.go similarity index 97% rename from instrumentation/labstack/echo/echo.go rename to instrumentation/github.com/labstack/echo/echo.go index c3dbd4989c9..e30687ebc11 100644 --- a/instrumentation/labstack/echo/echo.go +++ b/instrumentation/github.com/labstack/echo/echo.go @@ -28,7 +28,7 @@ import ( const ( tracerKey = "otel-go-contrib-tracer-labstack-echo" - tracerName = "go.opentelemetry.io/contrib/instrumentation/labstack/echo" + tracerName = "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo" ) // Middleware returns echo middleware which will trace incoming requests. diff --git a/instrumentation/labstack/echo/echo_test.go b/instrumentation/github.com/labstack/echo/echo_test.go similarity index 98% rename from instrumentation/labstack/echo/echo_test.go rename to instrumentation/github.com/labstack/echo/echo_test.go index 0a78087c612..690add180f4 100644 --- a/instrumentation/labstack/echo/echo_test.go +++ b/instrumentation/github.com/labstack/echo/echo_test.go @@ -48,7 +48,7 @@ func TestChildSpanFromGlobalTracer(t *testing.T) { spanTracer := span.Tracer() mockTracer, ok := spanTracer.(*mocktrace.Tracer) require.True(t, ok) - assert.Equal(t, "go.opentelemetry.io/contrib/instrumentation/labstack/echo", mockTracer.Name) + assert.Equal(t, "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo", mockTracer.Name) return c.NoContent(200) }) diff --git a/instrumentation/labstack/echo/example/Dockerfile b/instrumentation/github.com/labstack/echo/example/Dockerfile similarity index 92% rename from instrumentation/labstack/echo/example/Dockerfile rename to instrumentation/github.com/labstack/echo/example/Dockerfile index 9e9a8b40dab..1619a6a7d4c 100644 --- a/instrumentation/labstack/echo/example/Dockerfile +++ b/instrumentation/github.com/labstack/echo/example/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. FROM golang:alpine AS base COPY . /src/ -WORKDIR /src/instrumentation/labstack/echo +WORKDIR /src/instrumentation/github.com/labstack/echo FROM base AS echo-server RUN go install ./example/server.go diff --git a/instrumentation/labstack/echo/example/README.md b/instrumentation/github.com/labstack/echo/example/README.md similarity index 100% rename from instrumentation/labstack/echo/example/README.md rename to instrumentation/github.com/labstack/echo/example/README.md diff --git a/instrumentation/labstack/echo/example/docker-compose.yml b/instrumentation/github.com/labstack/echo/example/docker-compose.yml similarity index 97% rename from instrumentation/labstack/echo/example/docker-compose.yml rename to instrumentation/github.com/labstack/echo/example/docker-compose.yml index 7a801892729..a8ed398d616 100644 --- a/instrumentation/labstack/echo/example/docker-compose.yml +++ b/instrumentation/github.com/labstack/echo/example/docker-compose.yml @@ -26,7 +26,7 @@ services: echo-server: build: dockerfile: $PWD/Dockerfile - context: ../../../.. + context: ../../../../.. ports: - "8080:80" command: diff --git a/instrumentation/labstack/echo/example/server.go b/instrumentation/github.com/labstack/echo/example/server.go similarity index 95% rename from instrumentation/labstack/echo/example/server.go rename to instrumentation/github.com/labstack/echo/example/server.go index 142fe577a34..6b5abab6be3 100644 --- a/instrumentation/labstack/echo/example/server.go +++ b/instrumentation/github.com/labstack/echo/example/server.go @@ -21,7 +21,7 @@ import ( "github.com/labstack/echo/v4" - echotrace "go.opentelemetry.io/contrib/instrumentation/labstack/echo" + echotrace "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo" otelglobal "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/kv" oteltrace "go.opentelemetry.io/otel/api/trace" diff --git a/instrumentation/labstack/echo/go.mod b/instrumentation/github.com/labstack/echo/go.mod similarity index 60% rename from instrumentation/labstack/echo/go.mod rename to instrumentation/github.com/labstack/echo/go.mod index d125d0af625..e124c3cab68 100644 --- a/instrumentation/labstack/echo/go.mod +++ b/instrumentation/github.com/labstack/echo/go.mod @@ -1,8 +1,8 @@ -module go.opentelemetry.io/contrib/instrumentation/labstack/echo +module go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo go 1.14 -replace go.opentelemetry.io/contrib => ../../.. +replace go.opentelemetry.io/contrib => ../../../.. require ( github.com/labstack/echo/v4 v4.1.16 diff --git a/instrumentation/labstack/echo/go.sum b/instrumentation/github.com/labstack/echo/go.sum similarity index 100% rename from instrumentation/labstack/echo/go.sum rename to instrumentation/github.com/labstack/echo/go.sum