Skip to content

Commit 02e1cf1

Browse files
authored
Merge pull request #112 from microsoft/lramos15/romantic-mandrill
Fix empty props and measurements in pipeline
2 parents c77fda6 + 3f927c1 commit 02e1cf1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/common/baseTelemetryReporter.ts

+9
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ export class BaseTelemetryReporter {
304304
const cleanProperties = this.cloneAndChange(properties, (_key: string, prop: string) => this.anonymizeFilePaths(prop, this.firstParty));
305305
properties = this.removePropertiesWithPossibleUserInfo(cleanProperties);
306306
}
307+
// The pipeline doesn't like undefined measurements or properties bag so at least send an empty object
308+
properties = properties ?? {};
309+
measurements = measurements ?? {};
307310
eventName = `${this.extensionId}/${eventName}`;
308311
this.telemetryAppender.logEvent(eventName, { properties, measurements });
309312
}
@@ -369,6 +372,9 @@ export class BaseTelemetryReporter {
369372
});
370373
properties = this.removePropertiesWithPossibleUserInfo(cleanProperties);
371374
}
375+
// The pipeline doesn't like undefined measurements or properties bag so at least send an empty object
376+
properties = properties ?? {};
377+
measurements = measurements ?? {};
372378
eventName = `${this.extensionId}/${eventName}`;
373379
this.telemetryAppender.logEvent(eventName, { properties, measurements });
374380
}
@@ -423,6 +429,9 @@ export class BaseTelemetryReporter {
423429
}
424430
properties = this.removePropertiesWithPossibleUserInfo(cleanProperties);
425431
}
432+
// The pipeline doesn't like undefined measurements or properties bag so at least send an empty object
433+
properties = properties ?? {};
434+
measurements = measurements ?? {};
426435
this.telemetryAppender.logException(error, { properties, measurements });
427436
}
428437
}

0 commit comments

Comments
 (0)