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

sql: add separate log channel for statements that fail with errors #141941

Open
michae2 opened this issue Feb 24, 2025 · 0 comments
Open

sql: add separate log channel for statements that fail with errors #141941

michae2 opened this issue Feb 24, 2025 · 0 comments
Labels
A-logging In and around the logging infrastructure. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs T-sql-queries SQL Queries Team

Comments

@michae2
Copy link
Collaborator

michae2 commented Feb 24, 2025

It's occasionally useful to examine all statement executions that failed with an error. (Similar to examination of a dead letter queue to diagnose problems.) We have a couple ways to do this today, but all are painful:

  1. Log all statement executions to SQL_EXEC by setting sql.trace.log_statement_execute or sql.log.all_statements.enabled. This is a firehose and not suitable for production clusters.
  2. Log slow executions to SQL_PERF (a.k.a. the slow query log) by setting sql.log.slow_query.latency_threshold and hope that some of the slow executions are also failures. This misses any failures under the threshold.
  3. Turn on slow query tracing with sql.trace.stmt.enable_threshold or sql.trace.txn.enable_threshold. This is also not suitable for production clusters as it imposes a performance penalty on every query execution, and it might not necessarily find statement failures.

It would be much more straightforward to create a log channel devoted to statement execution failures.

Jira issue: CRDB-48089

@michae2 michae2 added A-logging In and around the logging infrastructure. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs T-sql-queries SQL Queries Team labels Feb 24, 2025
@github-project-automation github-project-automation bot moved this to Triage in SQL Queries Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-logging In and around the logging infrastructure. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs T-sql-queries SQL Queries Team
Projects
Status: Triage
Development

No branches or pull requests

1 participant