Analyzer ngx-req-err-packets

Name

ngx-req-err-packets - IP Packets of Specified HTTP Errors

This analyzer captures network packets associated with HTTP requests that result in specified error status codes in Nginx-based applications. It records IP packet data for requests matching the target status code set (default: 499), generating bar charts and uploading packet capture files for detailed analysis. The analyzer provides network-level visibility into failed HTTP requests, enabling deep troubleshooting of client disconnections, timeout issues, and protocol-level problems.

Resource Category

Network I/O.

Application Type & Technical Stack

  • OpenResty
  • Nginx
  • Kong
  • APISIX

Command Line Syntax

The analyzer can be invoked directly on the command-line via the orxray utility from the openresty-xray-cli software package.

Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).

# PID is the target process PID.
orxray analyzer run ngx-req-err-packets -p PID

# trace a shell command directly
orxray analyzer run ngx-req-err-packets -c SHELL_CMD

# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run ngx-req-err-packets -p -PGID

# trace any processes started from the specified executable path.
orxray analyzer run ngx-req-err-packets --exe /path/to/exe/file

Tracing Multiple Processes

Supported.

Output Formats

  • Bar Charts
  • Plain Texts

Output Example

{
  "flows": [
    {
      "remote_addr": "1.1.1.1 42089",
      "local_addr": "172.17.65.182 443",
      "flow": "flow_1.pcap",
      "desc": "Request end time: Thu, 04 Dec 2025 06:43:25 GMT\nLocal address: 172.17.65.182:443\nRemote address: 60.165.20.27:42089",
      "time": "1764830605141637",
      "req_time": "2"
    }
  ]
}

Author

The OpenResty Inc. Team.

Copyright (C) by OpenResty Inc. All rights reserved.