Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ Pull in base OTel WebSDK #3

Merged
merged 4 commits into from
Dec 4, 2023
Merged

feat: ✨ Pull in base OTel WebSDK #3

merged 4 commits into from
Dec 4, 2023

Conversation

pkanal
Copy link
Contributor

@pkanal pkanal commented Dec 4, 2023

Which problem is this PR solving?

This PR pulls in the code that will eventually become the OpenTelemetry WebSDK. For now we're using all the code from the draft PR that is up so it is subject to change, we're not worried about it changing too much because it is very similar to the NodeSDK which is a released package.

The main new piece of this SDK is the SpanIdSpanProcessor, I have chosen to leave this component out for now because it is pretty unstable and undefined and still depends on Buffer which is a Node-only API. We can pull this in as it becomes more stable as it will be an additive change. Nevermind, I figured out how to make it browser friendly because there was prior art in upstream OTel for this with trace and span IDs, this is likely what it will look like so I feel comfortable pulling it in for now.

Short description of the changes

  • Pull in WebSDK code and types
  • The distro will emit session.id 🎉
  • Update example to use the WebSDK
  • Update example to emit traces

How to verify that this has the expected result

  1. Build the project, in the root directory run: npm run build
  2. Change directories to the example app: cd examples/hello-world-web
  3. Build the example app: npm run build
  4. Run the example app: npm start
  5. Go to http://localhost:3000 in the browser
  6. Open the console tab, you should see OTel debug messages as well as document load traces logged to the console.

@pkanal pkanal added the type: enhancement New feature or request label Dec 4, 2023
@pkanal pkanal self-assigned this Dec 4, 2023
@pkanal pkanal requested review from a team as code owners December 4, 2023 16:35
@pkanal pkanal requested a review from a team December 4, 2023 16:35
Copy link
Contributor

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@pkanal
Copy link
Contributor Author

pkanal commented Dec 4, 2023

@MikeGoldsmith it is probably worth taking another look since I added in session.id stuff!

@pkanal pkanal merged commit 4ee4160 into main Dec 4, 2023
@pkanal pkanal deleted the purvi/add-otel-websdk branch December 4, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants