Telemetry: publish events for each actor create / restart / terminate #5587
-
Is your feature request related to a problem? Please describe. I've been thinking about this in a few areas:
In particular, some of the work I've been doing around Phobos 2.0 has been leading me to wonder if it makes sense to emit some basic telemetry around actor creation inside Akka.NET itself. Describe the solution you'd like public readonly struct ActorStarted{
public IActorRef Ref {get;} // can be used for topological sort / correlation
public Type ActorType {get;}
}
public readonly struct ActorRestarted{
public IActorRef Ref {get;} // can be used for topological sort / correlation
public Type ActorType {get;}
public Exception CrashReason {get;}
}
public readonly struct ActorTerminated{
public IActorRef Ref {get;} // can be used for topological sort / correlation
public Type ActorType {get;}
public TerminatedReason Reason {get;} // stopped, parent decided, system shutting down
} Having a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
View points to add from my side:
public readonly struct ActorTerminated
{
public IActorRef Ref {get;} // can be used for topological sort / correlation
public Type ActorType {get;}
public Reason Reason {get;} // stopped, parent decided, system shutting down
}
//demo:
var t1 = new ActorTerminated(Self, GetType(), DefaultTerminationReasons.Stopped);
var reason = Context.System.GetExtensions<ErrorService>().ToReason(ex);
var t2 = new ActorTerminated(Self, GetType(), reason); |
Beta Was this translation helpful? Give feedback.
-
Having this would be also beneficial for actors managed by a BackoffSupervisor, where the child actor being "managed" must be initialised by the parent as part of its startup (Think FSM). How would the actor processing the event be able to distinguish between any actor's events and only its child hierarchy events? |
Beta Was this translation helpful? Give feedback.
-
I have drafted an initial implementation of this concept here: #6294 |
Beta Was this translation helpful? Give feedback.
I have drafted an initial implementation of this concept here: #6294