I have a microservice written in Haskell, the compiler is 8.8.3.
I built it with --profile option and ran it with +RTS -p. It is running about 30 minutes, there is <my-service>.prof file but it is empty (literally 0 bytes). Previously I did it on my local machine and I stop the service with CTRL-C and after the exit it produced <my-service>.prof file which was not empty.
So, I have 2 questions:
- How to collect profiling information when a Haskell microservice runs under Kubernetes in the most correct way (to be able to read this .prof file)?
- How to pass run time parameter to Haskell run-time where to save this .prof file (maybe some workaround if no such an option), for 8.8.3 - because I have feeling that the file may be big and I can hit disk space problem. Also I don't know how to flush/read/get this file while microservice is running. I suppose if I will be able to pass full path for this .prof file then I can save it somewhere else on some permanent volume, to "kill" the service with
INTsignal for example, and to get this .prof file from the volume.
What is the usual/convenient way to get this .prof file when the service runs in Kubernetes?
PS. I saw some relevant options in the documentation for newest versions, but I am with 8.8.3