Skip to content

aksd: expand telemetry coverage for core workflows#785

Draft
gambtho wants to merge 1 commit into
Azure:mainfrom
gambtho:telemetry-coverage-expansion
Draft

aksd: expand telemetry coverage for core workflows#785
gambtho wants to merge 1 commit into
Azure:mainfrom
gambtho:telemetry-coverage-expansion

Conversation

@gambtho

@gambtho gambtho commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

Brief description of the changes made in this PR.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • CI/CD changes
  • Other: **___**

Related Issues

Closes #[issue number]
Related to #[issue number]

Changes Made

  • List the specific changes made
  • Include any architectural decisions
  • Mention any dependencies added/removed

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Performance tested (if applicable)
  • Accessibility tested (if applicable)

Test Cases

Describe the test cases that were run:

  1. Test case 1
  2. Test case 2
  3. Test case 3

Screenshots/Videos

If applicable, add screenshots or videos to demonstrate the changes.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Breaking Changes

If this is a breaking change, describe:

  • What breaks
  • How to migrate
  • Timeline for deprecation

Performance Impact

  • No performance impact
  • Performance improved
  • Performance degraded (explain why this is acceptable)

Documentation Updates

  • README.md updated
  • API documentation updated
  • Code comments updated
  • User guide updated
  • No documentation updates needed

Reviewer Notes

Any specific areas you'd like reviewers to focus on or questions you have.

Copilot AI review requested due to automatic review settings July 22, 2026 00:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/AksFeatureType and expands KNOWN_FEATURE_TYPES + ERROR_AREAS to 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();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants