Skip to content

Commit

Permalink
[#25775] YSQL: Sticky conn as metrics for prometheus endpoint
Browse files Browse the repository at this point in the history
Summary:
Sticky connections were introduced as a new metric in D40484, but were left out from being published to the prometheus endpoint. This patch pushes the same information to the prometheus-metrics endpoint in addition to the pre-existing connections endpoint.

Jira: DB-15041

Test Plan:
Jenkins: enable connection manager, all tests

Verify that sticky conn metrics are available on prometheus endpoint on a local cluster

Reviewers: skumar, mkumar, devansh.saxena, vpatibandla

Reviewed By: mkumar, devansh.saxena

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D41484
  • Loading branch information
rahulb-yb committed Jan 31, 2025
1 parent 92776cb commit 6750c49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/yb/yql/pggate/webserver/ybc_pg_webserver_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ void emitYsqlConnectionManagerMetrics(PrometheusWriter *pwriter) {
{"ysql_conn_mgr_avg_wait_time_ns", stats.avg_wait_time_ns, "gauge",
"Avg wait time (in nanoseconds) for a logical connection to be attached to a physical "
"connection"});
ysql_conn_mgr_metrics.push_back(
{"ysql_conn_mgr_sticky_connections", stats.sticky_connections, "gauge",
"Number of logical connections attached to a physical connection for the lifetime of the "
"logical connection"});
ysql_conn_mgr_prometheus_attr[DATABASE] = stats.database_name;
ysql_conn_mgr_prometheus_attr[USER] = stats.user_name;

Expand Down

0 comments on commit 6750c49

Please sign in to comment.