Closed noklam closed 1 month ago
@noklam In term of Kedro-Viz right now we have only two actions.
kedro.getProjectData
. kedro.goToDefinitionFromFlowchart
LSP command to open relevant file.So we can go with Python and use kedro-telemetry
.
For now, I decide to first understand how kedro-viz
track telemetry and how the consent flow work.
I realise kedro-telemetry
is not a complete solution since by default the extension will not execute the hook (ofcourse we can manually trigger it). We can borrow the consent logic from kedro-telemetry
by vendoring the library.
For the actual telemetry tracking, I prefer to trigger this in TS since we can track the usage of command directly (compare to tracking it from requests to language server indirectly), this is also much easier to extend in the future.
In the meantime, I have some conversation with @ravi-kumar-pilla to research on viz's telemetry. I aim to kick start this work this week so we can finished it before the release (1st or 2nd week of September).
In the meantime, I have some conversation with @ravi-kumar-pilla to research on viz's telemetry. I aim to kick start this work this week so we can finished it before the release (1st or 2nd week of September).
Some information on how Telemetry works internally in Viz -
GET
request (I.e., initial doc request at home page and ET). heap_app_id
and heap_user_identity
, we inject them into telemetry.html and then append the telemetry.html file into the section of index.html file. @noklam lets connect to discuss if this is not clear. Thank you
If I understand it correctly, telemetry.html
is only appended to the UI if heap_app_id
and heap_user_identity
is not null (this is, consented). This is, btw outdated with how kedro-telemetry
works today as viz re-implement some logic from kedor-telemetry
, in the latest kedro-telemetry
, we introduced a user ID that stored in a different place. (This maybe something that viz need to look into Cc @DimedS ).
So the main "consent" flow is still done in Python, via mimic kedro-telemetry
@app.get("/")
@app.get("/experiment-tracking")
async def index():
heap_app_id = kedro_telemetry.get_heap_app_id(project_path)
heap_user_identity = kedro_telemetry.get_heap_identity()
How should I understand this code? Does that mean only the index page will check for consent but not the others?
How should I understand this code? Does that mean only the index page will check for consent but not the others?
This includes everything on viz. All other routes are subpaths
after finishing framework telemetry opt-out, I created a ticket about consent check and UUID update in viz, some discussion is also there: https://github.com/kedro-org/kedro-viz/issues/2020
Thanks a lot @ravi-kumar-pilla ! Now I have the full picture of how telemetry would work in the extension. So Heap has 3 ways to track information.
AFAIK, the flowchart currently will not collect telemetry, because it's not served via the kedro-viz
FastAPI route (see comments above). The most important thing to track now is the run of command "Kedro: Run Kedro Viz", to give us some sense how many people are trying to launch that view.
To achieve that, we need to implement this in two place:
kedro-telemetry
as a consent flow and get the user id, this information need to return to the extension later.KedroViz
reach component need a new prop, and take the consent & user id information.
telemetry.html
into webview in similar way if consent is given.Cc @jitu5
We have download stats but we need a bit more details to help making decision for feature development.
We will introduce
kedro viz
command within the extension, we can add telemetry to get some insight about the usage. From my understanding, viz itself tracks the UI click but it wouldn't be sufficient to tell if it's from VSCode.Questions
Do we implement the telemetry in TS or Python? This may depends on what do we want to track.
Python
Pro:
kedro-telemetry
for consentCon:
TS
Pro:
Con: