From 9718ae1a95292fda5de80ebb3381061f0f39d496 Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Thu, 9 Jan 2025 14:37:11 -0500 Subject: [PATCH] chore: add highlight for otel instrumentation (#1973) --- packages/fern-docs/bundle/src/instrumentation.ts | 14 +++++++++++--- turbo.json | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/fern-docs/bundle/src/instrumentation.ts b/packages/fern-docs/bundle/src/instrumentation.ts index 6a18b27cef..09285612f4 100644 --- a/packages/fern-docs/bundle/src/instrumentation.ts +++ b/packages/fern-docs/bundle/src/instrumentation.ts @@ -1,5 +1,13 @@ -import { registerOTel } from "@vercel/otel"; +import { OTLPHttpJsonTraceExporter, registerOTel } from "@vercel/otel"; -export function register(): void { - registerOTel({ serviceName: "fern-docs" }); +export function register() { + registerOTel({ + serviceName: "fern-docs", + traceExporter: new OTLPHttpJsonTraceExporter({ + url: "https://otel.highlight.io:4318/v1/traces", + }), + attributes: { + "highlight.project_id": process.env.HIGHLIGHT_PROJECT_ID_FERN_APP, + }, + }); } diff --git a/turbo.json b/turbo.json index a8ba663708..076cb7b733 100644 --- a/turbo.json +++ b/turbo.json @@ -88,7 +88,8 @@ "VERCEL_ENV", "VERCEL_URL", "WORKOS_API_KEY", - "WORKOS_CLIENT_ID" + "WORKOS_CLIENT_ID", + "HIGHLIGHT_PROJECT_ID_FERN_APP" ] } },