The OpenResty XRay web console is the browser-based UI for monitoring and troubleshooting running applications — non-invasively, without changing a line of their code. It has four areas: Insights auto-generates daily and weekly analysis reports (in this tour, one OpenResty app surfaced 12 CPU-related issues); the Dashboard streams real-time CPU and memory metrics; Guided Analysis runs on-demand root-cause diagnosis and produces flame graphs; and Settings manages your agents. This walkthrough tours each one, using the OpenResty XRay Web Console for real-time monitoring and management.

What does the OpenResty XRay Insights page show?

The Insights page of the OpenResty XRay Web Console shows the analysis reports XRay automatically generates for all your apps across all of your servers.

OpenResty XRay web console Insights page listing analysis reports for all apps

You can find the reports for daily and weekly periods. By default, it displays today’s daily report. It can also show weekly reports.

Insights page showing today’s daily report with a weekly report option in OpenResty XRay

Click to fold the details of these applications.

Folding an application’s report details on the OpenResty XRay Insights page

As shown, OpenResty XRay can analyze a wide variety of applications.

OpenResty XRay analyzing many application types in the Insights report list

Unfold the “OpenResty” application.

Expanded OpenResty application entry in the OpenResty XRay Insights report

Tap on category titles to unfold the list of issues.

Unfolding categorized issue types for an application in OpenResty XRay

Issue categories with per-type issue counts in the OpenResty XRay Insights report

Issues were categorized by type, making it easy to find the ones you’re interested in. The number following represents the number of issues found of that type.

Issues grouped by type in the OpenResty XRay web console

Let’s check out the CPU issues in this Openresty application. It lists 12 issues below, all related to “CPU”.

Twelve CPU-related issues listed for an OpenResty application in OpenResty XRay

How do you read an OpenResty XRay analysis report?

To read an OpenResty XRay analysis report, open any issue and click More — the report centers on a flame graph that pinpoints the hot code path, followed by plain-language explanations and fix suggestions. To view detailed information for a specific issue in the issue list,

Selecting a specific issue from the OpenResty XRay issue list

just click on “More”.

Opening a full issue report with the More button in OpenResty XRay

Current issue is automatically inferred from this C-land Flame graph.

C-land CPU flame graph that OpenResty XRay used to infer the hot code path

Enlarge it.

Enlarged C-land flame graph pinpointing the hot code path in OpenResty XRay

The flame graph can help you locate the root cause of the issue.

Reading the flame graph to locate a root cause in OpenResty XRay

Below are more detailed explanations and suggestions about the issue.

Detailed explanation and fix suggestions for a CPU issue in OpenResty XRay

Click this button to view more analysis results.

Button to view more analysis results in an OpenResty XRay report

Here is the complete information of the report, such as which analyzer was used and application information.

Complete report details including the analyzer used and application information in OpenResty XRay

You’ll also find the flame graph and other charts here.

Flame graph and additional charts within an OpenResty XRay analysis report

And the complete terminal output.

Complete terminal output captured in an OpenResty XRay report

Full terminal output section of an OpenResty XRay analysis report

OpenResty XRay can help you quickly discover and solve problems of your applications.

OpenResty XRay helping discover and resolve application issues

What metrics does the OpenResty XRay Dashboard show?

The Dashboard shows real-time CPU and memory metrics, plus per-application charts for runtimes like Go. Visit the “Dashboard” page for more detailed monitoring data.

Opening the Dashboard page in the OpenResty XRay web console

Here are system metrics that display your system’s performance data.

System performance metrics on the OpenResty XRay Dashboard

You can easily switch in the upper corner to view other types of metrics.

Switching between metric types on the OpenResty XRay Dashboard

Here are different kinds of charts related to CPU usage in real time.

Real-time CPU usage charts on the OpenResty XRay Dashboard

Click to view this chart on the full screen.

Viewing a CPU chart in full screen on the OpenResty XRay Dashboard

Now, it shows data from the past 1 hour.

CPU data for the past hour on the OpenResty XRay Dashboard

These are detailed metrics for system CPU utilization.

Detailed system CPU utilization metrics in OpenResty XRay

Below is basic information sorted by application type. This one is about the Go application.

Basic information for a Go application on the OpenResty XRay Dashboard

There are other analytic diagrams and charts for various kinds of applications on the Dashboard page.

Additional analytic charts for various applications on the OpenResty XRay Dashboard

Go to the memory metrics page.

Opening the memory metrics page on the OpenResty XRay Dashboard

These system metrics are all about memory usage.

System memory usage metrics on the OpenResty XRay Dashboard

To go from watching memory usage to tracing an actual leak down to the source line, see Memory Leak Detection in Production.

How do you diagnose high CPU usage with Guided Analysis?

To diagnose high CPU usage, open Guided Analysis, pick High CPU Usage, choose the application and its worker process, keep both Lua and C/C++ selected, and start — XRay runs successive rounds (up to 300 seconds by default) and produces a report whose flame graph points to the hot code path. With the “Guided Analysis” feature, users can easily analyze performance problems online. Click on the “Guided Analysis” page.

Opening the Guided Analysis page in the OpenResty XRay web console

Here, you can see different types of problems that you can diagnose.

Problem types available for diagnosis in OpenResty XRay Guided Analysis

Let’s select “High CPU Usage”.

Selecting High CPU Usage in OpenResty XRay Guided Analysis

Click on “Next”.

Proceeding to the next step in OpenResty XRay Guided Analysis

Select the OpenResty application.

Selecting the OpenResty application in Guided Analysis

Select the worker process.

Selecting the worker process for high CPU analysis in OpenResty XRay

Make sure that the application type is right. Usually, the default should be correct.

Confirming the application type in OpenResty XRay Guided Analysis

OpenResty XRay can analyze multiple language levels at the same time. We’ll keep both Lua and C/C++ selected.

Keeping both Lua and C/C++ levels selected for multi-language analysis in OpenResty XRay

We can also set the maximum analyzing time. We’ll leave it as 300 seconds, which is the default value.

Setting the maximum analysis time to the default 300 seconds in OpenResty XRay

Start analyzing.

Starting the guided high CPU analysis in OpenResty XRay

The system will keep performing different rounds of analysis. Now, it’s executing the first round.

OpenResty XRay running the first round of guided analysis

The first round is done, and it’s already on the second one. That’s enough for this case.

OpenResty XRay proceeding to the second round of analysis

Let’s stop analyzing.

Stopping the guided analysis in OpenResty XRay

It automatically generated an analysis report.

Automatically generated guided analysis report in OpenResty XRay

Click here to enter the historical report list page.

Opening the historical guided analysis report list in OpenResty XRay

Here are the historical guided analysis reports.

List of historical guided analysis reports in OpenResty XRay

This is the report we just generated.

The guided analysis report just generated in OpenResty XRay

Click to enter the report details page.

Opening the guided analysis report details page in OpenResty XRay

Guided analysis report details with flame graph in OpenResty XRay

How do you configure an OpenResty XRay agent?

In the Settings page you select an agent and adjust its configuration. Go back to the console page. Click here to enter the “Settings” page.

Opening the Settings page in the OpenResty XRay web console

Select the settings feature.

Selecting the settings feature in the OpenResty XRay web console

Here, you can see the information on the selected agent and make some configurations for it.

Viewing selected agent information and configuration in OpenResty XRay

Configuring an OpenResty XRay agent in the Settings page

OpenResty XRay Web Console FAQ

Does OpenResty XRay require changing your application code?

No. OpenResty XRay is a non-invasive tool that analyzes running applications as-is. You drive everything from the web console — no recompiling, no instrumentation, and no code changes.

What’s the difference between Insights reports and Guided Analysis?

Insights reports are generated automatically on a daily and weekly schedule for every app across your servers. Guided Analysis is on-demand: you pick a problem type, target, and duration, then trigger a live analysis yourself. Both produce reports with flame graphs and suggestions.

How often does OpenResty XRay generate Insights reports?

Automatically, on daily and weekly cycles. The Insights page defaults to today’s daily report and can also show the weekly report, so there is always a recent analysis waiting without any manual trigger.

What is OpenResty XRay?

OpenResty XRay is a dynamic-tracing product that automatically analyzes your running applications to troubleshoot performance problems, behavioral issues, and security vulnerabilities with actionable suggestions. Under the hood, OpenResty XRay is powered by our Y language targeting various runtimes like Stap+, eBPF+, GDB, and ODB, depending on the contexts.

If you like this tutorial, please subscribe to this blog site and/or our YouTube channel. Thank you!

About The Author

Yichun Zhang (Github handle: agentzh), is the original creator of the OpenResty® open-source project and the CEO of OpenResty Inc..

Yichun is one of the earliest advocates and leaders of “open-source technology”. He worked at many internationally renowned tech companies, such as Cloudflare, Yahoo!. He is a pioneer of “edge computing”, “dynamic tracing” and “machine coding”, with over 22 years of programming and 16 years of open source experience. Yichun is well-known in the open-source space as the project leader of OpenResty®, adopted by more than 40 million global website domains.

OpenResty Inc., the enterprise software start-up founded by Yichun in 2017, has customers from some of the biggest companies in the world. Its flagship product, OpenResty XRay, is a non-invasive profiling and troubleshooting tool that significantly enhances and utilizes dynamic tracing technology. And its OpenResty Edge product is a powerful distributed traffic management and private CDN software product.

As an avid open-source contributor, Yichun has contributed more than a million lines of code to numerous open-source projects, including Linux kernel, Nginx, LuaJIT, GDB, SystemTap, LLVM, Perl, etc. He has also authored more than 60 open-source software libraries.