NextJS app not connecting to OTel collector
felixngfender
HOBBYOP

2 years ago

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

48 Replies

felixngfender
HOBBYOP

2 years ago

f5c73930-7763-4f58-ae1b-eb1d2215f7e2


felixngfender
HOBBYOP

2 years ago

The same set up works locally


2 years ago

deploying with nixpacks or dockerfile?


felixngfender
HOBBYOP

2 years ago

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


felixngfender
HOBBYOP

2 years ago

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

1218439527128109000


felixngfender
HOBBYOP

2 years ago

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


2 years ago

is the dockerfile alpine based?


felixngfender
HOBBYOP

2 years ago

for nextjs?


felixngfender
HOBBYOP

2 years ago

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


2 years ago

yeah


2 years ago

does the nextjs app deploy with an alpine based dockerfile?


felixngfender
HOBBYOP

2 years ago

yeah


felixngfender
HOBBYOP

2 years ago

brah


felixngfender
HOBBYOP

2 years ago

ur the doctor


felixngfender
HOBBYOP

2 years ago

rebuilding it now


2 years ago

any luck?


felixngfender
HOBBYOP

2 years ago

seems to work but i went on a tangent

1218452865245515800


felixngfender
HOBBYOP

2 years ago

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


felixngfender
HOBBYOP

2 years ago

the thing is tat


2 years ago

ioredis?


felixngfender
HOBBYOP

2 years ago

1218453110880473000


2 years ago

yeah but why do you need redis during build?


felixngfender
HOBBYOP

2 years ago

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


felixngfender
HOBBYOP

2 years ago

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


2 years ago

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


felixngfender
HOBBYOP

2 years ago

sorry that wasn't the right context


felixngfender
HOBBYOP

2 years ago

1218453634854027300


felixngfender
HOBBYOP

2 years ago

i have this issue after switching to REDISPRIVATEURL


2 years ago

yeah why are you connecting to redis during build?


felixngfender
HOBBYOP

2 years 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


felixngfender
HOBBYOP

2 years ago

i haven't figured out another solution


2 years ago

dynamically swap between public and private urls then


felixngfender
HOBBYOP

2 years ago

alr


felixngfender
HOBBYOP

2 years ago

i got it to work


2 years ago

awesome


felixngfender
HOBBYOP

2 years ago

the fix was just simply this

1218466665663037400


felixngfender
HOBBYOP

2 years ago

and the traces are coming thru jaeger nicely


felixngfender
HOBBYOP

2 years ago

thank you very much! i really appreciate it


2 years ago

awesome, happy to help where I can


felixngfender
HOBBYOP

2 years ago

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


felixngfender
HOBBYOP

2 years ago

proxy/oauth sidecar?


2 years ago

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


felixngfender
HOBBYOP

2 years ago

yeas


2 years ago

okay I'll ask her next week


2 years ago

or even better, you can ask her directly


felixngfender
HOBBYOP

2 years ago

ooh right, i'll do that


2 years ago

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


felixngfender
HOBBYOP

2 years ago

just noticed that, really nice


Loading...