NextJS app not connecting to OTel collector
No matter what I try, I could not get it to work
36 Replies
Project ID:
f5c73930-7763-4f58-ae1b-eb1d2215f7e2
f5c73930-7763-4f58-ae1b-eb1d2215f7e2
The same set up works locally
deploying with nixpacks or dockerfile?
nextjs is dockerfile, and the otel stack i'm using this template https://railway.app/template/7KNDff
i also changed this part for the collector so it fits the package
@vercel/otel
which is what i'm usingbut i'm not understanding why my nextjs container is not reaching otel collector in the private network
is the dockerfile alpine based?
for nextjs?
oh is that related to the networking thingy with alpine images?
yeah
does the nextjs app deploy with an alpine based dockerfile?
yeah
brah
ur the doctor
rebuilding it now
any luck?
seems to work but i went on a tangent
i saw on the docs that you can use private url to reduce latency, so tryna doing with redis
the thing is tat
ioredis?
yeah but why do you need redis during build?
idek, it's just a weird thing with the node-redis library
where u have to explicitly call connect() before doing anything
if you get errors always show me them, otherwise im just guessing
sorry that wasn't the right context
i have this issue after switching to REDIS_PRIVATE_URL
yeah why are you connecting to redis during build?
i think nextjs compiler steps thru the code during build and it triggers that connect() function. but i need that there so i can maintain a connection with redis
i haven't figured out another solution
dynamically swap between public and private urls then
alr
i got it to work
awesome
the fix was just simply this
and the traces are coming thru jaeger nicely
thank you very much! i really appreciate it
awesome, happy to help where I can
the last one lol, do u know how to secure jaeger and prometheus ui?
proxy/oauth sidecar?
I've never used that stack before, it's Melissa's template right?
yeas
ooh right, i'll do that
yeah railways documentation pages all come with an accompanying help thread!
just noticed that, really nice