Debugging and troubleshooting distributed applications