1
0
Fork 0
This commit is contained in:
Josh Soref 2022-02-21 06:40:09 -05:00 committed by GitHub
parent ce851a5929
commit 819de02101
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 51 additions and 51 deletions

View file

@ -10,12 +10,12 @@ import (
"github.com/traefik/traefik/v2/pkg/tracing"
)
// Tracable embeds tracing information.
type Tracable interface {
// Traceable embeds tracing information.
type Traceable interface {
GetTracingInformation() (name string, spanKind ext.SpanKindEnum)
}
// Wrap adds tracability to an alice.Constructor.
// Wrap adds traceability to an alice.Constructor.
func Wrap(ctx context.Context, constructor alice.Constructor) alice.Constructor {
return func(next http.Handler) (http.Handler, error) {
if constructor == nil {
@ -26,8 +26,8 @@ func Wrap(ctx context.Context, constructor alice.Constructor) alice.Constructor
return nil, err
}
if tracableHandler, ok := handler.(Tracable); ok {
name, spanKind := tracableHandler.GetTracingInformation()
if traceableHandler, ok := handler.(Traceable); ok {
name, spanKind := traceableHandler.GetTracingInformation()
log.FromContext(ctx).WithField(log.MiddlewareName, name).Debug("Adding tracing to middleware")
return NewWrapper(handler, name, spanKind), nil
}