Conversation
|
A few things to consider in the new telemetry wiring:
|
|
|
||
| this._video.addEventListener('ended', () => { | ||
| this.$accessor.video.setPlayable(false) | ||
| getTelemetry().track('stream_play_started', 'info', { ended: true }) |
There was a problem hiding this comment.
Wrong telemetry event for video ended handler
Medium Severity
The video ended event handler tracks stream_play_started which is semantically incorrect. When a video finishes playing, the telemetry reports that playback started, which produces misleading data. This appears to be a copy-paste error or incorrect event type selection.
| const usagePercent = Math.round((memory.usedJSHeapSize / memory.jsHeapSizeLimit) * 100) | ||
|
|
||
| // Warn if memory usage is high | ||
| const severity = usagePercent > 80 ? 'warning' : usagePercent > 90 ? 'error' : 'debug' |
There was a problem hiding this comment.
Memory severity threshold order prevents error detection
Medium Severity
The ternary chain usagePercent > 80 ? 'warning' : usagePercent > 90 ? 'error' : 'debug' has incorrect threshold ordering. Since > 80 is checked first, any value above 80 (including 95%) returns 'warning', and the > 90 condition for 'error' is never reached. The thresholds need to be checked in descending order: > 90 first, then > 80.
| sampleCount: this.fpsValues.length, | ||
| }) | ||
| } | ||
| }, 10000) |
There was a problem hiding this comment.
FPS reporting interval is never cleared on uninstall
Medium Severity
The setInterval for FPS reporting is never assigned to a variable, so it cannot be cleared in uninstall(). Unlike memoryMonitorId which is properly stored and cleared, this interval continues running indefinitely even after the collector is uninstalled, causing a resource leak and potentially continuing to call telemetry methods on a destroyed service.
telemetry for neko client
usage
data points
api endpoint payload
example from local docker run
{ "batchId": "mkc3pb62-27jgux5qy", "events": [ { "eventId": "mkc3pauc-9bpqwzkcz", "eventType": "session_start", "severity": "info", "timestamp": 1768279070244, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 1, "data": { "session": { "sessionId": "mkc3patd-axs7otq1v", "startTime": 1768279070209, "pageUrl": "http://localhost:8080/", "referrer": "", "device": { "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36", "platform": "Linux x86_64", "language": "en-US", "languages": [ "en-US", "en" ], "cookiesEnabled": true, "doNotTrack": null, "hardwareConcurrency": 8, "maxTouchPoints": 0, "deviceMemory": 8, "connection": { "effectiveType": "4g", "downlink": 10, "rtt": 50, "saveData": false } }, "screen": { "width": 1536, "height": 776, "availWidth": 1536, "availHeight": 776, "colorDepth": 24, "pixelRatio": 1, "orientation": "landscape-primary" }, "viewport": { "width": 981, "height": 689 }, "browser": { "name": "Chrome", "version": "143.0", "engine": "Blink", "webrtcSupported": true, "webglSupported": false, "cookiesEnabled": true }, "timezone": "UTC", "timezoneOffset": 0 } } }, { "eventId": "mkc3paud-i307pegcb", "eventType": "app_init", "severity": "info", "timestamp": 1768279070245, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 2 }, { "eventId": "mkc3pave-lsxjmkwty", "eventType": "app_ready", "severity": "info", "timestamp": 1768279070282, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 3, "data": { "mountTime": 1768279070282 } }, { "eventId": "mkc3paw9-rpmqfufp8", "eventType": "action_login", "severity": "info", "timestamp": 1768279070313, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 4, "data": { "displayname": "kernel", "timestamp": 1768279070313 } }, { "eventId": "mkc3pax3-4fnm83lm9", "eventType": "perf_long_task", "severity": "info", "timestamp": 1768279070343, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 5, "data": { "duration": 162, "startTime": 155.89999997615814, "containerType": "window", "containerSrc": "", "containerId": "", "containerName": "" } }, { "eventId": "mkc3pay1-e2g78op3s", "eventType": "action_resolution_change", "severity": "info", "timestamp": 1768279070377, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 6, "data": { "width": 1920, "height": 1080, "rate": 25, "timestamp": 1768279070377 } }, { "eventId": "mkc3pay2-plos0o09d", "eventType": "connection_webrtc_connected", "severity": "info", "timestamp": 1768279070378, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 7, "data": { "serverInitComplete": true, "implicitHosting": true, "fileTransferEnabled": false, "heartbeatInterval": 10, "locksConfigured": 0, "timestamp": 1768279070378 } }, { "eventId": "mkc3pazx-7wz2qkm9d", "eventType": "perf_page_load", "severity": "info", "timestamp": 1768279070445, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 8, "performance": { "domContentLoaded": 313.89999997615814, "domComplete": 336.0999999642372, "loadEventEnd": 336.30000001192093, "ttfb": 3, "resourceCount": 8, "transferSize": 300, "usedJSHeapSize": 6454737, "totalJSHeapSize": 8600853, "jsHeapSizeLimit": 2248146944 } }, { "eventId": "mkc3pb56-bi5rkbc46", "eventType": "connection_webrtc_ice_state", "severity": "info", "timestamp": 1768279070634, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 9, "connection": { "state": "checking", "iceConnectionState": "checking" } }, { "eventId": "mkc3pb62-o691807d4", "eventType": "connection_webrtc_ice_state", "severity": "info", "timestamp": 1768279070666, "sessionId": "mkc3patd-axs7otq1v", "sequenceNumber": 10, "connection": { "state": "connected", "iceConnectionState": "connected" } } ], "session": { "sessionId": "mkc3patd-axs7otq1v", "startTime": 1768279070209, "pageUrl": "http://localhost:8080/", "referrer": "", "device": { "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36", "platform": "Linux x86_64", "language": "en-US", "languages": [ "en-US", "en" ], "cookiesEnabled": true, "doNotTrack": null, "hardwareConcurrency": 8, "maxTouchPoints": 0, "deviceMemory": 8, "connection": { "effectiveType": "4g", "downlink": 10, "rtt": 50, "saveData": false } }, "screen": { "width": 1536, "height": 776, "availWidth": 1536, "availHeight": 776, "colorDepth": 24, "pixelRatio": 1, "orientation": "landscape-primary" }, "viewport": { "width": 981, "height": 689 }, "browser": { "name": "Chrome", "version": "143.0", "engine": "Blink", "webrtcSupported": true, "webglSupported": false, "cookiesEnabled": true }, "timezone": "UTC", "timezoneOffset": 0 }, "sentAt": 1768279070666, "retryCount": 0 }next
[ @rgarcia ]
Note
Adds a production-ready telemetry system with runtime config and broad instrumentation across the client.
src/telemetry/*) with service, types, and collectors:errors,performance(incl. Core Web Vitals/FPS/memory), andconnectionplugins/telemetryinitializes telemetry early, exposes$telemetry, and installs collectors;installTelemetryConnectionCollectorhooks intoNekoClientafter initvideo.vueemits telemetry for playback, volume, PiP, fullscreen, and stream events;neko/index.tstracks system init, disconnects, errors, and resolution changes;plugins/neko.tsforwards client errors/info/debug to telemetry and sets server infotelemetry-config.jsfrompublic/index.html(populated at startup) with only two flags:TELEMETRY_ENDPOINT(enables telemetry) andTELEMETRY_CAPTURE(filter); query params supported for testingwrapper.shgeneratestelemetry-config.js;run-docker.shandrun-unikernel.shpass TELEMETRY_* env varsvue.config.jsdefinesVUE_APP_TELEMETRY_*for optional build-time configurationmain.tsinstalls telemetry before other plugins and attaches the connection collector after$clientinitWritten by Cursor Bugbot for commit 61b0ed5. This will update automatically on new commits. Configure here.