Is there an API available for TiProxy?

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

Original topic: tiproxy有api可用吗

| username: chenhanneu

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed that led to the issue
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]


Can TiDB get status through API, does TiProxy have a similar method?

| username: 健康的腰间盘 | Original post link

I couldn’t find the relevant interface information in the official documentation.

| username: zhaokede | Original post link

I couldn’t find it in the online documentation.

| username: TiDBer_小阿飞 | Original post link

| username: TiDBer_小阿飞 | Original post link

api

HTTP Gateway Configuration.

addr

  • Default value: 0.0.0.0:3090
  • Supports hot reload: No
  • API gateway address. The format is <ip>:<port>.
| username: chenhanneu | Original post link

The default port for the tiproxy API is 3080, but I’m not sure what parameters can be used after it.

| username: TiDBer_小阿飞 | Original post link

The official documentation indeed does not specify which parameters are available. You can submit a change or request to improve the relevant documentation.

| username: 小于同学 | Original post link

Never seen it.

| username: djshow832-PingCAP | Original post link

Thank you for the feedback. We will add the HTTP API to the documentation soon.

If you connect directly to port 3080, you can use curl 127.0.0.1:3080/xxx just like with TiDB’s port 10080. Common endpoints include:

  • /api/debug/health - Check health status
  • /api/admin/config/ - Get or set configuration
  • /metrics - Get metrics
  • /debug/pprof/xxx - Get profile
| username: djshow832-PingCAP | Original post link

A documentation PR has already been submitted: tiproxy: add tiproxyctl commands and http api by djshow832 · Pull Request #17340 · pingcap/docs-cn · GitHub

| username: zhang_2023 | Original post link

There should be none.

| username: 友利奈绪 | Original post link

The official big shot has been revealed.

| username: yytest | Original post link

Indeed, it is not reflected in the documentation.