aksd: expand telemetry coverage for core workflows#785
Draft
gambtho wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands privacy-safe telemetry for core AKS Desktop workflows by adding a typed allowlist for aksd.* feature names, expanding closed vocabularies, and instrumenting key user journeys (auth, cluster add, namespace create, project delete) with lifecycle signals and categorical error reporting.
Changes:
- Introduces
AKS_FEATURE_TYPES/AksFeatureTypeand expandsKNOWN_FEATURE_TYPES+ERROR_AREASto cover additional workflows. - Adds a typed telemetry helper (
trackAksFeature) and a shared “surface opened” hook (useTelemetryFeatureOpened). - Instruments Azure auth, cluster registration, namespace creation, and project deletion flows; adds/extends Vitest coverage and adds design/plan docs.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/aks-desktop/src/telemetry/vocabulary.test.ts | Extends vocabulary assertions for new aksd.* feature types and error areas. |
| plugins/aks-desktop/src/telemetry/schema.ts | Adds AKS_FEATURE_TYPES + new error areas and wires them into known feature types. |
| plugins/aks-desktop/src/telemetry/aksFeature.ts | Adds typed trackAksFeature wrapper to funnel allowlisted lifecycle events. |
| plugins/aks-desktop/src/telemetry/aksFeature.test.ts | Tests typed forwarding + no-throw contract for the helper. |
| plugins/aks-desktop/src/hooks/useTelemetryFeatureOpened.ts | Adds reusable hook to emit a single opened event per mounted surface. |
| plugins/aks-desktop/src/hooks/useTelemetryFeatureOpened.test.ts | Tests “opened” emission behavior on mount/rerender. |
| plugins/aks-desktop/src/components/DeleteAKSProject/hooks/useProjectDeletion.ts | Adds project-delete lifecycle tracking and categorical error emission. |
| plugins/aks-desktop/src/components/DeleteAKSProject/hooks/useProjectDeletion.test.ts | Adds assertions for started/succeeded/failed and error-category emission behavior. |
| plugins/aks-desktop/src/components/DeleteAKSProject/AKSProjectDeleteButton.tsx | Tracks opened/cancelled around the delete confirmation UI. |
| plugins/aks-desktop/src/components/DeleteAKSProject/AKSProjectDeleteButton.test.tsx | Tests dialog open/cancel/confirm telemetry behavior. |
| plugins/aks-desktop/src/components/CreateNamespace/CreateNamespace.tsx | Adds opened/started/succeeded/failed/cancelled tracking with attempt-safety guards. |
| plugins/aks-desktop/src/components/CreateNamespace/CreateNamespace.test.tsx | Adds comprehensive lifecycle tests including cancellation/late-completion cases. |
| plugins/aks-desktop/src/components/AzureAuth/hooks/useAzureProfilePage.ts | Adds logout started/succeeded/failed telemetry and guards against unmount side-effects. |
| plugins/aks-desktop/src/components/AzureAuth/hooks/useAzureProfilePage.test.ts | Extends logout tests to validate lifecycle telemetry and unmount behavior. |
| plugins/aks-desktop/src/components/AzureAuth/AzureLoginPage.tsx | Adds login surface opened + attempt lifecycle telemetry with polling/unmount guards. |
| plugins/aks-desktop/src/components/AzureAuth/AzureLoginPage.test.tsx | Adds login telemetry tests for start/success/failure/timeout/cancel/unmount. |
| plugins/aks-desktop/src/components/AKS/RegisterAKSClusterPage.tsx | Emits surface opened and tracks cancelled when closing prior to terminal outcomes. |
| plugins/aks-desktop/src/components/AKS/RegisterAKSClusterPage.test.tsx | Tests opened/cancelled suppression behavior around terminal outcomes. |
| plugins/aks-desktop/src/components/AKS/RegisterAKSClusterDialog.tsx | Adds started/succeeded/failed + error-category telemetry around registration action. |
| plugins/aks-desktop/src/components/AKS/RegisterAKSClusterDialog.test.tsx | Tests lifecycle telemetry ordering and privacy-safe error reporting for registration. |
| docs/superpowers/specs/2026-07-19-telemetry-coverage-expansion-design.md | Documents the telemetry model, closed vocabularies, and workflow instrumentation contract. |
| docs/superpowers/plans/2026-07-19-telemetry-coverage-expansion.md | Provides an implementation plan and verification checklist for the telemetry expansion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+132
to
136
| } catch (error) { | ||
| trackAksFeature('aksd.project-delete', 'failed'); | ||
| trackError({ area: 'project-delete', errorClass: 'UnknownError', phase: 'failed' }); | ||
| throw error; | ||
| } |
Comment on lines
+171
to
+178
| expect(vi.getTimerCount()).toBe(0); | ||
| act(() => vi.runAllTimers()); | ||
| expect(telemetryMocks.trackAksFeature.mock.calls).toEqual([['aksd.auth-logout', 'started']]); | ||
| expect(telemetryMocks.trackError).not.toHaveBeenCalled(); | ||
| expect(dispatchSpy).not.toHaveBeenCalled(); | ||
| expect(mockPush).not.toHaveBeenCalled(); | ||
| expect(console.error).not.toHaveBeenCalled(); | ||
| }); |
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.
Description
Brief description of the changes made in this PR.
Type of Change
Related Issues
Closes #[issue number]
Related to #[issue number]
Changes Made
Testing
Test Cases
Describe the test cases that were run:
Screenshots/Videos
If applicable, add screenshots or videos to demonstrate the changes.
Checklist
Breaking Changes
If this is a breaking change, describe:
Performance Impact
Documentation Updates
Reviewer Notes
Any specific areas you'd like reviewers to focus on or questions you have.