Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add tx metrics and logs for serialization errors#15215

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 12 commits intomainfromstevenmasley/sql_metrics
Oct 25, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedOct 24, 2024
edited
Loading

Before db_metrics were all or nothing. NowInTx metrics are always recorded, and query metrics are opt in.

What this does

Adds instrumentation & logging around serialization failures in the database. When the database hits a serialization error, we retry the transaction up to 3 times. This mostly works, however in production we have seen all 3 retries fail.

We have 0 information on the frequency of failures if they retry once or twice. Or where they are located. Making debugging challenging.

The goal of this PR is not to solve the issue, but begin to investigate the frequency and location of the failures. This is assuming sometimes retries are successful.

Example metric of a failure.

Log line:

[erro]  database transaction hit serialization error and had to retry  success=false  executions=2  id=foobar_factory

Prometheus

# HELP coderd_db_tx_duration_seconds Duration of transactions in seconds.# TYPE coderd_db_tx_duration_seconds histogramcoderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="0.005"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="0.01"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="0.025"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="0.05"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="0.1"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="0.25"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="0.5"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="1"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="2.5"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="5"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="10"} 1coderd_db_tx_duration_seconds_bucket{id="foobar_factory",success="false",le="+Inf"} 1coderd_db_tx_duration_seconds_sum{id="foobar_factory",success="false"} 9.135e-06coderd_db_tx_duration_seconds_count{id="foobar_factory",success="false"} 1# HELP coderd_db_tx_executions_count Total count of transactions executed. 'retries' is expected to be 0 for a successful transaction.# TYPE coderd_db_tx_executions_count countercoderd_db_tx_executions_count{id="foobar_factory",retries="1",success="false"} 1

Context

For investigatinghttps://github.com/coder/customers/issues/683

@EmyrkEmyrk marked this pull request as ready for reviewOctober 24, 2024 17:07
@EmyrkEmyrk requested a review fromcoadlerOctober 25, 2024 13:56
@EmyrkEmyrk merged commitccfffc6 intomainOct 25, 2024
27 checks passed
@EmyrkEmyrk deleted the stevenmasley/sql_metrics branchOctober 25, 2024 16:14
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 25, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@coadlercoadlercoadler approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@EmyrkEmyrk

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Emyrk@coadler

[8]ページ先頭

©2009-2025 Movatter.jp