opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

Add Web SDK package

Open martinkuba opened this issue 1 year ago • 0 comments

We currently have Node SDK, which bundles together packages that are relevant to instrumenting Node applications. It also provides a simplified configuration that makes it easier for users to get started.

I propose that we introduce a Web SDK package that provides the same benefits for web applications - to make it easier for users to get started quickly with web instrumentation. It would include the following:

  • simplified configuration for WebTracerProvider
  • simplified configuration for EventLoggerProvider
  • start/shutdown methods
  • automatically run resource detectors

In addition, I think the following could also be the Web SDK's responsibility, but I think more discussion is needed:

  • resource detectors relevant to web applications (e.g. browser detector)
    • The Node SDK does not include any detectors automatically, but arguably the browser detector should always be included
  • automatically setup default exporters
    • In browsers, the HTTP JSON exporters make most sense
  • processors for attaching session.id on spans and events
    • This could be a separate package, but initially could live in this package
  • mechanism for configuring session management (e.g. persisting across page loads, expiration)

martinkuba avatar May 13 '24 23:05 martinkuba