outposts: add description to span

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-13 16:12:14 +01:00
parent 2fe88cfea9
commit 10b16bc36a
1 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package ak
import ( import (
"context" "context"
"fmt"
"net/http" "net/http"
"github.com/getsentry/sentry-go" "github.com/getsentry/sentry-go"
@ -19,6 +20,7 @@ func NewTracingTransport(ctx context.Context, inner http.RoundTripper) *tracingT
func (tt *tracingTransport) RoundTrip(r *http.Request) (*http.Response, error) { func (tt *tracingTransport) RoundTrip(r *http.Request) (*http.Response, error) {
span := sentry.StartSpan(tt.ctx, "authentik.go.http_request") span := sentry.StartSpan(tt.ctx, "authentik.go.http_request")
span.Description = fmt.Sprintf("%s %s", r.Method, r.URL.String())
span.SetTag("url", r.URL.String()) span.SetTag("url", r.URL.String())
span.SetTag("method", r.Method) span.SetTag("method", r.Method)
defer span.Finish() defer span.Finish()