Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlie-777 committed Jun 25, 2024
1 parent bcf4a15 commit 65715f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class AjaxTests extends AITestClass {
});

this.testCaseAsync({
name: "Dependencies Configuration: init with cs promise ikey promise",
name: "Dependencies Configuration: init with cs promise ikey promise and default enableAjaxPerfTracking",
stepDelay: 100,
useFakeTimers: true,
steps: [() => {
Expand Down
13 changes: 5 additions & 8 deletions extensions/applicationinsights-dependencies-js/src/ajax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,15 +597,12 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
_isUsingW3CHeaders = _distributedTracingMode === eDistributedTracingModes.AI_AND_W3C || _distributedTracingMode === eDistributedTracingModes.W3C;

if (_enableAjaxPerfTracking) {
let iKey = config.instrumentationKey || "unkwn";
// only change the ikey if it is string
let iKey = (config.instrumentationKey as string) || "unkwn";
// TODO: handle ikey promise
if (isString(iKey)) {
if (iKey.length > 5) {
_markPrefix = AJAX_MONITOR_PREFIX + strSubstring(iKey, iKey.length - 5) + ".";
} else {
_markPrefix = AJAX_MONITOR_PREFIX + iKey + ".";
}
if (iKey.length > 5) {
_markPrefix = AJAX_MONITOR_PREFIX + strSubstring(iKey, iKey.length - 5) + ".";
} else {
_markPrefix = AJAX_MONITOR_PREFIX + iKey + ".";
}

}
Expand Down

0 comments on commit 65715f3

Please sign in to comment.