Add Support for Tracking Multi iKey Usage & Feature Statsbeat Handler #1438
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.
This pull request introduces a new
StatsbeatFeaturesManagerutility class for managing statsbeat features and instrumentation using bitmap flags, updates the handling of statsbeat features in theTelemetryClientclass, and adds comprehensive unit tests for these changes. The most important changes include the creation of theStatsbeatFeaturesManager, updates to theTelemetryClientto track instance counts and enable theMULTI_IKEYfeature, and the addition of new unit tests for both theStatsbeatFeaturesManagerandTelemetryClient.Feature Management Enhancements:
StatsbeatFeaturesManagerutility 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)CUSTOMER_STATSBEATandMULTI_IKEYfeatures to theStatsbeatFeatureenum for enhanced feature tracking. (src/shim/types.ts, src/shim/types.tsR354-R355)TelemetryClientUpdates:TelemetryClientto track the number of instances created and enable theMULTI_IKEYfeature when multiple instances are initialized. (src/shim/telemetryClient.ts, src/shim/telemetryClient.tsR53-R59)StatsbeatFeaturesManagerinto theTelemetryClientto manage feature flags dynamically. (src/shim/telemetryClient.ts, src/shim/telemetryClient.tsL29-R37)Unit Tests:
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)TelemetryClientunit tests to validate instance count tracking and the enabling of theMULTI_IKEYfeature 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.