mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 01:11:25 +00:00
Add tracing events for tracking query execution and upload documents (#2100)
* Add tracing for Execute (submit) query and Upload documents * Trace query closer to iterator operation * Add warnings to values used in Fabric * Fix format * Don't trace execute queries for filtering calls * Remove tracing call for documents tab filtering * Fix failing unit test. --------- Co-authored-by: Jade Welton <jawelton@microsoft.com> Co-authored-by: Sevo Kukol <sevoku@microsoft.com>
This commit is contained in:
@@ -1044,9 +1044,22 @@ export default class Collection implements ViewModels.Collection {
|
||||
}
|
||||
|
||||
public async uploadFiles(files: FileList): Promise<{ data: UploadDetailsRecord[] }> {
|
||||
const data = await Promise.all(Array.from(files).map((file) => this.uploadFile(file)));
|
||||
|
||||
return { data };
|
||||
try {
|
||||
TelemetryProcessor.trace(Action.UploadDocuments, ActionModifiers.Start, {
|
||||
nbFiles: files.length,
|
||||
});
|
||||
const data = await Promise.all(Array.from(files).map((file) => this.uploadFile(file)));
|
||||
TelemetryProcessor.trace(Action.UploadDocuments, ActionModifiers.Success, {
|
||||
nbFiles: files.length,
|
||||
});
|
||||
return { data };
|
||||
} catch (error) {
|
||||
TelemetryProcessor.trace(Action.UploadDocuments, ActionModifiers.Failed, {
|
||||
error: getErrorMessage(error),
|
||||
errorStack: getErrorStack(error),
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
private uploadFile(file: File): Promise<UploadDetailsRecord> {
|
||||
|
||||
Reference in New Issue
Block a user