-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat: improve event logging for queries + refactor #27943
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mistercrunch
force-pushed
the
log_queries
branch
from
April 9, 2024 16:17
4e2952e
to
0a8cfe4
Compare
mistercrunch
force-pushed
the
log_queries
branch
from
April 9, 2024 18:18
0a8cfe4
to
d524183
Compare
mistercrunch
commented
Apr 9, 2024
mistercrunch
commented
Apr 9, 2024
mistercrunch
commented
Apr 9, 2024
mistercrunch
commented
Apr 9, 2024
mistercrunch
force-pushed
the
log_queries
branch
from
April 11, 2024 18:41
dbc8783
to
0b7e976
Compare
The driver for this PR was to enrich event logging around database engine and database drivers for events that interact directly with analytics databases. Digging a bit into the logging code: - I realized that `request.form` is empty when pushing JSON payload, and `request.json` should be used. This should automatically capture more automated logging that parses context out of the request object proactively - Adding an event `execute_sql` that targets just that, that **isn't** called when hitting the cache for instance. Using the context manager insures capturing the duration of the call as well. - a bit of refactor here and there
mistercrunch
force-pushed
the
log_queries
branch
from
April 16, 2024 00:56
0b7e976
to
2943680
Compare
john-bodley
reviewed
Apr 16, 2024
john-bodley
added
risk:breaking-change
Issues or PRs that will introduce breaking changes
hold!
On hold
labels
Apr 16, 2024
mistercrunch
commented
Apr 16, 2024
mistercrunch
removed
risk:breaking-change
Issues or PRs that will introduce breaking changes
hold!
On hold
labels
Apr 16, 2024
betodealmeida
approved these changes
Apr 22, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Left a few suggestions.
Co-authored-by: Beto Dealmeida <[email protected]>
qleroy
pushed a commit
to qleroy/superset
that referenced
this pull request
Apr 28, 2024
Co-authored-by: Beto Dealmeida <[email protected]>
jzhao62
pushed a commit
to jzhao62/superset
that referenced
this pull request
May 16, 2024
Co-authored-by: Beto Dealmeida <[email protected]>
vinothkumar66
pushed a commit
to vinothkumar66/superset
that referenced
this pull request
Nov 11, 2024
Co-authored-by: Beto Dealmeida <[email protected]>
mistercrunch
added
🏷️ bot
A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels
🚢 4.1.0
labels
Nov 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
The main driver for this PR was to enrich event logging around database engine and database drivers for events that interact directly with analytics databases. While touching this up, I did some refactor along the way.
execute_sql
that targets just that, that isn't called when hitting the cache for instance. Using the context manager insures capturing the duration of the call as well.SQL_QUERY_MUTATOR
andMUTATE_AFTER_SPLIT
, where code had been copy/pasted and reimplemented in various places. Here I move it as a method of the Database model.request.form
is empty when posting JSON payload, andrequest.json
should be used instead. This should automatically capture more automated logging that parses context out of the request object proactivelypost_process_df
as it seemed logical to isolate this out ofget_df