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

database_observability: log schema name in query samples #2444

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

cristiangreco
Copy link
Collaborator

PR Description

Capture and log schema name in query samples fetched from mysql.

Which issue(s) this PR fixes

n.a.

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@cristiangreco cristiangreco marked this pull request as ready for review January 17, 2025 16:33
@cristiangreco cristiangreco requested review from matthewnolf and a team as code owners January 17, 2025 16:33
continue
}
}

stmt, err := sqlparser.Parse(sampleText)
if err != nil {
level.Error(c.logger).Log("msg", "failed to parse sql query", "digest", digest, "err", err)
level.Error(c.logger).Log("msg", "failed to parse sql query", "digest", digest, "schema", schemaName, "err", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we use schemaName before digest. For consistency with other messages, and also to go from broad -> specific to help with log searching

Capture and log schema name in query samples fetched from mysql.
@cristiangreco cristiangreco force-pushed the cristian/dbo11y-query-sample-schema branch from 7727a1b to ae58553 Compare January 20, 2025 11:20
@cristiangreco cristiangreco enabled auto-merge (squash) January 20, 2025 11:24
@cristiangreco cristiangreco merged commit fa8c111 into main Jan 20, 2025
18 checks passed
@cristiangreco cristiangreco deleted the cristian/dbo11y-query-sample-schema branch January 20, 2025 11:27
clayton-cornell pushed a commit that referenced this pull request Jan 21, 2025
database_observability: log schema name in query samples

Capture and log schema name in query samples fetched from mysql.
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.

2 participants