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

Web SDK

Open martinkuba opened this issue 1 year ago • 5 comments

Related issue https://github.com/open-telemetry/opentelemetry-js/issues/4702

Short description of the changes

This introduces a Web SDK, similar to the Node SDK package. This should simplify installation and configuration for users. Currently, it includes only tracing, but in the future it will include event/log SDK as well.

I have also included the SessionId span processor, which adds the session.id attribute to all spans. This is similar to what the Android SDK has already implemented. In the future there will likely be other processors added here for additional attributes such as the page URL, visitor ID etc.

Type of change

  • [x] New feature (non-breaking change which adds functionality)

Checklist:

  • [x] Followed the style guidelines of this project
  • [x] Unit tests have been added
  • [x] Documentation has been updated

martinkuba avatar Nov 28 '23 01:11 martinkuba

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.62%. Comparing base (ecc88a3) to head (8074d25). Report is 45 commits behind head on main.

:exclamation: Current head 8074d25 differs from pull request most recent head d2eabdd

Please upload reports for the commit d2eabdd to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4325      +/-   ##
==========================================
+ Coverage   91.04%   92.62%   +1.58%     
==========================================
  Files          89      296     +207     
  Lines        1954     8300    +6346     
  Branches      416     1717    +1301     
==========================================
+ Hits         1779     7688    +5909     
- Misses        175      612     +437     

see 264 files with indirect coverage changes

codecov[bot] avatar Nov 28 '23 01:11 codecov[bot]

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Apr 15 '24 06:04 github-actions[bot]

@pichlermarc @martinkuba

I'm still kind of torn on whether the package would improve the situation. The way I understand this package is that it is intended as a quick start, but I am very confident that this package will be used in production and may soon start to be considered "the only way" to set up the SDK, effectively hiding the fact that components can be set up manually too.

I think we should add some kind of guide of what is allowed in here and what we don't want to add, with reasoning as to why this is.

I think the above 2 arguments are effective when taken together. A quick start package will be very helpful for a majority of cases, but at the same time it is fine to be highly opinionated about what goes into it since it affects the majority and redirect enhancement requests on the web-sdk to manual setup.

scheler avatar Jun 25 '24 17:06 scheler

Thank you everyone for your comments. I have moved this back to draft, as it is not clear that this is necessarily the right direction. I have summarized the current state in this doc. My plan is to continue working on a design and prototyping with others in the Client Instrumentation SIG. I will re-open this PR (or a new one) once it is more clear what path we want to pursue.

martinkuba avatar Jul 09 '24 17:07 martinkuba