Get Started with Datadog

The Monitor

Investigate network issues with on-demand packet capture

Published

Read time

6m

Investigate network issues with on-demand packet capture
Paolo Padua

Paolo Padua

Product Marketing Manager

Andrea Michael

Andrea Michael

Product Manager

Bowen Chen

Bowen Chen

Senior Technical Content Writer

Cloud applications depend on network connections between services, containers, and hosts. When those connections experience elevated latency or fail, customers struggle to access services or complete transactions. But understanding why a connection is failing often requires examining individual network packets. Traditionally, that means using SSH to access the affected hosts, running tcpdump, and transferring the resulting files to a separate tool. This process takes time, requires host-level permissions that may be restricted in production environments, and separates packet-level troubleshooting from the rest of your investigation.

Datadog Cloud Network Monitoring’s (CNM) on-demand packet capture, available in Preview, brings packet-level investigation directly into CNM. Network engineers and SREs can trigger a packet capture on selected hosts from an aggregate connection, review a plain-language analysis generated by Bits AI, and download the capture files for further investigation. 

In this post, we’ll show how you can:

- Launch a packet capture directly from a connection in CNM

- Interpret packet-level findings with Bits AI

Launch a packet capture without leaving your investigation

Investigating a slow application experience often starts with reviewing a high-latency span. Datadog Application Performance Monitoring (APM) gives you a starting point for that investigation, which you can now take further in CNM. From the span’s Network tab, you can quickly pivot between the client and server spans to correlate the observed application latency with CNM network metrics. This helps you understand whether network behavior is contributing to application latency without switching between tools or views.

APM correlates CNM network metrics with a trace span to help investigate application latency.
APM correlates CNM network metrics with a trace span to help investigate application latency.

With the network’s role in view, you can narrow your investigation to the correlated connection in CNM Analytics. There, you can group aggregate connections by client service and server service and sort by round-trip time (RTT) or TCP retransmissions to identify affected connections. Selecting an aggregate connection brings its metric timeseries, associated tags, individual flow records, and related telemetry data into view.

Filter your connections in CNM Analytics by client service and host.
Filter your connections in CNM Analytics by client service and host.

That context gives you a clear basis for launching an on-demand packet capture directly from CNM Analytics via the three-dot menu shown above or after inspecting the connection from its side panel.

Target hosts that are most likely to reveal an issue

An aggregate connection can represent hundreds or thousands of host pairs, depending on how you’ve grouped the network data. Capturing traffic from every host could generate unnecessary data and make it harder to identify the source of a problem.

To help narrow the investigation, CNM automatically selects up to 25 hosts associated with the connection. The selection includes hosts sampled from those with the highest TCP resets, connection failure rates, and retransmissions, along with a random sample of other hosts. The configuration panel also identifies whether each host participates on the client side, server side, or both sides of the connection.

All suggested hosts are selected by default, but you can sort the list by hostname, role, resets, failures, or retransmissions and deselect hosts before starting the capture. For example, if connection failures are concentrated on a small set of server hosts, you can focus the capture on those hosts to investigate their connection behavior. By targeting hosts with the strongest signs of connection trouble, teams can collect focused evidence, narrow the likely source of the issue, and focus remediation on restoring service responsiveness.

Select hosts for packet capture based on TCP resets, connection failures, and retransmissions.
Select hosts for packet capture based on TCP resets, connection failures, and retransmissions.

When the packet capture starts, Datadog sends a remote command to the Datadog Agent on each selected host. Because the capture runs through the Datadog Agent, you don’t need to log in to individual hosts or obtain elevated host permissions. In Preview, the capture runs for a fixed 30-second window and typically takes 1–2 minutes to complete, including processing. 

Once the capture finishes, you can access the results from the side panel or the persistent Packet Capture tab in CNM. The tab lists packet captures across your organization, including their status and the user who initiated each request. This gives teams a shared record of capture activity that they can reference when collaborating on an investigation or handing off an incident.

Interpret packet capture findings using Bits AI

Packet capture files contain detailed protocol information, but interpreting that information typically requires familiarity with TCP behavior and packet analysis tools. Datadog uses Bits AI to create a plain-language summary of your packet capture results so you can quickly identify relevant patterns and decide on the next steps for your investigation. 

A capture may reveal repeated TCP connection attempts, SYN retries, or abrupt connection resets. The summary identifies the affected hosts, describes the observed pattern, and explains what the evidence suggests. Repeated SYNs with no SYN-ACK might point to a firewall dropping traffic or a service that isn’t listening, but packet headers alone may not establish where the drop happened. By distinguishing observed facts from possible explanations, the summary helps you determine whether to investigate a specific host, repeat the capture, or examine another part of the network path.

Bits AI distinguishes observed packet behavior from inferred causes and identifies affected hosts.
Bits AI distinguishes observed packet behavior from inferred causes and identifies affected hosts.

Download raw packet capture files for further analysis

When the summary points to a pattern that requires deeper analysis or collaboration, engineers can download the underlying packet capture files and continue using their existing workflows. For a complete or partial packet capture, you can download the results. Datadog compresses the results into a gzip file that decompresses to a single .pcapng file containing the packet captures from all selected hosts.

Datadog records the headers of TCP connection setup and teardown packets, including information such as IP addresses, ports, and TCP flags. It does not capture data packets, their ACKs, or application payloads. As a result, on-demand packet captures are best suited for troubleshooting problems related to connection setup and teardown, such as failed handshakes, resets, and slow closes. For loss on established connections, CNM’s retransmission and RTT metrics provide a better starting point for an investigation. By collecting packet headers without application payloads, on-demand packet capture helps teams investigate network behavior while reducing the risk of capturing sensitive application content.

For example, if the Bits AI summary identifies repeated connection resets between two hosts, you can download the capture files to inspect TCP flags and packet timing in more detail. You can also share the files with another engineer or a support team member who needs to examine the packet evidence.

Investigate network issues with Datadog

On-demand packet capture gives network engineers and SREs a connected path from a degraded connection to packet-level evidence in CNM. They can move from identifying a connection anomaly to a targeted capture and plain-language analysis without manually accessing production hosts. With this information, teams can download the capture files for deeper analysis or collaboration. 

On-demand packet capture is available in Preview—request access today to get started. To learn more about investigating network traffic and connection performance, check out our documentation on Cloud Network Monitoring. 

If you’re new to Datadog, to start investigating network performance with Datadog CNM.

Start monitoring your metrics in minutes