launchdarkly / js-client-sdk

LaunchDarkly Client-side SDK for Browser JavaScript
Other
113 stars 66 forks source link

Add opentelemetry tracing to server calls #281

Open patkujawa-wf opened 1 year ago

patkujawa-wf commented 1 year ago

Is your feature request related to a problem? Please describe. We use the https://github.com/launchdarkly/ld-relay and https://github.com/launchdarkly/js-client-sdk (wrapped in Dart interop APIs) and would like to get a sense of how long server requests take, from a client perspective. Since those requests originate in the JS code, we can't easily instrument them ourselves.

Describe the solution you'd like Since https://opentelemetry.io/ is the de facto standard for tracing, it would be great if the JS SDK used its API to instrument the server calls made and provided a hook for us to pass in a tracer provider from the otel SDK.

Describe alternatives you've considered Capturing network requests (e.g. via service workers) and instrumenting there.

Additional context Happy to consider alternatives, or maybe there's something I'm missing that already provides this info?

louis-launchdarkly commented 1 year ago

Hello @patkujawa-wf, thank you for reaching out for this feature request. While we can't promise a resolution or answer yet, I will bring this up with the team and discuss it.

Just curious, in particular, are you interested in the init/identify performance, the variation call performance, or both?

Filed internally as 202351.

patkujawa-wf commented 1 year ago

We're interested in any calls that are slow, including those for sending analytics/events, as those have led to surprising incidents for us in the past when LD had a partial outage. So really any network request. Thanks!