Add open telemetry logging to Ibex Client - #59
Conversation
There was a problem hiding this comment.
any reason this is a function and not just an object?
There was a problem hiding this comment.
Yeah, I was trying to avoid doing this as well, but couldn't figure out to de-structure the class into the wrapAsyncFunctionsToRunInSpan function. If I remember correctly, I also tried to define it as an object, but couldn't figure that out either, so instead, I settled for this approach, which is similar to the how the rest of the code base is defined.
IMO, this would be good to revisit at some point. But for now, I'd rather merge what works than spend more time trying to perfect
|
overall looks good but changing the AuthenticatedIbexClient class to a function instead of an object seems unnecessarily complex, unless there''s a reason that I don't understand. |
Adds telemetry data to the Ibex client. This is done by wrapping the client with a call to
wrapAsyncFunctionsToRunInSpanwhich gets the current span and adds attributes and exceptions to it.Here's a sample trace in Honeycomb which shows an API call failing because the ibex accessToken & refreshToken are not present: