From 28b9da028afc643af2d3dcc1779885e8370cc0aa Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 6 Mar 2020 16:27:48 +0100 Subject: [PATCH] add traces to konnectd index handler --- pkg/service/v0/service.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index e9c7b789a..9c245e6ed 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -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) }) - }