move tracer to client,

add tracing in rs, client
This commit is contained in:
adlerhurst 2024-03-13 15:45:03 +01:00
parent 0fe7c3307f
commit 1b94f796eb
8 changed files with 59 additions and 37 deletions

View file

@ -123,6 +123,9 @@ func WithStaticEndpoints(tokenURL, introspectURL string) Option {
//
// [RFC7662]: https://www.rfc-editor.org/rfc/rfc7662
func Introspect[R any](ctx context.Context, rp ResourceServer, token string) (resp R, err error) {
ctx, span := client.Tracer.Start(ctx, "Introspect")
defer span.End()
if rp.IntrospectionURL() == "" {
return resp, errors.New("resource server: introspection URL is empty")
}