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(v8): Update node docs for v8 #9906

Merged
merged 24 commits into from May 13, 2024
Merged

feat(v8): Update node docs for v8 #9906

merged 24 commits into from May 13, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented May 3, 2024

This is a draft until v8 is released!

@mydea mydea requested review from stephanie-anderson, lforst, Lms24, s1gr1d and a team May 3, 2024 07:56
@mydea mydea self-assigned this May 3, 2024
Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 3:43pm

Copy link

codecov bot commented May 3, 2024

Bundle Report

Changes will decrease total bundle size by 1.24kB ⬇️

Bundle name Size Change
sentry-docs-server 7.43MB 1.23kB ⬇️
sentry-docs-edge-server 458.51kB 3 bytes ⬇️
sentry-docs-client 6.16MB 6 bytes ⬇️

Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

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

Thanks for updating 🙌🏻

includes/node-automatic-instrumentation.mdx Outdated Show resolved Hide resolved
includes/node-automatic-instrumentation.mdx Outdated Show resolved Hide resolved
includes/node-esm-compatibility.mdx Outdated Show resolved Hide resolved
@timfish
Copy link
Contributor

timfish commented May 3, 2024

I think the Configure metrics section can now be removed from all SDKs since it's automatically configured when you first call the functions.

For example, there's no need for this section anymore:
https://sentry-docs-git-v8-docs.sentry.dev/platforms/javascript/guides/node/metrics/#configure-metrics

I can submit a separate PR for this?

Copy link
Contributor

@vivianyentran vivianyentran left a comment

Choose a reason for hiding this comment

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

Added some copyedits to the content changes

docs/platforms/javascript/guides/connect/index.mdx Outdated Show resolved Hide resolved
docs/platforms/javascript/guides/koa/performance/index.mdx Outdated Show resolved Hide resolved
docs/platforms/javascript/guides/node/index.mdx Outdated Show resolved Hide resolved
includes/node-automatic-instrumentation.mdx Outdated Show resolved Hide resolved
@s1gr1d
Copy link
Member

s1gr1d commented May 6, 2024

The docs for serverless are in those commits:

@mydea
Copy link
Member Author

mydea commented May 6, 2024

I think the Configure metrics section can now be removed from all SDKs since it's automatically configured when you first call the functions.

For example, there's no need for this section anymore: https://sentry-docs-git-v8-docs.sentry.dev/platforms/javascript/guides/node/metrics/#configure-metrics

I can submit a separate PR for this?

Yes please, that makes sense!

HazAT
HazAT previously requested changes May 6, 2024
Copy link
Member

@HazAT HazAT left a comment

Choose a reason for hiding this comment

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

https://github.com/getsentry/sentry-docs/pull/9906/files#diff-b7e7956822e5458c8c74398728fc9e7fdbd160778dc5860580534facf60db755R18-R20
Isn't this wrong?

The error handler always needs to be last, doing a quick local repro confirms this, you need to have all your routes BEFORE you add the error handler

// http and other libraries are only instrumented
// if imported _after_ Sentry has been initialized
import http from "http";
```
Copy link
Contributor

@timfish timfish May 10, 2024

Choose a reason for hiding this comment

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

If node is running ESM source, ie. you're not transpiling the above to CJS, the import ordering makes zero difference. import http from "http" is evaluated and loaded before any code in instrument.js is even executed and libraries will not be instrumented without using the loader detailed later.

When you are using the loader, import-in-the-middle wraps everything in proxies to work around the whole "imports evaluated first" problem.

import-in-the-middle is an module loading interceptor inspired by require-in-the-middle, but specifically for ESM modules. In fact, it can even modify modules after loading time.

Of course, users might be transpiling to CJS, even without their knowledge so maybe it's still important to keep the ordering, but then the loader below will not be required anyway!

Copy link
Member

Choose a reason for hiding this comment

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

Good point. I would err on keeping it as-is for the reason you outlined with transpilation to CJS. Maybe this "accidentally" makes it work for people, but I will let the team decide on monday.

@mydea
Copy link
Member Author

mydea commented May 13, 2024

Updated the PR to show require on top as default installation method, plus added the "Installation Methods" section to node guides showing ESM docs, including when to use which. cc @smeubank

mydea and others added 18 commits May 13, 2024 16:35
Co-authored-by: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com>
Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com>
Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com>
Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
Co-authored-by: Stephanie Anderson <stephanie.anderson@sentry.io>
Copy link
Member

@andreiborza andreiborza left a comment

Choose a reason for hiding this comment

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

LGTM

@mydea mydea marked this pull request as ready for review May 13, 2024 15:42
@mydea mydea enabled auto-merge (squash) May 13, 2024 15:42
@mydea mydea merged commit 003be48 into master May 13, 2024
5 checks passed
@mydea mydea deleted the v8-docs branch May 13, 2024 15:43
antonpirker pushed a commit that referenced this pull request May 14, 2024
---------

Co-authored-by: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com>
Co-authored-by: s1gr1d <sigrid.huemer@posteo.at>
Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com>
Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com>
Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
Co-authored-by: Stephanie Anderson <stephanie.anderson@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants