chore: Add tracing around key presenters

This commit is contained in:
Tom Moor
2022-04-27 18:59:17 -07:00
parent 576497eca1
commit d8fed83736
4 changed files with 28 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
import { escapeRegExp } from "lodash";
import { APM } from "@server/logging/tracing";
import { Document } from "@server/models";
import Attachment from "@server/models/Attachment";
import parseAttachmentIds from "@server/utils/parseAttachmentIds";
@@ -29,7 +30,7 @@ async function replaceImageAttachments(text: string) {
return text;
}
export default async function present(
async function present(
document: Document,
options: Options | null | undefined = {}
) {
@@ -81,3 +82,8 @@ export default async function present(
return data;
}
export default APM.traceFunction({
serviceName: "presenter",
spanName: "document",
})(present);