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

backend, metrics: add logs and metrics for getting a backend #212

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

djshow832
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #210

Problem Summary:
Getting backend is problematic on the serverless tier. We need more logs to help investigating.

What is changed and how it works:

  • Add error logs when getting backend fails; add warn logs when getting backend too slow
  • Add duration metrics for getting backends

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code
[2023/02/06 15:20:54.085 +08:00] [ERROR] [main.proxy.conn.be] [backend/backend_conn_mgr.go:245] [get backend failed] [connID=0] [remoteAddr=127.0.0.1:62995] [duration=15.000037552s] [last_err="no instances to route"]
tiproxy_session_get_backend_duration_millis_bucket{le="0.001"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.002"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.004"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.008"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.016"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.032"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.064"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.128"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.256"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="0.512"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="1.024"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="2.048"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="4.096"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="8.192"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="16.384"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="32.768"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="65.536"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="131.072"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="262.144"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="524.288"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="1048.576"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="2097.152"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="4194.304"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="8388.608"} 0
tiproxy_session_get_backend_duration_millis_bucket{le="16777.216"} 1
tiproxy_session_get_backend_duration_millis_bucket{le="33554.432"} 1
tiproxy_session_get_backend_duration_millis_bucket{le="+Inf"} 1
tiproxy_session_get_backend_duration_millis_sum 15000
tiproxy_session_get_backend_duration_millis_count 1

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change (Don't forget to add the declarative for API)
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@djshow832 djshow832 requested a review from xhebox February 6, 2023 07:50
@xhebox xhebox merged commit 249245f into pingcap:main Feb 7, 2023
@djshow832 djshow832 deleted the backend_log branch February 7, 2023 09:55
xhebox pushed a commit to xhebox/TiProxy that referenced this pull request Mar 7, 2023
xhebox pushed a commit to xhebox/TiProxy that referenced this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add logs and metrics for getting backend
2 participants