R
Railway8mo ago
FelixNg

NextJS app not connecting to OTel collector

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