aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workers/workerUtils.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2026-02-08 01:33:48 +0000
committerGitHub <noreply@github.com>2026-02-08 01:33:48 +0000
commitb2640803745636e87e42f5460759093f49df9d04 (patch)
tree965f020a5c81b1805c19b2a2b8a3a434d06b1e1e /apps/workers/workerUtils.ts
parent9e5693c6e4b410d1af05cc3d50c89ff73f21e060 (diff)
downloadkarakeep-b2640803745636e87e42f5460759093f49df9d04.tar.zst
feat(metrics): add prometheus metric for bookmark crawl latency (#2461)
Track the time from bookmark creation to crawl completion as a histogram (karakeep_bookmark_crawl_latency_seconds). This measures the end-to-end latency users experience when adding bookmarks via extension, web, etc. Excludes recrawls (crawledAt already set) and imports (low priority jobs). https://claude.ai/code/session_019jTGGXGWzK9C5aTznQhdgz Co-authored-by: Claude <noreply@anthropic.com>
Diffstat (limited to 'apps/workers/workerUtils.ts')
-rw-r--r--apps/workers/workerUtils.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/workers/workerUtils.ts b/apps/workers/workerUtils.ts
index a99f2103..48e3b277 100644
--- a/apps/workers/workerUtils.ts
+++ b/apps/workers/workerUtils.ts
@@ -31,6 +31,8 @@ export async function getBookmarkDetails(bookmarkId: string) {
return {
url: bookmark.link.url,
userId: bookmark.userId,
+ createdAt: bookmark.createdAt,
+ crawledAt: bookmark.link.crawledAt,
screenshotAssetId: bookmark.assets.find(
(a) => a.assetType == AssetTypes.LINK_SCREENSHOT,
)?.id,