Are there any built-in mechanisms in .Net that would allow us to write two programs, A and B. A is a process with special hooks onto which B attaches itself. This would allow B to gather whatever information those hooks provided.
In particular, it would be nice to be able to dial into another of our process and gather suchs metrics like how many times a function was called in the last X minutes, the average run length, how many items are in this or that cache, etc.
You could write an application with the .NET Profiling API. Or, you could use logging, controlled by runtime options, config files, or registry settings for how verbose your logs will be. Or you could pay a lot of money for existing commercial profiling solutions.
You could also use MSMQ instead of logging.