-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of Next js ^14 #3855
Comments
@vbuhaiov Thanks for opening the issue. Our hope is to support tracing of recent Next.js versions via OpenTelemetry support that Next.js has added to its core. The current Next.js instrumentation in the Elastic Node.js APM agent (experimental, and limited to We haven't yet had a chance to try to work through it, but this is how I see it working:
Really that should be the only required step. Unfortunately we don't have a current timeline for looking into this. Some notes/thoughts on troubleshooting this:
|
I'm using almost the same version and it's working (I also see the unsupported version but it seems it's not affecting) {
"name": "xxx",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": " NODE_OPTIONS=--require=elastic-apm-node/start-next.js dotenv -e ./../.env.local -- next dev",
"dev:build": "dotenv -e ./../.env.local -- next build",
"build": "next build",
"start": "NODE_OPTIONS=--require=elastic-apm-node/start-next.js next start -H 0.0.0.0",
"lint": "NODE_OPTIONS=--require=elastic-apm-node/start-next.js next lint",
"migrate:dev": "dotenv -e ./../.env.local -- npx prisma migrate dev",
"migrate:deploy": "dotenv -e -- npx prisma migrate deploy",
"migrate:format": "dotenv -e ./../.env.local -- npx prisma format",
"migrate:generate": "dotenv -e ./../.env.local -- npx prisma generate",
"migrate:reset": "dotenv -e ./../.env.local -- npx prisma migrate reset",
"db:seed": "dotenv -e ./../.env.local -- npx prisma db seed"
},
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},
"dependencies": {
"@prisma/client": "^5.9.1",
"console-log-level": "^1.4.1",
"dotenv-cli": "^7.3.0",
"elastic-apm-node": "^4.4.1",
"next": "14.1.0",
"openai": "^4.28.0",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@types/node": "^20.11.17",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/parser": "^7.0.2",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"postcss": "^8",
"prettier-eslint": "^16.3.0",
"prisma": "^5.9.1",
"tailwindcss": "^3.3.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
}
}
this is my elastic-apm-node.js file module.exports = {
serverUrl: process.env.ELASTIC_APM_SERVER_URL,
secretToken: process.env.ELASTIC_APM_SECRET_TOKEN,
active: true,
logLevel: "error",
logger: false,
verifyServerCert: false,
usePathAsTransactionName: true,
opentelemetryBridgeEnabled: false,
}; and this is my apm-server definition cat > apm_server.yaml <<EOF
apiVersion: apm.k8s.elastic.co/v1
kind: ApmServer
metadata:
name: pergamino-apm-server
namespace: $NAMESPACE
spec:
version: 8.12.1
count: 1
elasticsearchRef:
name: $PREFIX_NAME
kibanaRef:
name: $PREFIX_NAME
http:
tls:
selfSignedCertificate:
disabled: true
subjectAltNames:
- dns: pergamino-apm-server-apm-http.default.svc.cluster.local
EOF I hope this configuration helps someone. |
Do you have any estimations regarding support of nextjs 14 ?
Is your feature request related to a problem? Please describe.
Not able to use APM with the latest next js versions ^14.
No package was found during node ./server.js
Describe the solution you'd like
Increase a supported version to the ^14
Describe alternatives you've considered
No alternatives, it is not supported and the build does not work
Additional context
./package.json
"dependencies": {
"elastic-apm-node": "^4.4.0",
"next": "14.1.0"
},
Dockerfile
FROM node:18-alpine AS base
The text was updated successfully, but these errors were encountered: