Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ccl/sqlproxyccl: add proxy.sql.routing_method_count metric #130892

Conversation

jaylim-crl
Copy link
Collaborator

@jaylim-crl jaylim-crl commented Sep 17, 2024

Previously, it was not possible to determine the distribution of users
connecting to the proxy via SNI, database, or cluster option (via the options
parameter). This commit introduces a proxy.sql.routing_method_count
metric to record the number of occurrences of each proxy routing method. Only
successful parsing will be recorded; if a user provides invalid input, it will
not be tracked. This enhancement allows us to monitor and understand which
method was used by the proxy to retrieve the cluster identifier.

Epic: CC-6926

Release note: None

@jaylim-crl jaylim-crl requested review from a team as code owners September 17, 2024 17:59
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jaylim-crl jaylim-crl requested review from jeffswenson and DuskEagle and removed request for a team September 17, 2024 17:59
@jaylim-crl jaylim-crl force-pushed the jay/240917-add-connection-metrics-to-proxy branch 2 times, most recently from 7111ef8 to bf1c3d4 Compare September 17, 2024 18:04
@jaylim-crl jaylim-crl added backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2 and removed backport-24.1.x Flags PRs that need to be backported to 24.1. labels Sep 17, 2024
Copy link
Collaborator

@jeffswenson jeffswenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Name: "proxy.access_control.errors",
Help: "Numbers of access control list files that are currently having errors",
Measurement: "Access Control File Errors",
Unit: metric.Unit_COUNT,
}
metaClusterIdentifierReadsTotal = metric.Metadata{
Name: "proxy.cluster_identifier.reads_total",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: what do you think of the name proxy.sql.routing_method? reads_total sounds like a metric that counts how many times something is looked up in the database.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I updated it to proxy.sql.routing_method_count.

Previously, it was not possible to determine the distribution of users
connecting to the proxy via SNI, database, or cluster option (via the options
parameter). This commit introduces a `proxy.sql.routing_method_count`
metric to record the number of occurrences of each proxy routing method. Only
successful parsing will be recorded; if a user provides invalid input, it will
not be tracked. This enhancement allows us to monitor and understand which
method was used by the proxy to retrieve the cluster identifier.

Epic: CC-6926

Release note: None
@jaylim-crl jaylim-crl force-pushed the jay/240917-add-connection-metrics-to-proxy branch from bf1c3d4 to 56fc243 Compare September 17, 2024 22:03
@jaylim-crl jaylim-crl changed the title ccl/sqlproxyccl: add proxy.cluster_identifier.reads_total metric ccl/sqlproxyccl: add proxy.sql.routing_method_count metric Sep 17, 2024
@jaylim-crl
Copy link
Collaborator Author

Thanks for the reviews!

@jaylim-crl
Copy link
Collaborator Author

bors r+

@craig craig bot merged commit 197c6ee into cockroachdb:master Sep 18, 2024
23 checks passed
@jaylim-crl jaylim-crl deleted the jay/240917-add-connection-metrics-to-proxy branch September 18, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-24.2.x Flags PRs that need to be backported to 24.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants