okta / okta-sdk-golang

A Golang SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
https://github.com/okta/okta-sdk-golang
Other
171 stars 142 forks source link

Add open telemetry tracing to the SDK #431

Open craigpastro opened 4 months ago

craigpastro commented 4 months ago

Describe the feature request?

In order to get more visibility into the request lifecycle it would be nice if there were traces, at least at the top-level methods. We make a lot of requests using this SDK and currently use a TracingClientWrapper, but it would be nice if tracing were built-in.

New or Affected Resource(s)

Most, if not all, resources.

Provide a documentation link

No response

Additional Information?

Ideally, this would just involve adding a couple of lines to top-level methods. For example, add

var tracer = otel.Tracer("github.com/okta/okta-sdk-golang/okta")

to okta/okta.go and then, e.g., in okta/user.go the use of this tracer would look something like:

... stuff

func (m *UserResource) CreateUser(ctx context.Context, body CreateUserRequest, qp *query.Params) (*User, *Response, error) {
    ctx, span := tracer.Start(ctx, "CreateUser")
    defer span.End()
    ...
}

... rest of stuff

I'm happy to create a PR if you think this is something that you wish to add.

Thank you!

github-actions[bot] commented 4 months ago

This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale label.