[GH-ISSUE #1788] [feature request] Add client count metrics broken down by name in prometheus metrics #1414

Closed
opened 2026-05-05 12:53:41 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @Lilja on GitHub (May 1, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1788

Currently, it is not possible to see which clients are online in a dashboard.

There is currently this:
23bb76397a/models/metrics/prometheus/server.go (L58-L63)

Which is an integer of the total amount of clients connected to frps. But I wish that there could be another metric clients that shows the total amount of clients by name. So if I have a service/client like this:

# frpc.ini
[my-cool-client]
...

Then I would see in ip_address:7500/metrics:

# HELP frp_server_client_counts The current client counts of frps
# TYPE frp_server_client_counts gauge
frp_server_client_counts 1
# HELP frp_server_clients The current clients of frps broken down by name
# TYPE frp_server_clients gauge
frp_server_clients{name="my-cool-service"} 1

# HELP frp_server_connection_counts The current connection counts
# TYPE frp_server_connection_counts gauge
frp_server_connection_counts{name="my-cool-service",type="tcp"} 1
frp_server_connection_counts{name="ssh",type="tcp"} 0

Note the bolded, which are what I would like to achive.

TL;DR: I'm trying to replicate the dashboard page in grafana and I would like to know which clients are online, not how many clients are online.

image

but the prometheus /metrics page doesn't.

I would love to help by submitting a PR but I have never worked with golang so I'm afraid I wont be with too much help.

Originally created by @Lilja on GitHub (May 1, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1788 Currently, it is not possible to see which clients are online in a dashboard. There is currently this: https://github.com/fatedier/frp/blob/23bb76397a0484485a16e1a3e990385b13ee388d/models/metrics/prometheus/server.go#L58-L63 Which is an integer of the total amount of clients connected to frps. But I wish that there could be another metric `clients` that shows the total amount of clients by name. So if I have a service/client like this: ``` # frpc.ini [my-cool-client] ... ``` Then I would see in `ip_address:7500/metrics`: > \# HELP frp_server_client_counts The current client counts of frps > \# TYPE frp_server_client_counts gauge > frp_server_client_counts 1 > **\# HELP frp_server_clients The current clients of frps broken down by name > \# TYPE frp_server_clients gauge > frp_server_clients{name="my-cool-service"} 1** > \# HELP frp_server_connection_counts The current connection counts > \# TYPE frp_server_connection_counts gauge > frp_server_connection_counts{name="my-cool-service",type="tcp"} 1 > frp_server_connection_counts{name="ssh",type="tcp"} 0 Note the **bolded**, which are what I would like to achive. TL;DR: I'm trying to replicate the dashboard page in grafana and I would like to know which clients are online, not how many clients are online. ![image](https://user-images.githubusercontent.com/6134511/80794852-34306500-8b9b-11ea-8c15-1f184612da2e.png) but the prometheus `/metrics` page doesn't. I would love to help by submitting a PR but I have never worked with `golang` so I'm afraid I wont be with too much help.
gitea-mirror 2026-05-05 12:53:41 -06:00
  • closed this issue
  • added the
    proposal
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1414
No description provided.