Error Displayed in TiDB Dashboard Top SQL: API: /topsql/instances Request failed with status code 502

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB Dashboard中Top SQL显示报错:API: /topsql/instances Request failed with status code 502

| username: 我是吉米哥

[TiDB Usage Environment]
Production Environment

[TiDB Version]
Operating System Version: RHEL8.10
TiDB Version: 7.5.1
HAPROXY Version: 2.7.8-1


Enabled IP passthrough with haproxy’s send-proxy and configured related parameters in the cluster.
proxy-protocol.networks: xx.xx.6.0/24

The IP passthrough function is working correctly as seen in the show processlist.

[Reproduction Path]
Fresh installation online, the installation process went smoothly without any error messages.

[Encountered Problem: Problem Phenomenon and Impact]
When logging into TiDB Dashboard, the TOP SQL page shows an error: API: /topsql/instances Request failed with status code 502
Dropdown instance – unable to select any instance

[Resource Configuration] Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page

[Attachments: Screenshots/Logs/Monitoring]
SQL statement analysis can be displayed normally:

Slow queries can also be displayed normally

| username: Kongdom | Original post link

Is the firewall port not open?

| username: 我是吉米哥 | Original post link

The issue has been resolved; it was a firewall problem. The company’s network policy requires network isolation deployment for control nodes, monitoring nodes, and database service nodes. Some network ports between the PD node and the monitoring node were left open. Thank you.

| username: Kongdom | Original post link

:handshake: :handshake: :handshake:

| username: 小于同学 | Original post link

Got it.

| username: 友利奈绪 | Original post link

Does adding it to the whitelist solve the problem?

| username: 我是吉米哥 | Original post link