Skip to content

Commit

Permalink
add blob ID to telemetry (#4784)
Browse files Browse the repository at this point in the history
Add blob ID to telemetry in createBlob() and readBlobCore() in SPO driver.
  • Loading branch information
wes-carlson authored Jan 11, 2021
1 parent 41be5b7 commit af422ff
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions packages/drivers/odsp-driver/src/odspDocumentStorageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,19 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
eventName: "createBlob",
size: file.length,
},
async () => this.epochTracker.fetchAndParseAsJSON<api.ICreateBlobResponse>(
url,
{
body: file,
headers,
method: "POST",
},
FetchType.createBlob,
),
async (event) => {
const res = await this.epochTracker.fetchAndParseAsJSON<api.ICreateBlobResponse>(
url,
{
body: file,
headers,
method: "POST",
},
FetchType.createBlob,
);
event.end({ blobId: res.content.id });
return res;
},
);
});

Expand All @@ -217,6 +221,7 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
this.logger,
{
eventName: "readDataBlob",
blobId,
headers: Object.keys(headers).length !== 0 ? true : undefined,
waitQueueLength: this.epochTracker.rateLimiter.waitQueueLength,
},
Expand Down

0 comments on commit af422ff

Please sign in to comment.