Files
ocis/services/ocs/pkg/service/v0/tracing.go
Jörn Friedrich Dreyer 32cc9beb0b walk and log chi routes, ocs cleanup (#5428)
* walk and log chi routes, ocs cleanup

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* make linter happy

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-01-23 12:30:34 +01:00

24 lines
429 B
Go

package svc
import (
"net/http"
"github.com/owncloud/ocis/v2/ocis-pkg/middleware"
)
// NewTracing returns a service that instruments traces.
func NewTracing(next Service) Service {
return tracing{
next: next,
}
}
type tracing struct {
next Service
}
// ServeHTTP implements the Service interface.
func (t tracing) ServeHTTP(w http.ResponseWriter, r *http.Request) {
middleware.TraceContext(t.next).ServeHTTP(w, r)
}