Repository navigation
feat(telemetry): add global --biz-source for per-source PV/UV attribution (prepare 2.11.0) - #335
Merged
Merged
Conversation
…tion Global flag bizSource on all commands; buildSettings maps it into settings, tracker normalizes (NAME_PATTERN, blank/invalid->unknown) and reports TrackingEvent.bizSource to AEM ext plus dedicated flat column c6 for direct filtering. PV=event count, UV=distinct uid, segment by c6 + command path. Adds core/e2e tests and telemetry-change doc; regenerates skill reference.
Bump seven packages 2.10.5 -> 2.11.0; add bilingual CHANGELOG entry for the global --biz-source telemetry flag; sync SKILL metadata.
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
Add a unified, global
--biz-source <source>flag (flag keybizSource) available on all commands, so callers (skills / agents / products) can declare their business source. The value is reported through the telemetry module to enable per-source PV/UV analysis of command usage (includingflow-agent).Design
GLOBAL_FLAGS(packages/core/src/types/command.ts), so every command accepts--biz-sourceand it appears in global help / introspect. Description encourages skills/callers to pass their own name for attribution.Settings.bizSource(config/schema.ts) +buildSettingsmapping (config/loader.ts,flags.bizSource ?? undefined— explicit empty string preserved, not folded). Per-invocation only, not persisted.normalizeBizSource(telemetry/caller.ts) reuses the callerNAME_PATTERN(lowercase, spaces/underscores→dashes, bounded charset) to prevent PII. Absent → omitted; blank/invalid →"unknown".tracker.tsreadsdeps.settings.bizSource(no middleware change) →createTrackingEventsetsTrackingEvent.bizSource(goes to AEMext+ local JSONL).buildRemoteAemOptionsadditionally maps it to a dedicated flat columnc6(scalar string) for direct AEM filtering/grouping without JSON-parse dimension config. Not added toPARAM_ALLOWLIST(c1). c1–c5 already occupied; c6 free.c6(bizSource): PV = event count, UV = distinctuid; filter by command path (e.g.flow-agent *) for per-group source breakdown. Independent ofcallerType/callerName.Tests
core/tests/telemetry-tracker.test.ts: bizSource → event/ext/c6; normalization (valid/underscore/invalid/blank/empty); absent omits field+c6.core/tests/telemetry-caller.test.ts:normalizeBizSourceunit cases.core/tests/config-priority.test.ts: flag→settings mapping incl. empty-string preservation.cli/tests/e2e/registry.smoke.e2e.test.ts: global help includes--biz-source.config show --biz-source Cozewrites"bizSource":"coze"to local telemetry.jsonl.Docs
docs/agents/telemetry-change.md: TrackingEvent field list + AEM mapping table (c6), normalization, PV/UV semantics.sync:skill-assetsregenerated skill reference (new flag row + table column-width realignment).Verification
pnpm run check: 0 errors.||→??for explicit empty string).