How to monitor requests being sent to a (Vanilla) Node.js server, running on a Digital Ocean Droplet, to another Ubuntu Linux machine in real-time using RabbitMQ?
Disclaimer: This question is NOT about “getting it running”. I’m new to software development and want guidance about how “the pros” do it.
Goal: Send messages from one Ubuntu Linux (20.04) machine to another in real time, providing information about each request to the server (e.g., "Route X was hit at X time and succeeded"). It's not running in production, this is about learning.
Background: I have set up a Node.js server on a Digital Ocean Droplet. I would like to receive a simple message on my local machine each time a request is sent to the Node.js server running on my Digital Ocean droplet. What is the best way to do this?
What I have thought of so far….
- Send message from machine serving requests to “listening”/local machine...via some "ugly" way like ssh'ing a .txt log file on Cron schedule.
- Somehow use RabbitMQ, putting a message into the queue on the server machine, each time a request is sent, with a script running on local machine to “listen” to these messages. The downside of this is it seems like the script would need to be running constantly. Therefore, maybe RabbitMQ isn’t the best idea for this? I have spent numerous (approx. 10 hours) studying this and setting up a Node.js server on a Digital Ocean Droplet. I think I have earned the right to some guidance on this. Thank you, all you wizards, in advance.
PS: tried to add the "n00b" tag to this post, but wasn't available. I think SO needs to add. I digress. Peace.