Merge branch v2.10 into v3.0
This commit is contained in:
commit
eb585740a1
27 changed files with 530 additions and 428 deletions
|
@ -1,10 +1,14 @@
|
|||
package middleware
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/opentracing/opentracing-go/ext"
|
||||
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
||||
"github.com/traefik/traefik/v3/pkg/plugins"
|
||||
"github.com/traefik/traefik/v3/pkg/tracing"
|
||||
)
|
||||
|
||||
// PluginsBuilder the plugin's builder interface.
|
||||
|
@ -31,3 +35,25 @@ func findPluginConfig(rawConfig map[string]dynamic.PluginConf) (string, map[stri
|
|||
|
||||
return pluginType, rawPluginConfig, nil
|
||||
}
|
||||
|
||||
type traceablePlugin struct {
|
||||
name string
|
||||
h http.Handler
|
||||
}
|
||||
|
||||
func newTraceablePlugin(ctx context.Context, name string, plug plugins.Constructor, next http.Handler) (*traceablePlugin, error) {
|
||||
h, err := plug(ctx, next)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &traceablePlugin{name: name, h: h}, nil
|
||||
}
|
||||
|
||||
func (s *traceablePlugin) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||
s.h.ServeHTTP(rw, req)
|
||||
}
|
||||
|
||||
func (s *traceablePlugin) GetTracingInformation() (string, ext.SpanKindEnum) {
|
||||
return s.name, tracing.SpanKindNoneEnum
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue