Skip to content

Commit

Permalink
feat(deps): update fox to v0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerwill90 committed Oct 9, 2024
1 parent 876ef08 commit a69991d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
7 changes: 4 additions & 3 deletions foxtrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ func (t *Tracer) Trace(next fox.HandlerFunc) fox.HandlerFunc {
ctx, span := t.tracer.Start(ctx, spanName, opts...)
defer span.End()

c.SetRequest(req.WithContext(ctx))
cc := c.CloneWith(c.Writer(), req.WithContext(ctx))
defer cc.Close()

next(c)
next(cc)

status := c.Writer().Status()
status := cc.Writer().Status()
span.SetStatus(httpconv.ServerStatus(status))
if status > 0 {
span.SetAttributes(semconv.HTTPStatusCode(status))
Expand Down
2 changes: 1 addition & 1 deletion foxtrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestPropagationWithCustomPropagators(t *testing.T) {

router := fox.New()
mw := New("foobar", WithTracerProvider(provider), WithPropagators(b3))
err := router.Handle(http.MethodGet, "/user/:id", mw.Trace(func(c fox.Context) {
err := router.Handle(http.MethodGet, "/user/{id}", mw.Trace(func(c fox.Context) {
span := trace.SpanFromContext(c.Request().Context())
assert.Equal(t, sc.TraceID(), span.SpanContext().TraceID())
assert.Equal(t, sc.SpanID(), span.SpanContext().SpanID())
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/tigerwill90/otelfox

go 1.21
go 1.23

require (
github.com/stretchr/testify v1.9.0
github.com/tigerwill90/fox v0.15.0
go.opentelemetry.io/contrib/propagators/b3 v1.28.0
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/trace v1.28.0
github.com/tigerwill90/fox v0.16.0
go.opentelemetry.io/contrib/propagators/b3 v1.30.0
go.opentelemetry.io/otel v1.30.0
go.opentelemetry.io/otel/trace v1.30.0
)

require (
Expand All @@ -16,7 +16,7 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
golang.org/x/sys v0.22.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUA
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tigerwill90/fox v0.15.0 h1:ff4cxNrnCHvXPagkVUOSBDsJeibWQgM8k98VBPxGX88=
github.com/tigerwill90/fox v0.15.0/go.mod h1:1D355//lMLlduFSNb1fS+w+TK9svw/sjhH/h9tAD4KQ=
go.opentelemetry.io/contrib/propagators/b3 v1.28.0 h1:XR6CFQrQ/ttAYmTBX2loUEFGdk1h17pxYI8828dk/1Y=
go.opentelemetry.io/contrib/propagators/b3 v1.28.0/go.mod h1:DWRkzJONLquRz7OJPh2rRbZ7MugQj62rk7g6HRnEqh0=
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
github.com/tigerwill90/fox v0.16.0 h1:p/1xOID3MTw8rtVMxw+Ji/ogMhACh6tQQg9H5JlNCVM=
github.com/tigerwill90/fox v0.16.0/go.mod h1:ujscTs1DtEAaU/wrPKB7dw65yQiXTIFVJJiNTSFZgBs=
go.opentelemetry.io/contrib/propagators/b3 v1.30.0 h1:vumy4r1KMyaoQRltX7cJ37p3nluzALX9nugCjNNefuY=
go.opentelemetry.io/contrib/propagators/b3 v1.30.0/go.mod h1:fRbvRsaeVZ82LIl3u0rIvusIel2UUf+JcaaIpy5taho=
go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts=
go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc=
go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w=
go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ=
go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc=
go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down

0 comments on commit a69991d

Please sign in to comment.