-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Create new Code Origins doc page #28056
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
Merged
Merged
Changes from 18 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
3d39d4b
Create new Code Origins doc page
sstonehill12 d28d0c7
Update Code Origins guide and add images
sstonehill12 145bb7e
Update doc content
sstonehill12 62338cb
Update troubleshooting section
sstonehill12 e8b4b52
Fixed some automated styling comments
sstonehill12 e087ff8
Update content/en/tracing/guide/code_origins.md
sstonehill12 7f80b92
Update overview content
sstonehill12 fcb467c
Update prerequisites section
sstonehill12 871b176
Update enable section
sstonehill12 c6fb954
Update troubleshooting section
sstonehill12 b914636
Removed tracing library specific instructions, kept env variable inst…
sstonehill12 f7ea517
Merge branch 'master' into sarah.stonehill/code-origin-new-doc
sstonehill12 cb96295
Add Code Origins guide to Tracing Guides index page
sstonehill12 f68373e
Apply suggestions from code review
sstonehill12 5422ca0
Clarified no billing impact "while in Preview" and added Live Debugge…
sstonehill12 1766d6e
Merge branch 'master' into sarah.stonehill/code-origin-new-doc
sstonehill12 b0abde6
Added preview callout, removed node.js exit span support, and other m…
sstonehill12 ea176d0
Added back support for exit spans, added .NET to supported runtimes
sstonehill12 3aaa871
Add Code Origins page to left hand nav menu
sstonehill12 23cf6d5
Apply most suggestions from code review
sstonehill12 99afcc5
Updated images and a couple of other minor edits
sstonehill12 03f062b
Minor wording change to entry and exit span code origin types
sstonehill12 858d20a
Apply suggestions from code review
sstonehill12 a7a7d7d
Image changes and minor change to pricing impact section
sstonehill12 c669ab1
Merge branch 'master' into sarah.stonehill/code-origin-new-doc
sstonehill12 efe26e0
Apply suggestions from code review
sstonehill12 935e096
Removed all exit span references, removed How it works and Impact on …
sstonehill12 fe4ffc4
Update beta callout text to say time-sensitive instead urgent
sstonehill12 b541b9c
Merge branch 'master' into sarah.stonehill/code-origin-new-doc
tylfin 9671fe1
Merge branch 'master' into sarah.stonehill/code-origin-new-doc
tylfin b285814
Merge branch 'master' into sarah.stonehill/code-origin-new-doc
tylfin 93e5911
Removed Datadog support instruction from beta callout
sstonehill12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
--- | ||
title: Code Origins for Spans | ||
description: "Learn how to use Code Origins to understand where your spans originate in your codebase" | ||
further_reading: | ||
- link: "/tracing/glossary/" | ||
tag: "Documentation" | ||
text: "Learn about APM terms and concepts" | ||
- link: "/tracing/trace_collection/" | ||
tag: "Documentation" | ||
text: "Learn how to set up APM tracing with your application" | ||
- link: "/tracing/services/service_page/" | ||
tag: "Documentation" | ||
text: "Learn more about services in Datadog" | ||
- link: "/tracing/services/resource_page/" | ||
tag: "Documentation" | ||
text: "Dive into your resource performance and traces" | ||
- link: "/dynamic_instrumentation/" | ||
tag: "Documentation" | ||
text: "Learn how to add custom spans with Dynamic Instrumentation" | ||
|
||
--- | ||
|
||
{{< beta-callout url="#" btn_hidden="true" >}} | ||
Code Origins is currently in Preview. To participate in the preview, simply follow the set up instructions below. | ||
|
||
To submit questions, feedback, or requests related to Code Origins, <a href="https://docs.google.com/forms/d/e/1FAIpQLScyeRsF2GJjYdf9bUyeDjt8_9id-gvqiBU1SHR3ioDGe5eF3g/viewform?usp=header">fill out this form</a> with as much detail as possible. | ||
|
||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
For urgent issues, please contact <a href="https://www.datadoghq.com/support/">Datadog support</a>. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{< /beta-callout >}} | ||
|
||
## Overview | ||
|
||
Code Origins captures the exact location in your codebase where APM spans are created. When enabled, it automatically adds file path, line number, and function name to each span, making it easier to: | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- Debug performance issues | ||
- Understand code execution flow | ||
- Identify performance bottlenecks | ||
- Onboard new team members | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{{< img src="tracing/guide/code_origins/code_origin_details.png" alt="Code Origin Details" style="width:100%;">}} | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
## Getting started | ||
|
||
### Prerequisites | ||
- [Datadog APM][6] configured to capture spans | ||
- Service meets the [Compatibility Requirements](#compatibility-requirements) below | ||
- [Source Code Integration][7] enabled (recommended for code previews) | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Compatibility requirements | ||
|
||
| Runtime Language | Tracing Library Version | Frameworks | | ||
|---|---|---| | ||
| Java | `1.47.0` or later | Spring Boot/Data, gRPC servers, Micronaut 4, Kafka consumers (entry spans only)| | ||
| Python | `2.15.0` or later | Django, Flask, Starlette and derivatives (entry & exit spans)| | ||
| Node.js | `4.49.0` or later | Fastify (entry & exit spans), All other [APM-supported integrations][8] ( exit spans only)| | ||
| .NET | `3.15.0` or later | ASP.NET, ASP.NET Core (entry & exit spans)| | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Enable Code Origins | ||
|
||
Run your service with the below environment variable: | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```shell | ||
export DD_CODE_ORIGIN_FOR_SPANS_ENABLED=true | ||
``` | ||
|
||
## Using Code Origins | ||
|
||
### In the Trace Explorer | ||
|
||
1. Navigate to the [Trace Explorer][1]. | ||
domalessi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
2. Click on any trace to view its details. | ||
3. In the span details panel, look for the "Code Origin" section. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
4. Optionally, click on variables referenced the source code to add them as attributes on future spans using [Dynamic Instrumentation][5]. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
5. (Coming Soon) Click on "Start Debug Session" to open Live Debugger and begin capturing logs at this code location in real-time. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{{< img src="tracing/guide/code_origins/code_origin_traces_explorer.png" alt="Code Origin in Traces Explorer" style="width:100%;">}} | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### In your IDE | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
1. Set up your [Datadog IDE Integration][4]. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
2. See RED metrics as code annotations above your endpoint methods. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
3. Quickly navigate to the code location of a given APM span visible from your IDE. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<div class="alert alert-info">Supported IDEs: JetBrains, Visual Studio Code</div> | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{{< img src="tracing/guide/code_origins/code_origin_ide_details.png" alt="Code Origin Details in IDE" style="width:100%;">}} | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## How it works | ||
|
||
Code Origins captures two types of spans: | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Entry spans**: Shows the first method in your application code that handles an incoming request. The APM integration identifies the source code location where requests enter your system. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Exit spans**: Shows the exact line of code that makes an outgoing request to a downstream service. The tracer examines the call stack to identify the line where an exit span starts, skipping third-party code. | ||
|
||
<div class="alert alert-info">Note: Some tracing libraries may have slightly different implementations to optimize for performance.</div> | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Impact on performance and billing | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Performance Impact**: Code Origins has negligible performance overhead that is virtually unnoticeable in production environments. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Pricing Impact**: While in Preview, Code Origins will have no additional impact on billing. | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Troubleshooting | ||
|
||
If Code Origin information is missing: | ||
|
||
1. Verify Code Origins is enabled in your tracing library configuration | ||
2. Check that your service meets all [Compatibility Requirements](#compatibility-requirements) | ||
3. Check the service language and framework support for capturing Code Origins on entry and/or exit spans | ||
4. Filter spans with Code Origins in the Traces explorer using the search query: `@_dd.code_origin.type:*` | ||
5. Code Origins does not capture third-party code | ||
6. Enable [Source Code Integration][7] to see code previews in the APM Trace details | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Further Reading | ||
|
||
{{< partial name="whats-next/whats-next.html" >}} | ||
|
||
[1]: /tracing/trace_explorer/ | ||
sstonehill12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[2]: /tracing/services/service_page/ | ||
[3]: /tracing/services/resource_page/ | ||
[4]: /developers/ide_plugins/ | ||
[5]: /dynamic_instrumentation/ | ||
[6]: /tracing/trace_collection/ | ||
[7]: /integrations/guide/source-code-integration/ | ||
[8]: /tracing/trace_collection/compatibility/nodejs#web-framework-compatibility |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+349 KB
static/images/tracing/guide/code_origins/code_origin_traces_explorer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.