feat(telemetry): tag execution events with source_layer="comfyui"#963
Draft
deepme987 wants to merge 1 commit into
Draft
feat(telemetry): tag execution events with source_layer="comfyui"#963deepme987 wants to merge 1 commit into
deepme987 wants to merge 1 commit into
Conversation
Every event emitted from executionTap originates in the ComfyUI Python
subprocess (parsed from its stdout/stderr). Adding source_layer to the
shared baseContext makes engine-origin errors filterable in PostHog
without renaming the event family — so existing dashboards keep working
while triage gets a clean filter:
event = 'comfy.desktop.execution.error'
AND properties.source_layer = 'comfyui'
Covers all six emissions (started / completed / first_completed /
error x2 / session_summary). A new test asserts the tag is present on
every event family this tap emits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every event emitted from
src/main/lib/executionTap.ts(the 6comfy.desktop.execution.*event families) originates in the ComfyUI Python subprocess —executionTapexists purely to parseproc.stdout/proc.stderr. Today they all land in PostHog without any way to filter engine-origin from shell-origin.This PR adds
source_layer: 'comfyui'to the sharedbaseContext, so the tag is present on every emission with zero risk of any event family being missed.PostHog filter for triage becomes:
Why a property and not a new event-name namespace?
Considered renaming to
comfy.desktop.comfyui.execution.*(matches the existingcomfy.desktop.comfyui.boot_started/boot_log/exitednamespace). Decided against for now because:If we later want the cleaner namespace, the property tag makes a backfill migration easy.
Scope
Covers all 6 emissions in
executionTap.ts:comfy.desktop.execution.startedcomfy.desktop.execution.completedcomfy.desktop.execution.first_completedcomfy.desktop.execution.error(validation path)comfy.desktop.execution.error(traceback path)comfy.desktop.execution.session_summaryDiff is 2 files, +34/-1.
Test plan
source_layer === 'comfyui'on every event family this tap emits (executionTap.test.ts)executionTaptests still greenpnpm typecheckcleanpnpm lintcleanproperties.source_layeris populated on new events and the triage filter above returns expected volumeFollow-ups (not in this PR)
error_bucket = 'other'win32 cluster — 1,454 users producing ~21.5 errors/user each in the last 24h suggests a single common failure pattern that isn't being classified. Worth a sample-and-fingerprint pass.