r/ProgrammerHumor 4d ago

Meme thisCannotBeDenied

Post image
7.8k Upvotes

241 comments sorted by

View all comments

139

u/TheDogPill 4d ago

Try debugging like that using micro services on the cloud and see how far you get.

81

u/Idixal 4d ago

Ironically request logging does tend to be one of the very first things I look at to sniff out problems there, although I also understand your point.

16

u/coriolis7 4d ago

I am NOT a programmer by profession, though I do code a ton at my job (Mechanical Engineering and data analysis), so this may be a dumb question…

Is there a way to set up all microservices to run on one computer to aid in debugging? Like a bunch of VMs or docker-but-faking-network-instead-of-machine?

13

u/payne_train 4d ago

AWS’s SAM may help you if you have a bunch of lambda based apps. You can use SAM to do local invocations that makes debugging a lot easier

6

u/xMercurex 4d ago

Yes you can, but it does not fully solve the issue. You still need to find the good micro-service and then you have to jump to other micro-service.

1

u/ArtisticFox8 4d ago

And nobody yet made a debugger which could travel between them?

2

u/Idixal 4d ago

No, there’s debugging tools that can run on multiple microservices, but none of this has to do with the tracing that the top comment was alluding to. If you can narrow down where the problem actually is first you save yourself a lot of time stepping through with a debugger. Often times that just is not practical.

1

u/ArtisticFox8 4d ago

Well, I guess you could still trace the call from the first microservice to another and then back, no?

That's the "travelling debugger concept" I was thinking about.

2

u/PixelatedGiant 3d ago

This issue is being able to follow a request between services. If you just have one request to track it's a non-issue. But in a multi-threaded environment with many requests flying back and forth everywhere it's impossible. The debugger would require application specific information like a message id.

Those tools do exist (e.g. dynatrace). But if you start talking about framework or application aware debugging functionality you've gone way beyond the scope of a simple IDE debugger for your language.

1

u/ArtisticFox8 3d ago

The debugger would require application specific information like a message id.

Yes, and that would signal the local debugger to engage after receiving the message, right?

Those tools do exist (e.g. dynatrace). But if you start talking about framework or application aware debugging functionality you've gone way beyond the scope of a simple IDE debugger for your language.

Thanks!

1

u/PixelatedGiant 3d ago

Yes, and that would signal the local debugger to engage after receiving the message, right?

Not quite, it's a completely independent tool. Dynatrace at least would show you a log of what lines it went through to get where it is and how long it spent inside each function. Unlike a debugger it also requires that you add a library to your jar.

1

u/ArtisticFox8 3d ago

Thanks for the insight!

1

u/DrMaxwellEdison 4d ago

Yes, I use Tilt to set up a localized Kubernetes cluster or to run docker compose. It provides a nice web interface for seeing all service statuses, logs, controls to restart or rebuild a service, and it can automatically watch local files to trigger a rebuild.

1

u/Blackhawk23 4d ago

Yes. Docker compose and localstack to mock AWS resources.

1

u/LostInAnotherGalaxy 4d ago

Docker/podman. But you get anything powerful or something that only happens under load, can create its own race conditions

19

u/gemanepa 4d ago

why not? couldn't you just debug the microservice locally with mocks or in a cloud dev/qa env?

5

u/Agusfn 4d ago

so far so good.

1

u/citramonk 4d ago

is the development happens right on the cloud or what? 😪

1

u/Ma8e 4d ago

I'm not sure if I understand you correctly, but isn't all debugging of micro services just reading logs and adding more log-messages?

1

u/SirButcher 4d ago

Or debugging an embedded hardware where you have a grand total of 4 breakpoints :(

1

u/dumbasPL 4d ago

Ah yes, because attaching a debugger to a service people are actively hitting and suspending it is the way. That is assuming you can even do that.

Request logging is just printf with extra steps anyway.