Skip to content

Commit c4885aa

Browse files
refactor(example): move example to make it a testable example
Signed-off-by: Noé Tarbouriech <[email protected]>
1 parent 2a6af7d commit c4885aa

File tree

8 files changed

+17
-132
lines changed

8 files changed

+17
-132
lines changed

instrumentation/github.com/gorilla/mux/otelmux/example/Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

instrumentation/github.com/gorilla/mux/otelmux/example/README.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

instrumentation/github.com/gorilla/mux/otelmux/example/docker-compose.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

instrumentation/github.com/gorilla/mux/otelmux/example/go.mod

Lines changed: 0 additions & 24 deletions
This file was deleted.

instrumentation/github.com/gorilla/mux/otelmux/example/go.sum

Lines changed: 0 additions & 37 deletions
This file was deleted.

instrumentation/github.com/gorilla/mux/otelmux/example/server.go renamed to instrumentation/github.com/gorilla/mux/otelmux/example_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// Copyright The OpenTelemetry Authors
2-
// SPDX-License-Identifier: Apache-2.0
3-
4-
// Example exemplifies the otelmux package.
5-
package main
1+
package otelmux_test
62

73
import (
84
"context"
@@ -23,7 +19,7 @@ import (
2319

2420
var tracer = otel.Tracer("mux-server")
2521

26-
func main() {
22+
func Example() {
2723
tp, err := initTracer()
2824
if err != nil {
2925
log.Fatal(err)

instrumentation/github.com/gorilla/mux/otelmux/go.mod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ require (
1111
go.opentelemetry.io/otel/trace v1.35.0
1212
)
1313

14+
require (
15+
github.com/google/uuid v1.6.0 // indirect
16+
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
17+
golang.org/x/sys v0.30.0 // indirect
18+
)
19+
1420
require (
1521
github.com/davecgh/go-spew v1.1.1 // indirect
1622
github.com/go-logr/logr v1.4.2 // indirect
1723
github.com/go-logr/stdr v1.2.2 // indirect
1824
github.com/pmezard/go-difflib v1.0.0 // indirect
1925
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
26+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0
2027
gopkg.in/yaml.v3 v3.0.1 // indirect
2128
)

instrumentation/github.com/gorilla/mux/otelmux/go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
99
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
1010
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
1111
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
12+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
13+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
1214
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
1315
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
1416
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
@@ -25,10 +27,16 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS
2527
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
2628
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
2729
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
30+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0 h1:T0Ec2E+3YZf5bgTNQVet8iTDW7oIk03tXHq+wkwIDnE=
31+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0/go.mod h1:30v2gqH+vYGJsesLWFov8u47EpYTcIQcBjKpI6pJThg=
2832
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
2933
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
34+
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
35+
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
3036
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
3137
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
38+
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
39+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
3240
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3341
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
3442
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

0 commit comments

Comments
 (0)