Pass over dashboard and chart IDs to DB_CONNECTION_MUTATOR
See original GitHub issueIs your feature request related to a problem? Please describe.
Right now all superset queries have the same source of SQL_LAB
, EXPLORE
or DASHBOARD
. We are encountering many issues with single poorly written dashboards/widgets stalling the whole Presto cluster. The industry standard for fixing this is providing more granular source information, like dashboard and widget ID, so dev ops can easily track offenders. Right now we have to resort to roll calling in our data science Slack channel asking if anyone has added a particular query to the dashboard.
Describe the solution you’d like
I want to extend the DB_CONNECTION_MUTATOR
function API to accept a dictionary of additional source information like dashboard ID, chart/widget ID, so this configurable function cat assemble an appropriate Presto connection. This feature can be as well used for other databases as well. Presto stands here as a prime example which our team has to deal with.
Describe alternatives you’ve considered
I’ve considered accessing Flask’s request
directly from the DB_CONNECTION_MUTATOR
in order to extract the necessary data, but I found that some queries run asynchronously through Celery, where the request
information is lost.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Looks like some info is already passed in https://github.com/apache/superset/blob/11a2d4dfdd42bed78c913d0b2b1563e077425acf/superset/models/core.py#L363
Adding a
context
param to the function signature seems like it could cover future use cases as well.This sounds reasonable, I think it’s at least worth opening up a PR to your upstream.