-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Create new Code Origins doc page #2 8000 8056
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 all 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 suppor
8000
t 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
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,110 @@ | ||
--- | ||
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 join the preview, follow the instructions below. | ||
|
||
To submit questions, feedback, or requests related to Code Origins, fill out <a href="https://docs.google.com/forms/d/e/1FAIpQLScyeRsF2GJjYdf9bUyeDjt8_9id-gvqiBU1SHR3ioDGe5eF3g/viewform?usp=header">this form</a> with details. | ||
{{< /beta-callout >}} | ||
|
||
## Overview | ||
|
||
Code Origins captures the exact locations 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: | ||
|
||
- Debug performance issues | ||
- Understand code execution flow | ||
- Identify performance bottlenecks | ||
|
||
In Trace Explorer, select a span to see Code Origin details on the Overview tab: | ||
{{< img src="tracing/guide/code_origins/code_origin_details_spotlight.png" alt="Code Origin Details" style="width:100%;">}} | ||
|
||
|
||
## Getting started | ||
|
||
### Prerequisites | ||
- [Datadog APM][6] is configured to capture spans. | ||
- [Source Code Integration][7] is enabled (recommended for code previews). | ||
- Your service meets the [compatibility requirements](#compatibility-requirements). | ||
|
||
### Compatibility requirements | ||
|
||
| Runtime Language | Tracing Library Version | Frameworks | | ||
|---|---|---| | ||
| Java | 1.47.0+ | Spring Boot/Data, gRPC servers, Micronaut 4, Kafka consumers| | ||
| Python | 2.15.0+ | Django, Flask, Starlette and derivatives| | ||
| Node.js | 4.49.0+ | Fastify| | ||
| .NET | 3.15.0+ | ASP.NET, ASP.NET Core| | ||
|
||
### Enable Code Origins | ||
|
||
Run your service with the following environment variable: | ||
|
||
```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
|
||
|
||
{{< img src="tracing/guide/code_origins/code_origin_details_spotlight.png" alt="Code Origin Details in Traces Explorer" style="width:100%;">}} | ||
|
||
4. Optionally, click on source code variables to add them as attributes to future spans with [Dynamic Instrumentation][5]. | ||
|
||
{{< img src="tracing/guide/code_origins/code_origin_add_span_tag_spotlight.png" alt="Code Origin - Add span tag with Dynamic Instrumentation" style="width:100%;">}} | ||
|
||
### 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
|
||
- Supported IDEs: IntelliJ, VS Code | ||
- Supported Languages: Java, Python | ||
2. View RED metrics (Requests, Errors, and Duration) as inline annotations above your endpoint methods. | ||
|
||
{{< img src="tracing/guide/code_origins/code_origin_ide_details.png" alt="Code Origin Details in IDE" style="width:100%;">}} | ||
|
||
## Troubleshooting | ||
|
||
If Code Origin information is missing: | ||
|
||
1. Verify Code Origins is [enabled](#enable-code-origins) in your tracing library configuration. | ||
1. Confirm that your service meets all [compatibility requirements](#compatibility-requirements). | ||
- In particular, check whether your service's language and framework support Code Origins. | ||
1. Filter for spans that include Code Origins using the query `@_dd.code_origin.type:*` in the [Trace Explorer][1]. | ||
1. Enable [Source Code Integration][7] to see code previews in the APM Trace side panel. | ||
|
||
|
||
## Further Reading | ||
|
||
{{< partial name="whats-next/whats-next.html" >}} | ||
|
||
[1]: https://app.datadoghq.com/apm/traces | ||
[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 |
Binary file added
BIN
+306 KB
static/images/tracing/guide/code_origins/code_origin_add_span_tag_spotlight.png
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
+279 KB
static/images/tracing/guide/code_origins/code_origin_details_spotlight.png
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.
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.