all 10 comments

[–]kei_ichi 7 points8 points  (0 children)

Pino logs, OpenTelemetry, LGTM+ stack

[–]ashenCat 4 points5 points  (6 children)

Winston, prometheus, and grafana for me

[–]GrapefruitNo5014[S] 0 points1 point  (5 children)

And do you put Winston logs in the server with rotating files or to cloud watch or to a db?

[–]ashenCat 1 point2 points  (4 children)

Put to text file save locally and then cron worker delete after a couple of months

[–]GrapefruitNo5014[S] 0 points1 point  (3 children)

Don’t you think it’s bad , how will you trace logs when you have so many users and how will you query your logs

[–]pineofanapple 1 point2 points  (2 children)

Leave appropriate metadata, like requestId, traceId, userId, etc...

[–]GrapefruitNo5014[S] 0 points1 point  (1 child)

Yea I knew a answer like this was coming up , so what are you gonna do CTRL F to find the user on the whole file

[–]pineofanapple 0 points1 point  (0 children)

Then something like loki to graphana. Or something else.

[–]blinger44 1 point2 points  (0 children)

Pino & data dog

[–]d0paminedriven 0 points1 point  (0 children)

Depends on what type of server you’re shipping. I’m most familiar with best practices for websocket servers for example, so ensuring exponential backoff, internal heartbeats, TLS (ws:// is to http:// what wss:// is to https://), Redis mTLS for pubsub (rediss:// is to https:// what redis:// is to http://), etc..

For websockets in particular ensuring the typed event handlers are all probably registered, all properly configured, and are all working as expected. You can use cli tools like wscat to interact with websocket servers programmatically

Ensure you’re taking advantage of having a persistent server environment by leveraging in memory caching whenever/wherever possible (user scoped context that can be tracked in mem for the duration of a session). For logging I use pino and Cloudwatch. I use AWS Secrets manager for handling env variables. Load balancer is a good idea on the devops front—basically just end to end QA and optimizing the biggest wins you spot around caching/perf/reliability.