Overview
All metrics are local—they reflect the current node only. Metrics are point-in-time snapshots; values do not update
after the struct is returned.
System metrics
ActorSystem.Metric(ctx) returns a *Metric struct with node-level statistics. Returns nil when the actor system is
not started.
Per-actor metrics
pid.Metric(ctx) returns an *ActorMetric struct with actor-level statistics. Returns nil when the actor is not
running. For remote actors, metrics are fetched via remoting; the same fields are available.
Event stream
The event stream publishes system and cluster events (lifecycle, membership, dead letters). It is separate from application-level PubSub. See Event Streams for full documentation.ActorStarted, ActorStopped, ActorChildCreated, ActorPassivated, ActorRestarted, ActorSuspended,
ActorReinstated, Deadletter, NodeJoined, NodeLeft.
Dead letters
Messages sent to stopped or non-existent actors are captured by the dead-letter actor and published to the event stream. TheDeadletter payload includes sender, receiver, message, and reason. Subscribe to the event stream to observe or log
dead letters.
OpenTelemetry
WhenWithMetrics() is passed at actor system creation, the framework registers OpenTelemetry observable counters. You
must initialize the OpenTelemetry SDK (MeterProvider, exporter) before starting the actor system; otherwise metrics are
not exported.
System-level instruments
Per-actor instruments
Attributes:actor.system, actor.name, actor.kind, actor.address.