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

Setting to enable or disable DB query logging #575

Merged
merged 10 commits into from
Sep 3, 2024

Conversation

kmcginnes
Copy link
Collaborator

@kmcginnes kmcginnes commented Aug 30, 2024

Description

Adds a new setting for enabling or disabling logging of the database queries for Graph Explorer operations.

  • Default value is disabled
  • Applies to all queries across all connections that use the proxy server
  • Setting is communicated to the server through a new HTTP header db-query-logging-enabled
  • If the setting is missing it is assumed disabled

Other changes

I went down some alternative paths that contained some cleanup of existing code. I'm including those here, but can break them out to a separate PR if desired.

  • Don't log requests for CORS OPTIONS method to reduce logger noise
  • Updated random data functions for tests so that when generating undefined values the properties won't be on the resulting object
    • In JavaScript prop: undefined is treated differently than an "undefined" prop (a prop that doesn't exist on an object)
  • Move configuration merging logic to a separate function (no logic changed)
    • Added some tests around the configuration merging logic
    • Added type for user styling
    • Added activeConfigSelector to get the config that is active out of the Map (similar to activeSchemaSelector)
  • Added concrete type for the options param to Explorer functions (was any before)

Validation

CleanShot 2024-08-30 at 16 42 10@2x

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0
    license.
  • I have run pnpm checks to ensure code compiles and meets standards.
  • I have run pnpm test to check if all tests are passing.
  • I have covered new added functionality with unit tests if necessary.
  • I have added an entry in the Changelog.md.

@kmcginnes kmcginnes marked this pull request as ready for review August 30, 2024 22:15
@kmcginnes kmcginnes merged commit 63128ec into aws:main Sep 3, 2024
1 check passed
@kmcginnes kmcginnes deleted the logging-db-query-setting branch September 3, 2024 20:13
@kmcginnes kmcginnes mentioned this pull request Sep 3, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants