Skip to content

Conversation

@Jaylyn-Barbee
Copy link
Contributor

@Jaylyn-Barbee Jaylyn-Barbee commented Dec 12, 2025

Adding events to track the following:

Event Name Description Data collected
Microsoft.PowerToys.LightSwitch_EnableLightSwitch Triggered when Light Switch is enabled or disabled. Whether the module is enabled or disabled (bool)
Microsoft.PowerToys.LightSwitch_ShortcutInvoked Occurs when the shortcut for Light Switch is invoked.
Microsoft.PowerToys.LightSwitch_ScheduleModeToggled Occurs when a new schedule mode is selected for Light Switch. The new mode selected (string)
Microsoft.PowerToys.LightSwitch_ThemeTargetChanged Occurs when the options for targeting the system or apps is updated. The new options selected (two bools)

The above events that are related to Light Switch settings are tracked in the "LoadSettings" function inside the service but only if the value has changed. The Enabled event as well as the Shortcut event are tracked in the module interface.

@github-actions

This comment has been minimized.

@Jaylyn-Barbee Jaylyn-Barbee changed the title Adding telemetry events for Light Switch [Light Switch] Adding telemetry events Dec 12, 2025
@Jaylyn-Barbee Jaylyn-Barbee marked this pull request as ready for review December 17, 2025 15:09
@vanzue vanzue requested a review from Copilot December 18, 2025 02:46
Copy link
Contributor

Copilot AI left a comment

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 adds comprehensive telemetry tracking to the Light Switch module to monitor user engagement with various features. The implementation follows PowerToys' telemetry patterns using TraceBase and TraceLoggingWriteWrapper, ensuring events respect privacy settings. Telemetry events are triggered only when settings change or when users invoke actions.

Key changes:

  • Added new telemetry infrastructure in LightSwitchService with trace.h/trace.cpp files
  • Integrated telemetry calls in LoadSettings to track schedule mode and theme target changes
  • Added telemetry in module interface to track enable/disable state and shortcut invocations
  • Updated DATA_AND_PRIVACY.md with Light Switch telemetry event documentation

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/modules/LightSwitch/LightSwitchService/trace.h Defines telemetry class structure for Light Switch events, inheriting from TraceBase
src/modules/LightSwitch/LightSwitchService/trace.cpp Implements four telemetry events: Enable, ShortcutInvoked, ScheduleModeToggled, and ThemeTargetChanged
src/modules/LightSwitch/LightSwitchService/LightSwitchSettings.cpp Integrates telemetry calls when schedule mode or theme target settings change
src/modules/LightSwitch/LightSwitchModuleInterface/dllmain.cpp Adds telemetry tracking for module enable/disable and shortcut invocations
DATA_AND_PRIVACY.md Documents the four new telemetry events with descriptions matching the implementation

@vanzue
Copy link
Contributor

vanzue commented Dec 18, 2025

You could use Telemetry Real-Time Tool to verify the event actually fires and the schema is expected, and after that done, I can approve this

@github-actions

This comment has been minimized.

Copy link
Contributor

@vanzue vanzue left a comment

Choose a reason for hiding this comment

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

Looks good, make sure these events can be found in the windows telemetry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants