-
Notifications
You must be signed in to change notification settings - Fork 16
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: adds Superset usage metadata charts to Operator Dashboard #488
Conversation
adapted from https://github.com/hometogo/hometogo-data-code-snippets * Dashboard available to Admins and Operators. * Accesses superset mysql with a dedicated, read-only user * Imports database, datasets, charts, and dashboard
Thanks for the pull request, @pomegranited! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
offset: 0 | ||
cache_timeout: null | ||
schema: {{SUPERSET_DB_METADATA_NAME}} | ||
sql: "select\nl.dttm as action_date,\ncase \n when lower(l.action)\ |
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.
note: original query used PostgreSQL's date_trunc('day', l.dttm) as action_date
here.
MySQL's equivalent is extract(day from l.dttm) as action_date
, but this caused errors in the charts, so I left the l.dttm
datetime field as-is.
The CI is failing because the final |
Was causing an error when loading the dashboard.
and deletes references to chart IDs -- they are not needed.
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 good, thanks for taking this on! Just requesting the one change.
# Superset metadata user (read-only) | ||
mysql -u {{ MYSQL_ROOT_USERNAME }} --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e "CREATE USER IF NOT EXISTS '{{ SUPERSET_DB_METADATA_USERNAME }}';" | ||
mysql -u {{ MYSQL_ROOT_USERNAME }} --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e "ALTER USER '{{ SUPERSET_DB_METADATA_USERNAME }}'@'%' IDENTIFIED BY '{{ SUPERSET_DB_METADATA_PASSWORD }}';" | ||
mysql -u {{ MYSQL_ROOT_USERNAME }} --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e "GRANT SELECT, EXECUTE ON {{ SUPERSET_DB_METADATA_NAME }}.* TO '{{ SUPERSET_DB_METADATA_USERNAME }}'@'%';" |
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.
Can we limit this to the tables we need? I'm somewhat concerned about things like access to the dbs
table which stores credentials in plaintext.
@Ian2012 do you have a ticket or an ETA for the configmap changes? I'm likely going to run into this myself in my next PR. |
@bmtcril not sure, the plan is to build the image with the assets.yml file bundled in it and extend it via configmap |
aabf13e
to
60d0f37
Compare
I've addressed your review @bmtcril . I can work on adding Clickhouse performance metrics next week, or as part of a separate PR, if you'd prefer. |
I think a separate pr would be good. That could probably all go in the existing ClickHouse tab in the operator dash. |
👍 Should these Superset charts go in the Operator Dashboard too? I can easily move the tabs over there if that's better. |
@pomegranited If you can put these in the operator dash that would be great, it should help with keeping the permissions easy. Otherwise I think once you get past the current errors and rebase, this should be good to go. |
…r dashboard and moves the assets to their new location in the repo after changes on latest main.
because we can't grant table-specific permissions for tables that do not exist yet. Step 1: unchanged Step 2: Grants SELECT access to superset metadata tables created by Superset migrations
Ready for another review @bmtcril @Ian2012 . I've:
|
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, thanks for all the hard work and iteration!
@pomegranited 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Adds a Superset tab to the Operator Dashboard with some introspection charts adapted from https://github.com/hometogo/hometogo-data-code-snippets. (I omitted charts tracking "naming conventions" and charts counting datasets over time, as these didn't seem interesting to the Aspects project.)
Closes: #427
Screenshots
Author Notes & Concerns