You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Initial draft.
* Flesh out content into second draft.
* Tweak examples.
* Remove vague statement.
* Create new Data Correlation parent page with UST.
* Update correlate logs and traces page.
* Add separate pages for metrics and dbm.
* Add new pages to left-nav.
* Clean up.
* Add example to DBM page.
* Restructure into two distinct steps with a few log pipelines.
* Remove repetition of correlate in nav.
* Apply suggestions from code review
Co-authored-by: Jade Guiton <jade.guiton@datadoghq.com>
* Remove redundant alert.
* Remove misleading description of attributes.
* Clarify how trace context is injected using bridges.
* Remove level param from LoggingHandler example.
* Revise 'Scrape logs from files' approach.
* Edits.
* Apply final feedback and clean up.
* Fix spacing.
* Address final nits.
* Remove DBM content; move to new branch.
* Update content/en/opentelemetry/correlate/_index.md
Co-authored-by: Heston Hoffman <heston.hoffman@datadoghq.com>
---------
Co-authored-by: Jade Guiton <jade.guiton@datadoghq.com>
Co-authored-by: Heston Hoffman <heston.hoffman@datadoghq.com>
description: Learn how to correlate your OpenTelemetry traces, metrics, logs, and other telemetry in Datadog to get a unified view of your application's performance.
3
4
aliases:
4
5
- /opentelemetry/otel_logs/
5
6
further_reading:
@@ -10,13 +11,89 @@ further_reading:
10
11
11
12
## Overview
12
13
13
-
Link your telemetry data for full-stack observability:
14
+
Getting a unified view of your application's performance requires connecting its traces, metrics, logs, user interactions, and more. By correlating your OpenTelemetry data in Datadog, you can navigate between all related telemetry in a single view, allowing you to diagnose and resolve issues faster.
14
15
15
-
{{< whatsnext desc=" " >}}
16
-
{{< nextlink href="/opentelemetry/correlate/logs_and_traces/" >}}Connect Logs and Traces{{< /nextlink >}}
17
-
{{< nextlink href="/opentelemetry/correlate/rum_and_traces/" >}}Connect RUM and Traces{{< /nextlink >}}
18
-
{{< /whatsnext >}}
16
+
17
+
## Prerequisite: Unified service tagging
18
+
19
+
Datadog uses three standard tags to link telemetry together: `env`, `service`, and `version`.
20
+
21
+
To ensure your OpenTelemetry data is properly correlated, you must configure your application or system to use these tags by setting a standard set of OpenTelemetry resource attributes. Datadog automatically maps these attributes to the correct tags.
22
+
23
+
| OpenTelemetry Resource Attribute | Datadog Tag | Notes |
|`deployment.environment.name`|`env`|**Recommended**. Supported in Agent v7.58.0+ and Collector Exporter v0.110.0+. |
26
+
|`deployment.environment`|`env`| Use instead of `deployment.environment.name` if you are running an Agent version older than v7.58.0 or a Collector Exporter older than v0.110.0. |
27
+
|`service.name`|`service`||
28
+
|`service.version`|`version`||
29
+
30
+
You can set these attributes in your application's environment variables, SDK, or in the OpenTelemetry Collector.
31
+
32
+
{{< tabs >}}
33
+
{{% tab "Environment Variables" %}}
34
+
35
+
Set the `OTEL_RESOURCE_ATTRIBUTES` environment variable with your service's information:
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.
12
+
13
+
Correlation between traces and metrics relies on the following resource attributes:
14
+
15
+
-`host.name`: For correlating with host metrics (CPU, memory, disk).
16
+
-`container.id`: For correlating with container metrics.
17
+
18
+
## Requirements
19
+
20
+
Before you begin, ensure you have configured [unified service tagging][1]. This is required for all data correlation in Datadog.
21
+
22
+
## Setup
23
+
24
+
To correlate traces and metrics, you must:
25
+
26
+
1.**Collect Host Metrics**: You must have the OpenTelemetry Collector configured to collect and send host metrics to Datadog.
27
+
28
+
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.
29
+
30
+
31
+
### 1. Collect host metrics
32
+
33
+
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.
34
+
35
+
Add the `hostmetrics` receiver to the `receivers` section of your Collector configuration and enable it in your `metrics` pipeline:
36
+
37
+
38
+
```yaml
39
+
receivers:
40
+
hostmetrics:
41
+
collection_interval: 10s
42
+
scrapers:
43
+
cpu:
44
+
memory:
45
+
disk:
46
+
...
47
+
48
+
service:
49
+
pipelines:
50
+
metrics:
51
+
receivers: [hostmetrics, ...]
52
+
processors: [...]
53
+
exporters: [...]
54
+
```
55
+
56
+
For the complete, working configuration, including Kubernetes-specific setup, see the [Host Metrics][2] documentation.
57
+
58
+
### 2. Ensure consistent host and container tagging
59
+
60
+
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.
61
+
62
+
## View correlated data in Datadog
63
+
64
+
After your application is sending traces and the Collector is sending host metrics, you can see the correlation in the APM Trace View.
65
+
66
+
1. Navigate to [**APM** > **Traces**][3].
67
+
2. Find and click on a trace from your instrumented service.
68
+
3. In the trace's flame graph, select a span that ran on the instrumented host.
69
+
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.
70
+
71
+
This allows you to immediately determine if a spike in host metrics corresponds with the performance of a specific request.
Copy file name to clipboardExpand all lines: content/en/opentelemetry/integrations/host_metrics.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ The metrics, mapped to Datadog metrics, are used in the following views:
99
99
-[Host default dashboards][8]
100
100
-[APM Trace view Host info][9]
101
101
102
-
**Note**: To correlate trace and host metrics, configure [Universal Service Monitoring attributes][10] for each service, and set the `host.name` resource attribute to the corresponding underlying host for both service and collector instances.
102
+
**Note**: To correlate trace and host metrics, configure [Unified Service Tagging attributes][10] for each service, and set the `host.name` resource attribute to the corresponding underlying host for both service and collector instances.
103
103
104
104
The following table shows which Datadog host metric names are associated with corresponding OpenTelemetry host metric names, and, if applicable, what math is applied to the OTel host metric to transform it to Datadog units during the mapping.
0 commit comments