Add tracing for hub invocations in JS client

#2754