Skip to content

Commit b7dc2f9

Browse files
committed
track whether enhanced feature flags were loaded
1 parent 42c37a0 commit b7dc2f9

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/appConfigurationImpl.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
9797
#fmVersion: string | undefined;
9898
#aiConfigurationTracing: AIConfigurationTracingOptions | undefined;
9999
#useSnapshotReference: boolean = false;
100+
#useEnhancedFeatureFlag: boolean = false;
100101

101102
// Refresh
102103
#refreshInProgress: boolean = false;
@@ -240,7 +241,8 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
240241
fmVersion: this.#fmVersion,
241242
aiConfigurationTracing: this.#aiConfigurationTracing,
242243
isAfdUsed: this.#isAfdUsed,
243-
useSnapshotReference: this.#useSnapshotReference
244+
useSnapshotReference: this.#useSnapshotReference,
245+
useEnhancedFeatureFlag: this.#useEnhancedFeatureFlag
244246
};
245247
}
246248

@@ -675,6 +677,9 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
675677
this.#featureFlagTracing.reset();
676678
}
677679

680+
// Track whether enhanced feature flags were loaded.
681+
this.#useEnhancedFeatureFlag = featureFlags.length > 0;
682+
678683
// Exclude any classic feature flags that are superseded by a standalone feature flag with the same name.
679684
const ineligibleClassicFfKeys = new Set(featureFlags.map(ff => featureFlagPrefix + ff.name));
680685
const eligibleClassicFeatureFlags = await Promise.all(

src/requestTracing/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const KEY_VAULT_REFRESH_CONFIGURED_TAG = "RefreshesKeyVault";
5353
export const FAILOVER_REQUEST_TAG = "Failover";
5454
export const AFD_USED_TAG = "AFD";
5555
export const SNAPSHOT_REFERENCE_TAG = "SnapshotRef";
56+
export const ENHANCED_FEATURE_FLAG_TAG = "EnhFF";
5657

5758
// Compact feature tags
5859
export const FEATURES_KEY = "Features";

src/requestTracing/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import {
3535
DELIMITER,
3636
AI_CONFIGURATION_TAG,
3737
AI_CHAT_COMPLETION_CONFIGURATION_TAG,
38-
SNAPSHOT_REFERENCE_TAG
38+
SNAPSHOT_REFERENCE_TAG,
39+
ENHANCED_FEATURE_FLAG_TAG
3940
} from "./constants.js";
4041

4142
export interface RequestTracingOptions {
@@ -49,6 +50,7 @@ export interface RequestTracingOptions {
4950
fmVersion: string | undefined;
5051
aiConfigurationTracing: AIConfigurationTracingOptions | undefined;
5152
useSnapshotReference: boolean;
53+
useEnhancedFeatureFlag: boolean;
5254
}
5355

5456
// Utils
@@ -161,6 +163,9 @@ function createFeaturesString(requestTracingOptions: RequestTracingOptions): str
161163
if (requestTracingOptions.useSnapshotReference) {
162164
tags.push(SNAPSHOT_REFERENCE_TAG);
163165
}
166+
if (requestTracingOptions.useEnhancedFeatureFlag) {
167+
tags.push(ENHANCED_FEATURE_FLAG_TAG);
168+
}
164169
return tags.join(DELIMITER);
165170
}
166171

0 commit comments

Comments
 (0)