NextJS app not connecting to OTel collector

felixngfenderHOBBY

a year ago

No matter what I try, I could not get it to work

0 Replies

felixngfenderHOBBY

a year ago

f5c73930-7763-4f58-ae1b-eb1d2215f7e2


felixngfenderHOBBY

a year ago

The same set up works locally


a year ago

deploying with nixpacks or dockerfile?


felixngfenderHOBBY

a year ago

nextjs is dockerfile, and the otel stack i'm using this template https://railway.app/template/7KNDff


felixngfenderHOBBY

a year ago

i also changed this part for the collector so it fits the package @vercel/otel which is what i'm using

1218439527128109000


felixngfenderHOBBY

a year ago

but i'm not understanding why my nextjs container is not reaching otel collector in the private network


a year ago

is the dockerfile alpine based?


felixngfenderHOBBY

a year ago

for nextjs?


felixngfenderHOBBY

a year ago

oh is that related to the networking thingy with alpine images?


a year ago

yeah


a year ago

does the nextjs app deploy with an alpine based dockerfile?


felixngfenderHOBBY

a year ago

yeah


felixngfenderHOBBY

a year ago

brah


felixngfenderHOBBY

a year ago

ur the doctor


felixngfenderHOBBY

a year ago

rebuilding it now


a year ago

any luck?


felixngfenderHOBBY

a year ago

seems to work but i went on a tangent

1218452865245515800


felixngfenderHOBBY

a year ago

i saw on the docs that you can use private url to reduce latency, so tryna doing with redis


felixngfenderHOBBY

a year ago

the thing is tat


a year ago

ioredis?


felixngfenderHOBBY

a year ago

1218453110880473000


a year ago

yeah but why do you need redis during build?


felixngfenderHOBBY

a year ago

idek, it's just a weird thing with the node-redis library


felixngfenderHOBBY

a year ago

where u have to explicitly call connect() before doing anything


a year ago

if you get errors always show me them, otherwise im just guessing


felixngfenderHOBBY

a year ago

sorry that wasn't the right context


felixngfenderHOBBY

a year ago

1218453634854027300


felixngfenderHOBBY

a year ago

i have this issue after switching to REDISPRIVATEURL


a year ago

yeah why are you connecting to redis during build?


felixngfenderHOBBY

a year ago

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


felixngfenderHOBBY

a year ago

i haven't figured out another solution


a year ago

dynamically swap between public and private urls then


felixngfenderHOBBY

a year ago

alr


felixngfenderHOBBY

a year ago

i got it to work


a year ago

awesome


felixngfenderHOBBY

a year ago

the fix was just simply this

1218466665663037400


felixngfenderHOBBY

a year ago

and the traces are coming thru jaeger nicely


felixngfenderHOBBY

a year ago

thank you very much! i really appreciate it


a year ago

awesome, happy to help where I can


felixngfenderHOBBY

a year ago

the last one lol, do u know how to secure jaeger and prometheus ui?


felixngfenderHOBBY

a year ago

proxy/oauth sidecar?


a year ago

I've never used that stack before, it's Melissa's template right?


felixngfenderHOBBY

a year ago

yeas


a year ago

okay I'll ask her next week


a year ago

or even better, you can ask her directly


felixngfenderHOBBY

a year ago

ooh right, i'll do that


a year ago

yeah railways documentation pages all come with an accompanying help thread!


felixngfenderHOBBY

a year ago

just noticed that, really nice