opentelemetry-demo
opentelemetry-demo copied to clipboard
Frontend example not working locally
Docker compose was able to start all services with the command below (as per docs here):
docker compose run --service-ports -e NODE_ENV=development --volume $(pwd)/src/frontend:/app --volume $(pwd)/pb:/app/pb --user node --entrypoint sh frontend
It opened the shell to the container. As per docs, I ran npm run dev, which gave the error below (same happens if using yarn):
/app $ yarn dev
yarn run v1.22.19
$ npm run grpc:generate && NODE_OPTIONS='-r ./utils/telemetry/Instrumentation.js' next dev
> [email protected] grpc:generate
> mkdir -p ./protos && protoc -I ./pb --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=esModuleInterop=true --ts_proto_out=./protos --ts_proto_opt=outputServices=grpc-js demo.proto
./node_modules/.bin/protoc-gen-ts_proto: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--ts_proto_out: protoc-gen-ts_proto: Plugin failed with status code 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
hmm... I'm not sure those docs have been updated for a while, and many changes have taken place since. Instead of just deleting everything in that readme, can I ask the exact use case you are trying to do to ensure we guide you down the right path.
@puckpuck thanks for such a quick reply!
I'm trying to instrument my frontend, which is Next.js (specifically the browser side of it).
I have OTEL running in my own kubernetes cluster (backend is already properly instrumented), I exposed it via ingress so I can instrument the frontend apps, so I looked into Vercel's docs but it seems incomplete, as I'm not even sure where I can provide the OTLP trace exporter URL (the one I expose via ingress).
I just tried the above steps locally and did not get an error. Did you run npm install from the /src/frontend folder first?
@AlissonRS are you still having the issue if you run npm install first?
@AlissonRS please let me know if you still have this issue after running npm install. If not I will close this as resolved.
@puckpuck sorry for the delay, I just tested here and it worked fine after running npm install on the src/frontend folder.
Thanks for helping!