Skip to content

Commit 4480562

Browse files
update CDN tag
1 parent 1577bef commit 4480562

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/appConfigurationImpl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
233233
featureFlagTracing: this.#featureFlagTracing,
234234
fmVersion: this.#fmVersion,
235235
aiConfigurationTracing: this.#aiConfigurationTracing,
236-
isCdnUsed: this.#isCdnUsed
236+
isAfdUsed: this.#isCdnUsed
237237
};
238238
}
239239

src/requestTracing/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const REPLICA_COUNT_KEY = "ReplicaCount";
5151
export const KEY_VAULT_CONFIGURED_TAG = "UsesKeyVault";
5252
export const KEY_VAULT_REFRESH_CONFIGURED_TAG = "RefreshesKeyVault";
5353
export const FAILOVER_REQUEST_TAG = "Failover";
54-
export const CDN_USED_TAG = "CDN";
54+
export const AFD_USED_TAG = "AFD";
5555

5656
// Compact feature tags
5757
export const FEATURES_KEY = "Features";

src/requestTracing/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
HostType,
2828
KEY_VAULT_CONFIGURED_TAG,
2929
KEY_VAULT_REFRESH_CONFIGURED_TAG,
30-
CDN_USED_TAG,
30+
AFD_USED_TAG,
3131
KUBERNETES_ENV_VAR,
3232
NODEJS_DEV_ENV_VAL,
3333
NODEJS_ENV_VAR,
@@ -51,7 +51,7 @@ export interface RequestTracingOptions {
5151
initialLoadCompleted: boolean;
5252
replicaCount: number;
5353
isFailoverRequest: boolean;
54-
isCdnUsed: boolean;
54+
isAfdUsed: boolean;
5555
featureFlagTracing: FeatureFlagTracingOptions | undefined;
5656
fmVersion: string | undefined;
5757
aiConfigurationTracing: AIConfigurationTracingOptions | undefined;
@@ -123,7 +123,7 @@ function createCorrelationContextHeader(requestTracingOptions: RequestTracingOpt
123123
FFFeatures: Seed+Telemetry
124124
UsersKeyVault
125125
Failover
126-
CDN
126+
AFD
127127
*/
128128
const keyValues = new Map<string, string | undefined>();
129129
const tags: string[] = [];
@@ -155,8 +155,8 @@ function createCorrelationContextHeader(requestTracingOptions: RequestTracingOpt
155155
if (requestTracingOptions.isFailoverRequest) {
156156
tags.push(FAILOVER_REQUEST_TAG);
157157
}
158-
if (requestTracingOptions.isCdnUsed) {
159-
tags.push(CDN_USED_TAG);
158+
if (requestTracingOptions.isAfdUsed) {
159+
tags.push(AFD_USED_TAG);
160160
}
161161
if (requestTracingOptions.replicaCount > 0) {
162162
keyValues.set(REPLICA_COUNT_KEY, requestTracingOptions.replicaCount.toString());

test/requestTracing.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe("request tracing", function () {
121121
sinon.restore();
122122
});
123123

124-
it("should have cdn tag in correlation-context header when loadFromAzureFrontDoor is used", async () => {
124+
it("should have AFD tag in correlation-context header when loadFromAzureFrontDoor is used", async () => {
125125
try {
126126
await loadFromAzureFrontDoor(fakeEndpoint, {
127127
clientOptions,
@@ -134,10 +134,10 @@ describe("request tracing", function () {
134134
expect(headerPolicy.headers.get("User-Agent")).satisfy((ua: string) => ua.startsWith("javascript-appconfiguration-provider"));
135135
const correlationContext = headerPolicy.headers.get("Correlation-Context");
136136
expect(correlationContext).not.undefined;
137-
expect(correlationContext.includes("CDN")).eq(true);
137+
expect(correlationContext.includes("AFD")).eq(true);
138138
});
139139

140-
it("should not have cdn tag in correlation-context header when load is used", async () => {
140+
it("should not have AFD tag in correlation-context header when load is used", async () => {
141141
try {
142142
await load(createMockedConnectionString(fakeEndpoint), {
143143
clientOptions,
@@ -149,7 +149,7 @@ describe("request tracing", function () {
149149
expect(headerPolicy.headers).not.undefined;
150150
const correlationContext = headerPolicy.headers.get("Correlation-Context");
151151
expect(correlationContext).not.undefined;
152-
expect(correlationContext.includes("CDN")).eq(false);
152+
expect(correlationContext.includes("AFD")).eq(false);
153153
});
154154

155155
it("should detect env in correlation-context header", async () => {

0 commit comments

Comments
 (0)