Skip to content

Improve query logging #17388

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

Merged
merged 8 commits into from
Oct 31, 2022
Merged

Improve query logging #17388

merged 8 commits into from
Oct 31, 2022

Conversation

jsteemann
Copy link
Contributor

@jsteemann jsteemann commented Oct 19, 2022

Scope & Purpose

Backport of #17300
Docs PR: arangodb/docs#1140

  • Added startup option --query.log-failed to optionally log all failed AQL queries to the server log. The option is turned off by default, by can be turned on for development or debugging.
  • Added startup option --query.log-memory-usage-threshold to optionally log all AQL queries that have a peak memory usage larger than the configured value.
  • Added startup option --query.max-artifact-log-length to control the cutoff length for logged query strings and bind parameter values. This allows truncating large query strings and bind parameter values to reasonable lengths. Previously the cutoff value was hard-coded.
  • Additionally logs peak memory usage of queries for slow queries and failed queries.
  • 💩 Bugfix
  • 🍕 New feature
  • 🔥 Performance improvement
  • 🔨 Refactoring/simplification

Checklist

  • Tests
    • Regression tests
    • C++ Unit tests
    • integration tests
    • resilience tests
  • 📖 CHANGELOG entry made
  • 📚 documentation written (release notes, API changes, ...)
  • Backports

Related Information

@jsteemann jsteemann added this to the 3.9 milestone Oct 19, 2022
This was referenced Oct 19, 2022
@jsteemann jsteemann changed the title log failed queries Improve query logging Oct 19, 2022
Copy link
Member

@neunhoef neunhoef left a comment

Choose a reason for hiding this comment

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

LGTM

@CryptoNinjaGeek
Copy link
Contributor

@cla-bot

@jsteemann jsteemann requested a review from mpoeter October 19, 2022 15:04
@CryptoNinjaGeek
Copy link
Contributor

@cta-bot check

@cla-bot cla-bot bot added the cla-signed label Oct 19, 2022
if (!_resultCode.has_value()) {
ensureExecutionTime();

if (!_resultCode.has_value()) { // TODO possible data race here
Copy link
Contributor

Choose a reason for hiding this comment

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

What about this TODO? Should we address it here? If not, do we have a ticket?

@@ -400,6 +403,46 @@ void QueryRegistryFeature::collectOptions(
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden))
.setIntroducedIn(30800)
.setDeprecatedIn(30900);

options
->addOption("--query.max-artifact-log-length",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it be set to 0 to (more or less) allow any length?

@KVS85 KVS85 merged commit 5baca79 into 3.9 Oct 31, 2022
@KVS85 KVS85 deleted the feature-3.9/log-failed-queries branch October 31, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants