Skip to content

Add telemetry support for CLI modules#46872

Open
MuyuanMS wants to merge 4 commits intomainfrom
user/muyuanli/cli_telemetry
Open

Add telemetry support for CLI modules#46872
MuyuanMS wants to merge 4 commits intomainfrom
user/muyuanli/cli_telemetry

Conversation

@MuyuanMS
Copy link
Copy Markdown

Summary of the Pull Request

This PR adds comprehensive localization and telemetry support to the modules with CLI (FileLocksmith, Awake, ImageResizer), improving user experience for international users and enabling usage tracking for product insights.

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

- FileLocksmith: log actual operation mode (query, kill, query-wait,
  query-json, help) instead of hardcoded 'filelocksmith'
- ImageResizerCLICommandEvent: initialize CommandName to string.Empty
  for consistency with AwakeCLICommandEvent
- Update DATA_AND_PRIVACY.md to document FileLocksmith operation modes
- Add command_name assertions to FileLocksmith CLI tests
Copy link
Copy Markdown
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 new telemetry events for CLI invocations across Image Resizer, Awake, and File Locksmith, and documents the new events in the repository’s diagnostic data catalog.

Changes:

  • Add managed telemetry event types for Awake and Image Resizer CLI execution.
  • Emit CLI telemetry from ImageResizerCLI and FileLocksmithCLI (including command mode tracking for File Locksmith).
  • Update DATA_AND_PRIVACY.md to document the new CLI telemetry events.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/modules/imageresizer/ui/Cli/Telemetry/ImageResizerCLICommandEvent.cs Adds Image Resizer CLI telemetry event payload type.
src/modules/imageresizer/ImageResizerCLI/Program.cs Emits Image Resizer CLI telemetry after execution.
src/modules/FileLocksmith/FileLocksmithLib/Trace.h Adds File Locksmith CLI telemetry API surface.
src/modules/FileLocksmith/FileLocksmithLib/Trace.cpp Implements ETW event for File Locksmith CLI telemetry.
src/modules/FileLocksmith/FileLocksmithCLI/CLILogic.h Extends command result to include a command name for telemetry.
src/modules/FileLocksmith/FileLocksmithCLI/CLILogic.cpp Populates command name across CLI flows (help/query/kill/wait/json).
src/modules/FileLocksmith/FileLocksmithCLI/main.cpp Registers provider and emits CLI command telemetry.
src/modules/FileLocksmith/FileLocksmithCLI/tests/FileLocksmithCLITests.cpp Updates unit tests to assert the new command_name output.
src/modules/awake/Awake/Telemetry/AwakeCLICommandEvent.cs Adds Awake CLI telemetry event payload type.
src/modules/awake/Awake/Program.cs Attempts to emit Awake CLI telemetry on success/failure paths.
DATA_AND_PRIVACY.md Documents new CLI telemetry events for Awake, File Locksmith, and Image Resizer.

- Awake: move LogCLITelemetry before Exit() calls since
  Manager.CompleteExit calls Environment.Exit, making code
  after Exit() unreachable
- ImageResizer: derive CommandName from actual operation
  (help, show-config, error, resize) instead of hardcoded 'resize',
  via new CommandName property on ImageResizerCliExecutor
@MuyuanMS
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@moooyo
Copy link
Copy Markdown
Contributor

moooyo commented Apr 10, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@niels9001 niels9001 added the 0.99 label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants