Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: copy newrelic config file into worker container (#2549)

Max Deichmann7e05729e935c
diff --git a/web/Dockerfile b/web/Dockerfile
index d6bcd71c44..bdcbb84b7b 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -3,8 +3,6 @@ FROM --platform=${BUILDPLATFORM:-linux/amd64} node:20-alpine3.20 AS alpine
# It's important to update the index before installing packages to ensure you're getting the latest versions.
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 libc6-compat busybox ssl_client
-# required for newrelic event loop metrics
-RUN apk add --no-cache build-base
FROM --platform=${BUILDPLATFORM:-linux/amd64} alpine AS base
RUN npm install turbo@^1.13.3 --global
diff --git a/web/src/new-relic-instrumentation.ts b/web/src/new-relic-instrumentation.ts
index ab539d6534..ba26431e52 100644
--- a/web/src/new-relic-instrumentation.ts
+++ b/web/src/new-relic-instrumentation.ts
@@ -3,7 +3,7 @@ import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentation
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
import { Resource } from "@opentelemetry/resources";
import { SEMRESATTRS_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
-import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-node";
+import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-node";
import { PrismaInstrumentation } from "@prisma/instrumentation";
import {
awsEksDetector,
@@ -22,9 +22,11 @@ const sdk = new NodeSDK({
[SEMRESATTRS_SERVICE_NAME]: "web",
}),
spanProcessors: [
- new SimpleSpanProcessor(
+ new BatchSpanProcessor(
new OTLPTraceExporter({
- url: process.env.OTLP_ENDPOINT || "https://otlp.eu01.nr-data.net",
+ url:
+ process.env.OTLP_ENDPOINT ||
+ "https://otlp.eu01.nr-data.net/v1/traces",
headers: {
"api-key": process.env.NEW_RELIC_API_KEY,
},
diff --git a/worker/Dockerfile b/worker/Dockerfile
index d814f0c435..15db1b503c 100644
--- a/worker/Dockerfile
+++ b/worker/Dockerfile
@@ -3,8 +3,7 @@ FROM --platform=${BUILDPLATFORM:-linux/amd64} node:20-alpine3.20 AS alpine
# It's important to update the index before installing packages to ensure you're getting the latest versions.
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 libc6-compat busybox ssl_client
-# required for newrelic event loop metrics
-RUN apk add --no-cache build-base
+
FROM --platform=${BUILDPLATFORM:-linux/amd64} alpine AS base
RUN npm install turbo@^1.13.3 --global
@@ -59,6 +58,7 @@ RUN addgroup --system --gid 1001 expressjs
RUN adduser --system --uid 1001 expressjs
USER expressjs
COPY --from=builder --chown=expressjs:expressjs /app .
+COPY --chown=expressjs:expressjs ./worker/newrelic.js ./newrelic.js
EXPOSE 3030
ENV PORT=3030
diff --git a/worker/newrelic.js b/worker/newrelic.js
index e24b0eff94..e0d912c4e6 100644
--- a/worker/newrelic.js
+++ b/worker/newrelic.js
@@ -18,4 +18,9 @@ exports.config = {
logging: {
enabled: false,
},
+ application_logging: {
+ forwarding: {
+ enabled: false,
+ },
+ },
};