Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate ikey #1817

Merged
merged 7 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion AISKU/src/Initialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
IChannelControls, hasWindow, hasDocument, isReactNative, doPerf, IDiagnosticLogger, INotificationManager, objForEachKey, proxyAssign, proxyFunctions,
arrForEach, isString, isFunction, isNullOrUndefined, isArray, throwError, ICookieMgr, addPageUnloadEventListener, addPageHideEventListener,
createUniqueNamespace, ITelemetryPlugin, IPlugin, ILoadedPlugin, UnloadHandler, removePageUnloadEventListener, removePageHideEventListener,
ITelemetryInitializerHandler, ITelemetryUnloadState, mergeEvtNamespace, _throwInternal
ITelemetryInitializerHandler, ITelemetryUnloadState, mergeEvtNamespace, _throwInternal,strUndefined
} from "@microsoft/applicationinsights-core-js";
import { AnalyticsPlugin, ApplicationInsights } from "@microsoft/applicationinsights-analytics-js";
import { Sender } from "@microsoft/applicationinsights-channel-js";
Expand Down Expand Up @@ -179,6 +179,11 @@ export class Initialization implements IApplicationInsights {
const ingest = cs.ingestionendpoint;
config.endpointUrl = ingest ? `${ingest}/v2/track` : config.endpointUrl; // only add /v2/track when from connectionstring
config.instrumentationKey = cs.instrumentationkey || config.instrumentationKey;
} else {
var _console = typeof console !== strUndefined ? console : null;
Karlie-777 marked this conversation as resolved.
Show resolved Hide resolved
if (_console && _console.warn) {
_console.warn("Instrumentation key based ingestion will be no longer supported, please use connection string instead.");
Karlie-777 marked this conversation as resolved.
Show resolved Hide resolved
}
}

_self.appInsights = new AnalyticsPlugin();
Expand Down
7 changes: 6 additions & 1 deletion shared/AppInsightsCommon/src/TelemetryItemCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
import { ITelemetryItem, IDiagnosticLogger, objForEachKey, isNullOrUndefined, toISOString, throwError } from "@microsoft/applicationinsights-core-js";
import { ITelemetryItem, IDiagnosticLogger, objForEachKey, isNullOrUndefined, toISOString, throwError, strUndefined } from "@microsoft/applicationinsights-core-js";
import { strNotSpecified, strIkey } from "./Constants";


Expand Down Expand Up @@ -35,6 +35,11 @@ export function createTelemetryItem<T>(item: T,
if (item[strIkey]) {
iKey = item[strIkey];
delete item[strIkey];
//TODO: add connectionString Config
var _console = typeof console !== strUndefined ? console : null;
Karlie-777 marked this conversation as resolved.
Show resolved Hide resolved
if (_console && _console.warn) {
_console.warn("Instrumentation key based ingestion will be no longer supported.");
}
}

const telemetryItem: ITelemetryItem = {
Expand Down