Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
feat(otel): axiom
Gergő Móriczaaee6cc04d5a
diff --git a/apps/api/src/index.ts b/apps/api/src/index.tsindex 7818205bb..d23d71bda 100644--- a/apps/api/src/index.ts+++ b/apps/api/src/index.ts@@ -58,7 +58,9 @@ cacheableLookup.install(http.globalAgent);cacheableLookup.install(https.globalAgent);const shouldOtel =- process.env.LANGFUSE_PUBLIC_KEY || process.env.OTEL_EXPORTER_OTLP_ENDPOINT;+ process.env.LANGFUSE_PUBLIC_KEY ||+ process.env.OTEL_EXPORTER_OTLP_ENDPOINT ||+ process.env.AXIOM_API_KEY;const otelSdk = shouldOtel? new NodeSDK({resource: resourceFromAttributes({@@ -77,6 +79,19 @@ const otelSdk = shouldOtel),]: []),+ ...(process.env.AXIOM_API_KEY+ ? [+ new BatchSpanProcessor(+ new OTLPTraceExporter({+ url: "https://api.axiom.co/v1/traces",+ headers: {+ Authorization: `Bearer ${process.env.AXIOM_API_KEY}`,+ "X-Axiom-Dataset": "firecrawl",+ },+ }),+ ),+ ]+ : []),],instrumentations: [getNodeAutoInstrumentations()],})@@ -149,7 +164,7 @@ async function startServer(port = DEFAULT_PORT) {logger.error("Failed to initialize blocklist", { error });throw error;}-+// Attach WebSocket proxy to the Express appattachWsProxy(app);diff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.tsindex 82327ade3..4876ce413 100644--- a/apps/api/src/services/queue-worker.ts+++ b/apps/api/src/services/queue-worker.ts@@ -62,7 +62,9 @@ cacheableLookup.install(http.globalAgent);cacheableLookup.install(https.globalAgent);const shouldOtel =- process.env.LANGFUSE_PUBLIC_KEY || process.env.OTEL_EXPORTER_OTLP_ENDPOINT;+ process.env.LANGFUSE_PUBLIC_KEY ||+ process.env.OTEL_EXPORTER_OTLP_ENDPOINT ||+ process.env.AXIOM_API_KEY;const otelSdk = shouldOtel? new NodeSDK({resource: resourceFromAttributes({@@ -81,6 +83,19 @@ const otelSdk = shouldOtel),]: []),+ ...(process.env.AXIOM_API_KEY+ ? [+ new BatchSpanProcessor(+ new OTLPTraceExporter({+ url: "https://api.axiom.co/v1/traces",+ headers: {+ Authorization: `Bearer ${process.env.AXIOM_API_KEY}`,+ "X-Axiom-Dataset": "firecrawl",+ },+ }),+ ),+ ]+ : []),],instrumentations: [getNodeAutoInstrumentations()],})@@ -497,7 +512,10 @@ app.listen(workerPort, () => {});(async () => {- await initializeBlocklist().catch(e => { _logger.error("Failed to initialize blocklist", { error: e }); process.exit(1); });+ await initializeBlocklist().catch(e => {+ _logger.error("Failed to initialize blocklist", { error: e });+ process.exit(1);+ });await Promise.all([workerFun(getExtractQueue(), processExtractJobInternal),diff --git a/apps/api/src/services/worker/scrape-worker.ts b/apps/api/src/services/worker/scrape-worker.tsindex 1ddcf1ce1..5fedf6449 100644--- a/apps/api/src/services/worker/scrape-worker.ts+++ b/apps/api/src/services/worker/scrape-worker.ts@@ -1145,7 +1145,9 @@ export const processJobInternal = async (job: NuQJob<ScrapeJobData>) => {};const shouldOtel =- process.env.LANGFUSE_PUBLIC_KEY || process.env.OTEL_EXPORTER_OTLP_ENDPOINT;+ process.env.LANGFUSE_PUBLIC_KEY ||+ process.env.OTEL_EXPORTER_OTLP_ENDPOINT ||+ process.env.AXIOM_API_KEY;const otelSdk = shouldOtel? new NodeSDK({resource: resourceFromAttributes({@@ -1164,6 +1166,19 @@ const otelSdk = shouldOtel),]: []),+ ...(process.env.AXIOM_API_KEY+ ? [+ new BatchSpanProcessor(+ new OTLPTraceExporter({+ url: "https://api.axiom.co/v1/traces",+ headers: {+ Authorization: `Bearer ${process.env.AXIOM_API_KEY}`,+ "X-Axiom-Dataset": "firecrawl",+ },+ }),+ ),+ ]+ : []),],instrumentations: [getNodeAutoInstrumentations()],})