-
Notifications
You must be signed in to change notification settings - Fork 1.2k
OTel Correlation Guides #30354
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
OTel Correlation Guides #30354
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
67dfe22
Initial draft.
brett0000FF ffb9f0b
Flesh out content into second draft.
brett0000FF c06a960
Merge branch 'master' of github.com:DataDog/documentation into brett.…
brett0000FF 3ee6847
Tweak examples.
brett0000FF 409da0e
Remove vague statement.
brett0000FF 69dc93e
Create new Data Correlation parent page with UST.
brett0000FF 9dabb1a
Update correlate logs and traces page.
brett0000FF d1251d3
Add separate pages for metrics and dbm.
brett0000FF 75e126c
Add new pages to left-nav.
brett0000FF ffeaaac
Merge branch 'master' of github.com:DataDog/documentation into brett.…
brett0000FF e0dd27d
Clean up.
brett0000FF 4d3d48d
Merge branch 'master' of github.com:DataDog/documentation into brett.…
brett0000FF dd49a7b
Add example to DBM page.
brett0000FF e974e04
Restructure into two distinct steps with a few log pipelines.
brett0000FF aac4af7
Remove repetition of correlate in nav.
brett0000FF 25dd8f0
Merge branch 'master' into brett.blue/otel-correlation
brett0000FF 780c393
Apply suggestions from code review
brett0000FF 52bee79
Remove redundant alert.
brett0000FF 5ebe932
Remove misleading description of attributes.
brett0000FF aefb382
Clarify how trace context is injected using bridges.
brett0000FF fe0405e
Remove level param from LoggingHandler example.
brett0000FF 0e504fa
Revise 'Scrape logs from files' approach.
brett0000FF 0f3e55a
Edits.
brett0000FF 2f31c00
Apply final feedback and clean up.
brett0000FF a522cc8
Merge branch 'master' of github.com:DataDog/documentation into brett.…
brett0000FF b5de195
Fix spacing.
brett0000FF e9bae95
Address final nits.
brett0000FF f8cdc9f
Merge branch 'master' of github.com:DataDog/documentation into brett.…
brett0000FF 8e7da6b
Remove DBM content; move to new branch.
brett0000FF 3f1d1c7
Merge branch 'master' of github.com:DataDog/documentation into brett.…
brett0000FF f795a6a
Update content/en/opentelemetry/correlate/_index.md
brett0000FF 9133880
Merge branch 'master' into brett.blue/otel-correlation
brett0000FF 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,79 @@ | ||
--- | ||
title: Correlate OpenTelemetry Traces and Metrics | ||
further_reading: | ||
- link: "/opentelemetry/otel_tracing/" | ||
tag: "Documentation" | ||
text: "Send OpenTelemetry Traces to Datadog" | ||
--- | ||
|
||
## Overview | ||
|
||
Correlating traces with host metrics allows you to pivot from a slow request directly to the CPU and memory metrics of the host or container it ran on. This helps you determine if resource contention was the root cause of a performance issue. | ||
|
||
Correlation between traces and metrics relies on the following resource attributes: | ||
|
||
- `host.name`: For correlating with host metrics (CPU, memory, disk). | ||
- `container.id`: For correlating with container metrics. | ||
|
||
## Requirements | ||
|
||
Before you begin, ensure you have configured [unified service tagging][1]. This is required for all data correlation in Datadog. | ||
|
||
## Setup | ||
|
||
To correlate traces and metrics, you must: | ||
|
||
1. **Collect Host Metrics**: You must have the OpenTelemetry Collector configured to collect and send host metrics to Datadog. | ||
|
||
2. **Ensure Consistent Tagging**: Your traces and metrics must share a consistent `host.name` (for hosts) or `container.id` (for containers) attribute for Datadog to link them. | ||
|
||
|
||
### 1. Collect host metrics | ||
|
||
To collect system-level metrics from your infrastructure, enable the `hostmetrics` receiver in your OpenTelemetry Collector configuration. This receiver gathers metrics like CPU, memory, disk, and network usage. | ||
|
||
Add the `hostmetrics` receiver to the `receivers` section of your Collector configuration and enable it in your `metrics` pipeline: | ||
|
||
|
||
```yaml | ||
receivers: | ||
hostmetrics: | ||
collection_interval: 10s | ||
scrapers: | ||
cpu: | ||
memory: | ||
disk: | ||
... | ||
|
||
service: | ||
pipelines: | ||
metrics: | ||
receivers: [hostmetrics, ...] | ||
processors: [...] | ||
exporters: [...] | ||
``` | ||
|
||
For the complete, working configuration, including Kubernetes-specific setup, see the [Host Metrics][2] documentation. | ||
|
||
### 2. Ensure consistent host and container tagging | ||
|
||
For correlation to work, the `host.name` (or `container.id`) attribute on your traces must match the corresponding attribute on the metrics collected by the `hostmetrics` receiver. | ||
|
||
## View correlated data in Datadog | ||
|
||
After your application is sending traces and the Collector is sending host metrics, you can see the correlation in the APM Trace View. | ||
|
||
1. Navigate to [**APM** > **Traces**][3]. | ||
2. Find and click on a trace from your instrumented service. | ||
3. In the trace's flame graph, select a span that ran on the instrumented host. | ||
4. In the details panel, click the **Infrastructure** tab. You should see the host metrics, like CPU and memory utilization, from the host that executed that part of the request. | ||
|
||
This allows you to immediately determine if a spike in host metrics corresponds with the performance of a specific request. | ||
|
||
## Further reading | ||
|
||
{{< partial name="whats-next/whats-next.html" >}} | ||
|
||
[1]: /opentelemetry/correlate/#prerequisite-unified-service-tagging | ||
[2]: /opentelemetry/integrations/host_metrics | ||
[3]: https://app.datadoghq.com/apm/traces |
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
Oops, something went wrong.
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.