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

Fixing orgLocation in all the records #891

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
1 change: 0 additions & 1 deletion src/common/OneDSLoggerTelemetry/IEventTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ export interface ICustomEvent {
referrer? :string;
envId?: string;
referrerSource?: string;
orgGeo?: string;
sku?: string;
}
7 changes: 3 additions & 4 deletions src/common/OneDSLoggerTelemetry/oneDSLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class OneDSLogger implements ITelemetryLogger{
private static userInfo: IUserInfo = {oid: "", tid: "", puid: ""};
private static contextInfo: IContextInfo ;
private static userRegion : string = "";
private static orgGeo: string = "";

private readonly regexPatternsToRedact = [
/key["\\ ']*[:=]+["\\ ']*([a-zA-Z0-9]*)/igm,
Expand Down Expand Up @@ -131,7 +132,6 @@ export class OneDSLogger implements ITelemetryLogger{
referrer: "",
envId: "",
referrerSource: "",
orgGeo: "",
sku: ""
}
}
Expand Down Expand Up @@ -306,7 +306,7 @@ export class OneDSLogger implements ITelemetryLogger{
envelope.data.puid = OneDSLogger.userInfo?.puid;
envelope.data.context = JSON.stringify(OneDSLogger.contextInfo);
envelope.data.userRegion = OneDSLogger.userRegion;
envelope.data.orgGeo = OneDSLogger.contextInfo.orgGeo;
envelope.data.orgGeo = OneDSLogger.orgGeo;
// At the end of event enrichment, redact the sensitive data for all the applicable fields
// envelope = this.redactSensitiveDataFromEvent(envelope);
}
Expand Down Expand Up @@ -341,14 +341,13 @@ export class OneDSLogger implements ITelemetryLogger{
OneDSLogger.contextInfo.referrer = eventInfo.referrer ?? '';
OneDSLogger.contextInfo.envId = eventInfo.envId ?? '';
OneDSLogger.contextInfo.referrerSource = eventInfo.referrerSource ?? '';
OneDSLogger.contextInfo.orgGeo = eventInfo.orgGeo ?? '';
OneDSLogger.contextInfo.sku = eventInfo.sku ?? '';
}
if (envelope.data.eventName == telemetryEventNames.WEB_EXTENSION_DATAVERSE_AUTHENTICATION_COMPLETED) {
OneDSLogger.userInfo.oid = JSON.parse(envelope.data.eventInfo).userId;
}
if (envelope.data.eventName == telemetryEventNames.WEB_EXTENSION_ORG_GEO){
OneDSLogger.contextInfo.orgGeo = JSON.parse(envelope.data.eventInfo).orgGeo;
OneDSLogger.orgGeo = JSON.parse(envelope.data.eventInfo).orgGeo;
}
}

Expand Down
Loading