Skip to content

Commit

Permalink
Add tracer as per AuthorizeRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
supercairos committed Nov 27, 2023
1 parent 5b41e88 commit 5f9b0b1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion device_authorize_request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ import (

"github.com/ory/fosite/i18n"
"github.com/ory/x/errorsx"
"github.com/ory/x/otelx"
"go.opentelemetry.io/otel/trace"
)

func (f *Fosite) NewDeviceAuthorizeRequest(ctx context.Context, r *http.Request) (DeviceAuthorizeRequester, error) {
func (f *Fosite) NewDeviceAuthorizeRequest(ctx context.Context, r *http.Request) (_ DeviceAuthorizeRequester, err error) {
ctx, span := trace.SpanFromContext(ctx).TracerProvider().Tracer("github.com/ory/fosite").Start(ctx, "Fosite.NewDeviceAuthorizeRequest")
defer otelx.End(span, &err)

return f.newDeviceAuthorizeRequest(ctx, r)
}

func (f *Fosite) newDeviceAuthorizeRequest(ctx context.Context, r *http.Request) (DeviceAuthorizeRequester, error) {
request := NewDeviceAuthorizeRequest()
request.Lang = i18n.GetLangFromRequest(f.Config.GetMessageCatalog(ctx), r)

Expand Down

0 comments on commit 5f9b0b1

Please sign in to comment.