-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Code Origins Doc - Fixed broken image and added Typescript enable source map instructions #29163
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
base: master
Are you sure you want to change the base?
Conversation
… source map enablement
@@ -64,6 +64,11 @@ Run your service with the following environment variable: | |||
export DD_CODE_ORIGIN_FOR_SPANS_ENABLED=true | |||
``` | |||
|
|||
<div class="alert alert-info"> | |||
For TypeScript applications, run your Node.js application with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@watson This was basically copy/pasted from the SCI docs page, but would you mind double-checking that this instruction looks correct and doesn't require any extra steps or context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking at bit closer at our current Code Origin docs, I can see that we link to the SCI docs (which also describes this flag) from the Prerequisites section.
Ideally we don't need to duplicate any information from the SCI docs on our own page when we already link to it? What do you think?
(btw, the text says linking to the SCI page says that SCI is "recommended" for code previews, I think it should say that it's "required")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind duplicating it here, since we know people are bad at reading docs - and the majority of people who will navigate to this page initially will be Node.js users, so we may as well hold their hand a bit!
Good catch on the "recommended for code previews"! Ill update it in my next commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we duplicate this information, I think we need to:
- Either duplicate both the information about
--enable-source-maps
, but also the fact that the user needs to set theDD_GIT_*
environment variables (this quickly becomes verbose though). - Or at least change the text in this callout to reflect that it's not the only thing the user needs to do.
Right now it says that you need to set --enable-source-maps
to see code previews without mentioning that you also need to set the DD_GIT_*
environment variables.
Another thing (and I can't make up my mind about this) is that we say this is for TypeScript apps. Whereas in reality it's for all apps that does any sort of transpiling - TypeScript just being the most common situation where this is needed. However, the section quickly becomes complex if you add all sorts of conditions to it. So we might be better off not mentioning it 🤷
Here's my best attempt:
For transpiled applications, such as TypeScript, it's important to generate and publish source maps with the deployed application, and to run Node.js with the
--enable-source-maps
flag. Otherwise code previews will not work correctly.For more information, see the Source Code Integration documentation for Node.js.
Note that I've changed the link Node.js docs to point to the latest docs.
(Writing this, I realized that the SCI docs doesn't mention to publish the source maps with the deployed application. It should do that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this is merged, I have a PR ready to move the language specific instructions into individual tabs so that we can start to diverge the instructions. This only becomes more important in the future as we add support for new frameworks, which each will require a different tracer version (documenting these details becomes very verbose if all languages share the same table)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@watson Let me know what you think of my latest changes!
Preview links (active after the
|
@@ -64,6 +64,11 @@ Run your service with the following environment variable: | |||
export DD_CODE_ORIGIN_FOR_SPANS_ENABLED=true | |||
``` | |||
|
|||
<div class="alert alert-info"> | |||
For TypeScript applications, run your Node.js application with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we duplicate this information, I think we need to:
- Either duplicate both the information about
--enable-source-maps
, but also the fact that the user needs to set theDD_GIT_*
environment variables (this quickly becomes verbose though). - Or at least change the text in this callout to reflect that it's not the only thing the user needs to do.
Right now it says that you need to set --enable-source-maps
to see code previews without mentioning that you also need to set the DD_GIT_*
environment variables.
Another thing (and I can't make up my mind about this) is that we say this is for TypeScript apps. Whereas in reality it's for all apps that does any sort of transpiling - TypeScript just being the most common situation where this is needed. However, the section quickly becomes complex if you add all sorts of conditions to it. So we might be better off not mentioning it 🤷
Here's my best attempt:
For transpiled applications, such as TypeScript, it's important to generate and publish source maps with the deployed application, and to run Node.js with the
--enable-source-maps
flag. Otherwise code previews will not work correctly.For more information, see the Source Code Integration documentation for Node.js.
Note that I've changed the link Node.js docs to point to the latest docs.
(Writing this, I realized that the SCI docs doesn't mention to publish the source maps with the deployed application. It should do that)
…on, and added Live Debugger actions
Co-authored-by: Ursula Chen <58821586+urseberry@users.noreply.github.com>
@@ -64,19 +66,33 @@ Run your service with the following environment variable: | |||
export DD_CODE_ORIGIN_FOR_SPANS_ENABLED=true | |||
``` | |||
|
|||
<div class="alert alert-info"> | |||
For transpiled Node.js applications (for example, Typescript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the <a href="https://nodejs.org/dist/v12.22.12/docs/api/cli.html#cli_enable_source_maps"><code>--enable-source-maps</code></a> flag. Otherwise, code previews do not work. See the Node.js <a href="/integrations/guide/source-code-integration/?tab=nodejs#setup">Source Code Integration</a> documentation for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure using numbered links doesn't work inside this div
? If it does, we should just write the content like so:
For transpiled Node.js applications (for example, Typescript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the <a href="https://nodejs.org/dist/v12.22.12/docs/api/cli.html#cli_enable_source_maps"><code>--enable-source-maps</code></a> flag. Otherwise, code previews do not work. See the Node.js <a href="/integrations/guide/source-code-integration/?tab=nodejs#setup">Source Code Integration</a> documentation for more details. | |
For transpiled Node.js applications (for example, TypeScript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the [`--enable-source-maps`][10] flag. Otherwise, code previews do not work. See the Node.js [Source Code Integration][9] documentation for more details. |
Otherwise, just make these changes:
For transpiled Node.js applications (for example, Typescript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the <a href="https://nodejs.org/dist/v12.22.12/docs/api/cli.html#cli_enable_source_maps"><code>--enable-source-maps</code></a> flag. Otherwise, code previews do not work. See the Node.js <a href="/integrations/guide/source-code-integration/?tab=nodejs#setup">Source Code Integration</a> documentation for more details. | |
For transpiled Node.js applications (for example, TypeScript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the <a href="https://nodejs.org/docs/latest/api/cli.html#--enable-source-maps"><code>--enable-source-maps</code></a> flag. Otherwise, code previews do not work. See the Node.js <a href="/integrations/guide/source-code-integration/?tab=nodejs#setup">Source Code Integration</a> documentation for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 from the docs team. Numbered links don't work within divs, so yes, you do have to use HTML links as above.
|
||
- To search for all spans that include Code Origins, use the query `@_dd.code_origin.type:*` in the [APM Trace Explorer][1]. | ||
|
||
### Code preview is not visible ### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Code preview is not visible ### | |
### Code preview is not visible ### | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the trailing "#" from this line also.
|
||
### Code preview is not visible ### | ||
- Ensure that all [Source Code Integration][7] setup requirements are met. | ||
- For transpiled Node.js applications (for example, Typescript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the [`--enable-source-maps`][10] flag. Otherwise, code previews do not work. See the Node.js [Source Code Integration][9] documentation for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- For transpiled Node.js applications (for example, Typescript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the [`--enable-source-maps`][10] flag. Otherwise, code previews do not work. See the Node.js [Source Code Integration][9] documentation for more details. | |
- For transpiled Node.js applications (for example, TypeScript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the [`--enable-source-maps`][10] flag. Otherwise, code previews do not work. See the Node.js [Source Code Integration][9] documentation for more details. |
@@ -110,3 +133,7 @@ If Code Origin information is missing: | |||
[6]: /tracing/trace_collection/ | |||
[7]: /integrations/guide/source-code-integration/ | |||
[8]: /tracing/trace_collection/compatibility/nodejs#web-framework-compatibility | |||
[9]: /integrations/guide/source-code-integration/?tab=nodejs#setup | |||
[10]: https://nodejs.org/dist/v12.22.12/docs/api/cli.html#cli_enable_source_maps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[10]: https://nodejs.org/dist/v12.22.12/docs/api/cli.html#cli_enable_source_maps | |
[10]: https://nodejs.org/docs/latest/api/cli.html#--enable-source-maps |
@@ -64,19 +66,33 @@ Run your service with the following environment variable: | |||
export DD_CODE_ORIGIN_FOR_SPANS_ENABLED=true | |||
``` | |||
|
|||
<div class="alert alert-info"> | |||
For transpiled Node.js applications (for example, Typescript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the <a href="https://nodejs.org/dist/v12.22.12/docs/api/cli.html#cli_enable_source_maps"><code>--enable-source-maps</code></a> flag. Otherwise, code previews do not work. See the Node.js <a href="/integrations/guide/source-code-integration/?tab=nodejs#setup">Source Code Integration</a> documentation for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 from the docs team. Numbered links don't work within divs, so yes, you do have to use HTML links as above.
@@ -89,13 +105,20 @@ export DD_CODE_ORIGIN_FOR_SPANS_ENABLED=true | |||
|
|||
## Troubleshooting | |||
|
|||
If Code Origin information is missing: | |||
### Code Origin section is missing ### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Code Origin section is missing ### | |
### Code Origin section is missing |
|
||
- To search for all spans that include Code Origins, use the query `@_dd.code_origin.type:*` in the [APM Trace Explorer][1]. | ||
|
||
### Code preview is not visible ### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the trailing "#" from this line also.
… source map enablement
What does this PR do? What is the motivation?
Merge instructions
Merge readiness:
For Datadog employees:
Merge queue is enabled in this repo. Your branch name MUST follow the
<name>/<description>
convention and include the forward slash (/
). Without this format, your pull request will not pass in CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.If your branch doesn't follow this format, rename it or create a new branch and PR.
To have your PR automatically merged after it receives the required reviews, add the following PR comment:
Additional notes