add traces to konnectd index handler

This commit is contained in:
A.Unger
2020-03-06 16:27:48 +01:00
committed by Ilja Neumann
parent 36502678b4
commit 28b9da028a

View File

@@ -15,6 +15,7 @@ import (
logw "github.com/owncloud/ocis-konnectd/pkg/log"
"github.com/owncloud/ocis-konnectd/pkg/middleware"
"github.com/owncloud/ocis-pkg/v2/log"
"go.opencensus.io/trace"
"stash.kopano.io/kc/konnect/bootstrap"
kcconfig "stash.kopano.io/kc/konnect/config"
"stash.kopano.io/kc/konnect/server"
@@ -219,8 +220,12 @@ func (k Konnectd) Index() http.HandlerFunc {
indexHTML = bytes.Replace(indexHTML, []byte("__CSP_NONCE__"), []byte(nonce), 1)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if k.config.Tracing.Enabled {
_, span := trace.StartSpan(r.Context(), "/identifier/index.html")
defer span.End()
}
w.WriteHeader(http.StatusOK)
w.Write(indexHTML)
})
}