Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fox to v0.18.0 #7

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions foxtrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Tracer struct {
cfg *config
}

// New creates a new Tracer middleware for the given service.
// New creates a new [Tracer] middleware for the given service.
// Options can be provided to configure the tracer.
func New(service string, opts ...Option) *Tracer {
cfg := defaultConfig()
Expand All @@ -35,7 +35,7 @@ func New(service string, opts ...Option) *Tracer {
}
}

// Middleware is a convenience function that creates a new Tracer middleware instance
// Middleware is a convenience function that creates a new [Tracer] middleware instance
// for the specified service and returns the Trace middleware function.
// Options can be provided to configure the tracer.
func Middleware(service string, opts ...Option) fox.MiddlewareFunc {
Expand Down Expand Up @@ -77,7 +77,7 @@ func (t *Tracer) Trace(next fox.HandlerFunc) fox.HandlerFunc {

var spanName string
if t.cfg.spanFmt == nil {
spanName = c.Path()
spanName = c.Pattern()
} else {
spanName = t.cfg.spanFmt(c)
}
Expand Down
2 changes: 1 addition & 1 deletion foxtrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestWithSpanAttributes(t *testing.T) {
span := trace.SpanFromContext(c.Request().Context())
assert.Equal(t, sc.TraceID(), span.SpanContext().TraceID())
assert.Equal(t, sc.SpanID(), span.SpanContext().SpanID())
}), fox.WithAnnotation("foo", "bar"))
}), fox.WithAnnotations(fox.Annotation{Key: "foo", Value: "bar"}))

require.NoError(t, err)
router.ServeHTTP(w, r)
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.23
go 1.23.0

require (
github.com/stretchr/testify v1.9.0
github.com/tigerwill90/fox v0.17.1
go.opentelemetry.io/contrib/propagators/b3 v1.31.0
go.opentelemetry.io/otel v1.31.0
go.opentelemetry.io/otel/trace v1.31.0
github.com/tigerwill90/fox v0.18.0
go.opentelemetry.io/contrib/propagators/b3 v1.32.0
go.opentelemetry.io/otel v1.32.0
go.opentelemetry.io/otel/trace v1.32.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.31.0 // indirect
golang.org/x/sys v0.26.0 // indirect
go.opentelemetry.io/otel/metric v1.32.0 // indirect
golang.org/x/sys v0.27.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.17.1 h1:kH7NdRbEKb/8UuS1tbFGOnxlRLcEFj0Zq1mdjjCNJAM=
github.com/tigerwill90/fox v0.17.1/go.mod h1:ujscTs1DtEAaU/wrPKB7dw65yQiXTIFVJJiNTSFZgBs=
go.opentelemetry.io/contrib/propagators/b3 v1.31.0 h1:PQPXYscmwbCp76QDvO4hMngF2j8Bx/OTV86laEl8uqo=
go.opentelemetry.io/contrib/propagators/b3 v1.31.0/go.mod h1:jbqfV8wDdqSDrAYxVpXQnpM0XFMq2FtDesblJ7blOwQ=
go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY=
go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE=
go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE=
go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY=
go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys=
go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
github.com/tigerwill90/fox v0.18.0 h1:2Hqxe9p2hN7qu8QOEfMEHbCdXe6R3TX9vYA9hpaQ5VM=
github.com/tigerwill90/fox v0.18.0/go.mod h1:njvaFTnPHMXIGKqnQn2Y5YiE7GWzukAAxQJEcb/9KBM=
go.opentelemetry.io/contrib/propagators/b3 v1.32.0 h1:MazJBz2Zf6HTN/nK/s3Ru1qme+VhWU5hm83QxEP+dvw=
go.opentelemetry.io/contrib/propagators/b3 v1.32.0/go.mod h1:B0s70QHYPrJwPOwD1o3V/R8vETNOG9N3qZf4LDYvA30=
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.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
4 changes: 2 additions & 2 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type SpanNameFormatter func(c fox.Context) string

// SpanAttributesFunc is a function type that can be used to dynamically
// generate span attributes for a given HTTP request. It is used in
// conjunction with the WithSpanAttributes middleware option.
// conjunction with the [WithSpanAttributes] middleware option.
type SpanAttributesFunc func(c fox.Context) []attribute.KeyValue

type config struct {
Expand Down Expand Up @@ -73,7 +73,7 @@ func WithTracerProvider(provider trace.TracerProvider) Option {
}

// WithTextMapCarrier specify a carrier to use for extracting information from http request.
// If none is specified, propagation.HeaderCarrier is used.
// If none is specified, [propagation.HeaderCarrier] is used.
func WithTextMapCarrier(fn func(r *http.Request) propagation.TextMapCarrier) Option {
return optionFunc(func(c *config) {
if fn != nil {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package otelfox

import "fmt"

const version = "v0.17.1"
const version = "v0.18.0"

var semver = fmt.Sprintf("semver:%s", version)

Expand Down
Loading