feat: auth metric and trace (#4063)

This commit is contained in:
X1a0t authored and GitHub committed 2023-09-05 21:20:06 -07:00
1 parent d29514c995
commit ef3d3a34e2
9 files changed
+143 -42

No files matched your search

@@ -1,6 +1,6 @@
import {
deleteBlobMutation,
fetchWithReport,
fetchWithTraceReport,
listBlobsQuery,
setBlobMutation,
} from '@affine/graphql';
@@ -12,7 +12,7 @@ export const createCloudBlobStorage = (workspaceId: string): BlobStorage => {
return {
crud: {
get: async key => {
return fetchWithReport(
return fetchWithTraceReport(
runtimeConfig.serverUrlPrefix +
`/api/workspaces/${workspaceId}/blobs/${key}`
).then(res => res.blob());
@@ -1,5 +1,5 @@
import { DebugLogger } from '@affine/debug';
import { fetchWithReport } from '@affine/graphql';
import { fetchWithTraceReport } from '@affine/graphql';
import type { ActiveDocProvider, DocProviderCreator } from '@blocksuite/store';
import { Workspace } from '@blocksuite/store';
import type { Doc } from 'yjs';
@@ -17,7 +17,7 @@ export async function downloadBinaryFromCloud(
if (hashMap.has(`${rootGuid}/${pageGuid}`)) {
return true;
}
const response = await fetchWithReport(
const response = await fetchWithTraceReport(
runtimeConfig.serverUrlPrefix +
`/api/workspaces/${rootGuid}/docs/${pageGuid}`
);