Search code examples
orleans

In Project Orleans, is there any interceptor or filter like IOnGrainActivation and IOnGrainDeactivation?


For monitoring purposes, I need to log and measure every grain call (already available through Grain Call Filters), but also every grain activation/deactivation to have Grain Type counters, also for auto-scaling purposes.

I haven't found any global hooks besides Incomming and Outgoing grain call filters

Image showing main extension methods for ISiloBuilder

Is there any way to get into the lifecycle of Grains in a global manner, besides the Incomming and Outgoing call filters?


Solution

  • Yes, you can using a feature in orleans called life-cycle participation which is available for grains and silos as well.

    You should check out the documentation site