Skip to content

Conversation

@JacksonWeber
Copy link
Contributor

@JacksonWeber JacksonWeber commented Jun 25, 2025

This pull request introduces a new StatsbeatFeaturesManager utility class for managing statsbeat features and instrumentation using bitmap flags, updates the handling of statsbeat features in the TelemetryClient class, and adds comprehensive unit tests for these changes. The most important changes include the creation of the StatsbeatFeaturesManager, updates to the TelemetryClient to track instance counts and enable the MULTI_IKEY feature, and the addition of new unit tests for both the StatsbeatFeaturesManager and TelemetryClient.

Feature Management Enhancements:

  • Introduced the StatsbeatFeaturesManager utility class to manage statsbeat features and instrumentation using bitmap flags. This includes methods to enable, disable, and check the status of specific features or instrumentation. (src/shared/util/statsbeatFeaturesManager.ts, src/shared/util/statsbeatFeaturesManager.tsR1-R123)
  • Added the CUSTOMER_STATSBEAT and MULTI_IKEY features to the StatsbeatFeature enum for enhanced feature tracking. (src/shim/types.ts, src/shim/types.tsR354-R355)

TelemetryClient Updates:

  • Updated the TelemetryClient to track the number of instances created and enable the MULTI_IKEY feature when multiple instances are initialized. (src/shim/telemetryClient.ts, src/shim/telemetryClient.tsR53-R59)
  • Integrated the StatsbeatFeaturesManager into the TelemetryClient to manage feature flags dynamically. (src/shim/telemetryClient.ts, src/shim/telemetryClient.tsL29-R37)

Unit Tests:

  • Added unit tests for the StatsbeatFeaturesManager, covering initialization, feature management, instrumentation management, and error handling for malformed environment variables. (test/unitTests/shared/util/statsbeatFeaturesManager.tests.ts, test/unitTests/shared/util/statsbeatFeaturesManager.tests.tsR1-R145)
  • Extended the TelemetryClient unit tests to validate instance count tracking and the enabling of the MULTI_IKEY feature when multiple instances are created. (test/unitTests/shim/telemetryClient.tests.ts, test/unitTests/shim/telemetryClient.tests.tsR367-R498)This update is intended to allow us to track multiple telemetry client usage in feature statsbeat.

@JacksonWeber JacksonWeber requested review from Copilot and hectorhdzg and removed request for Copilot June 25, 2025 19:55
@JacksonWeber JacksonWeber changed the title Add Support for Tracking Multi iKey Usage Add Support for Tracking Multi iKey Usage & Feature Statsbeat Handler Jun 27, 2025
Copy link
Member

@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

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

LGTM

@JacksonWeber JacksonWeber merged commit 8033d83 into microsoft:main Jun 27, 2025
16 checks passed
@JacksonWeber JacksonWeber mentioned this pull request Jul 25, 2025
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