fix: api db error metric (#2245)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
Main Workflow - Lint, Build, Test / python-env (push) Has been cancelled
Main Workflow - Lint, Build, Test / rust-env (push) Has been cancelled
Main Workflow - Lint, Build, Test / python-checks (push) Has been cancelled
Main Workflow - Lint, Build, Test / rust-checks (push) Has been cancelled
Main Workflow - Lint, Build, Test / clippy (mysql) (push) Has been cancelled
Main Workflow - Lint, Build, Test / clippy (postgres) (push) Has been cancelled
Main Workflow - Lint, Build, Test / clippy (spanner) (push) Has been cancelled
Main Workflow - Lint, Build, Test / clippy-release (mysql) (push) Has been cancelled
Main Workflow - Lint, Build, Test / clippy-release (postgres) (push) Has been cancelled
Main Workflow - Lint, Build, Test / clippy-release (spanner) (push) Has been cancelled
Main Workflow - Lint, Build, Test / build-and-unit-test-postgres (push) Has been cancelled
Main Workflow - Lint, Build, Test / build-postgres-image (push) Has been cancelled
Main Workflow - Lint, Build, Test / postgres-e2e-tests (push) Has been cancelled
Main Workflow - Lint, Build, Test / build-and-unit-test-mysql (push) Has been cancelled
Main Workflow - Lint, Build, Test / build-mysql-image (push) Has been cancelled
Main Workflow - Lint, Build, Test / mysql-e2e-tests (push) Has been cancelled
Main Workflow - Lint, Build, Test / build-and-unit-test-spanner (push) Has been cancelled
Main Workflow - Lint, Build, Test / build-spanner-image (push) Has been cancelled
Main Workflow - Lint, Build, Test / spanner-e2e-tests (push) Has been cancelled
Build, Tag and Push Container Images to GAR / check (push) Has been cancelled
Build, Tag and Push Container Images to GAR / build-and-push-syncstorage-rs (push) Has been cancelled
Build, Tag and Push Container Images to GAR / build-and-push-syncserver-postgres (push) Has been cancelled
Build, Tag and Push Container Images to GAR / build-and-push-syncstorage-rs-spanner-python-utils (push) Has been cancelled
Build, Tag and Push Container Images to GAR / build-and-push-syncserver-postgres-python-utils (push) Has been cancelled
Build, Tag and Push Container Images to GAR / build-and-push-syncserver-mysql (push) Has been cancelled
Publish Sync docs to pages / build-mdbook (push) Has been cancelled
Publish Sync docs to pages / build-openapi (push) Has been cancelled
Publish Sync docs to pages / combine-and-prepare (push) Has been cancelled
Publish Sync docs to pages / deploy (push) Has been cancelled

fix: api db error metric
This commit is contained in:
Taddes 2026-04-28 00:29:33 +03:00 committed by GitHub
parent e85b08bd73
commit bb0a8dec79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -178,14 +178,23 @@ impl ReportableError for DbError {
}
}
/// Whether to ignore a 13 - INTERNAL error based on its status
/// Whether to ignore a 13 - INTERNAL error based on its status message.
///
/// These errors are transient gRPC/HTTP2 transport errors that should be
/// emitted as metrics rather than reported to Sentry. The RST_STREAM variants
/// are safe to suppress because the server resets the stream before any
/// application state is changed, making them candidates for client retry.
/// Due to gPRC libs being a bit inconsistent with formatting, the array covers
/// possible variants.
fn is_ignored_internal(status: &grpcio::RpcStatus) -> bool {
let msg = status.message().to_lowercase();
[
"rst_stream",
"rst stream",
"received unexpected eos on data frame from server",
]
.contains(&status.message().to_lowercase().as_str())
.iter()
.any(|s| msg.contains(s))
}
impl InternalError for DbError {