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

sqlproxyccl: do not report BackendDown metrics on throttle and routing errors #108914

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

jaylim-crl
Copy link
Collaborator

@jaylim-crl jaylim-crl commented Aug 17, 2023

sqlproxyccl: do not report BackendDown metrics on throttle and routing errors

Previously, we were reporting the backend_down metric on the following errors:

  • codeProxyRefusedConnection
  • codeParamsRoutingFailed
  • codeUnavailable

These errors do not imply that the backend is down. We originally introduced
this in #57431, but looking at the PR, it appears unintentional. This commit
fixes that by not reporting the backend_down metric when the proxy returns
such errors.

Release note: None

Epic: none

sqlproxyccl: rename codeBackendDown to codeBackendDialFailed

This commit renames codeBackendDown to codeBackendDialFailed to prevent
confusions by developers. Note that we don't rename the metric here to avoid
breaking downstream consumers. At the same time, we will remove the old
codeBackendRefusedTLS code as it does not serve any purpose, and there wasn't
a metric for it as well.

Release note: None

Epic: none

Release justification: This fixes accuracy issues with SQL Proxy metrics.

@jaylim-crl jaylim-crl requested review from a team as code owners August 17, 2023 15:50
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@andy-kimball andy-kimball left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @darinpp and @jeffswenson)

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

…g errors

Previously, we were reporting the backend_down metric on the following errors:
- codeProxyRefusedConnection
- codeParamsRoutingFailed
- codeUnavailable

These errors do not imply that the backend is down. We originally introduced
this in cockroachdb#57431, and looking at the PR, it appears unintentional. This commit
fixes that by not reporting the backend_down metric when the proxy returns
such errors.

Release note: None

Epic: none

Release justification: This fixes accuracy issues with SQL Proxy metrics.
@jaylim-crl jaylim-crl force-pushed the jay/230817-fix-sqlproxy-metrics branch from 8425683 to 72e174c Compare August 17, 2023 17:38
This commit renames codeBackendDown to codeBackendDialFailed to prevent
confusions by developers. Note that we don't rename the metric here to avoid
breaking downstream consumers. At the same time, we will remove the old
codeBackendRefusedTLS code as it does not serve any purpose, and there wasn't
a metric for it as well.

Release note: None

Epic: none
@jaylim-crl jaylim-crl force-pushed the jay/230817-fix-sqlproxy-metrics branch from 72e174c to 95eb34d Compare August 17, 2023 17:47
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

@jaylim-crl jaylim-crl added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Aug 17, 2023
@jaylim-crl
Copy link
Collaborator Author

TFTR!

bors r=JeffSwenson,andy-kimball

@craig
Copy link
Contributor

craig bot commented Aug 17, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Aug 17, 2023

Build succeeded:

@craig craig bot merged commit 07266c3 into cockroachdb:master Aug 17, 2023
@blathers-crl
Copy link

blathers-crl bot commented Aug 17, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 95eb34d to blathers/backport-release-23.1-108914: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants