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