Skip to content
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

telemetry/add kedro_Viz_version to heaps #2194

Merged
merged 9 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Please follow the established format:
- Refactor `DatasetStatsHook` to avoid showing error when dataset doesn't have file size info (#2174)
- Fix 404 error when accessing the experiment tracking page on the demo site (#2179)
- Add check for port availability before starting Kedro Viz to prevent unintended browser redirects when the port is already in use (#2176)
- Include Kedro Viz version in telemetry.. (#2194)


# Release 10.0.0
Expand Down
4 changes: 3 additions & 1 deletion package/kedro_viz/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ async def index():
env = Environment(loader=FileSystemLoader(_HTML_DIR))
if should_add_telemetry:
telemetry_content = env.get_template("telemetry.html").render(
heap_app_id=heap_app_id, heap_user_identity=heap_user_identity
heap_app_id=heap_app_id,
heap_user_identity=heap_user_identity,
kedro_viz_version=__version__,
)
injected_head_content.append(telemetry_content)

Expand Down
1 change: 1 addition & 0 deletions public/telemetry.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};
heap.load("{{ heap_app_id }}");
heap.identify("{{ heap_user_identity }}");
heap.addEventProperties("{{ kedro_viz_version }}");
</script>
</head>
Loading