UMD-ARLIS / superset-risc

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
1 stars 0 forks source link

Investigate how to embed client side instrumentation in Superset #1

Open poorejc opened 3 years ago

poorejc commented 3 years ago

We need to instrument Superset with Apache Flagon (https://github.com/apache/incubator-flagon-useralejs) in order to capture user behaviors from Superset's use with Data.

instrumentation means adding Flagon as either script or module (npm) in the Superset build, and adding additional json fnxs or scripts to configure settings and custom loggings.

this task also requires that we understand how Superset internally communicates with its components. We want to instrument client-backend interfaces as well as client-user interface.

DOD:

  1. Identify which src files will take script tag refs or module (includes, requires, const) for UserALE
  2. Identify how to build additional src files (UserALE configs) into build pipleline
  3. Identify classes and methods used for comms (e.g., xmlhttps, fetch, websocket)
EandrewJones commented 3 years ago

Looks like the devs created a specific file for propagating custom js scripts across the platform. See tail_js_custom_extra.html in the templates.

That is imported by base.html and basic.html which all the other templates extend/are built on top of. Should be able to add a script call to Flagon/UserALE there and call any json fnxs / custom logging scripts as needed. That should cover all client-user interface interactions.

As for client-backend I/O, not so sure. But all the backend pieces should be loaded and registered during init which located in the superset.initialization module:

__init__.py

Then it's just a matter of figuring out the comms systems for all these pieces.

poorejc commented 3 years ago

@EandrewJones +1 Awesome. I forgot do you have prior experience with Superset?

EandrewJones commented 3 years ago

@poorejc No, but it just so happens to be built using Flask, with which I have extensive experience. All production-level flask apps follow a fairly uniform rubric.

ploats commented 3 years ago

The tail_js_custom_extra.html worked to inject the Flagon UserALE.js into the views - along with adding the actual minimized javascript to superset/static.

Next step to attempt to build the back-end to do some more tailoring.