Repository navigation
Description
Living design doc for easier collaboration, please use this for comments: https://docs.google.com/document/d/1tpUZNqH-xaSXzMVJf95CpWtKbIBD-mH93nqlDcEBOe8/edit?tab=t.0
It requires to be in: [email protected]
Problem
An actor occupies many workers throughout its life. It runs on worker A for an hour, suspends, resumes on worker B three days later, crashes, comes back. Each time it occupies a worker we emit spans and logs, but we have nothing to refer to these iperiods, or "residencies" by. So for example "show me everything this actor did on Tuesday afternoon" is not a query we can run today.
Proposal: create an id per "residency", call it activation, and set it on the signals where high cardinality is allowed, so spans and logs.
High level mechanism
ateapi creates a ULID/UUID (having it sortable by creation timestamp is nice) when it commits an actor into RUNNING, stores it on the Actor record, and it propagates trough the restore path (ateapi -> atelet -> ateom), for which we already have all the plumbing in place.
Where it goes
- spans: lifecycle operations plus the router resume span
- logs: through ateattr, next to the actor identity keys we set in (chore): consolidate logging to ateattr #1035
- usage events later (Feature Request: Resource-usage telemetry at actor / ActorTemplate granularity #550 / Actor resource telemetry Phase 1: atelet reader and OTel emission #896): a residency is the natural scope for "this cost X".
- NOT on metrics
- entities later, if we want to adopt them. its own type, activation_of the actor, runs_on the pod, see https://opentelemetry.io/docs/specs/otel/entities/entity-events/
We should consider storing the previous residency's suspend span context on the Actor record, and link each resume span back to it.
Benefits
- the actor timeline becomes one query instead of lots of joins across pod names and time windows
- usage and cost can be split into residency beyond actor and request
- we can make crash loops become visible as incarnation rate is increasing
- for [Design] Actor Otel Telemetry Relay #853, it seems to be the proper writer identity for the relayed metric stream. One incarnation is exactly one writer by design, which is a cleaner than a worker pod
Open questions
- What ends an incarnation apart from SUSPEND? What about PAUSE, where the actor may come back to the same worker? Is an incarnation one running interval or one placement? This will affect the design.
- Proto field or telemetry-internal? On the proto it's more useful and clients can correlate against it, but it's an API change, and we have multiple changes in-flgiht for the API already
cc. Da Huang (@git286), Julian Gutierrez Oschmann (@juli4n), Max Smythe (@maxsmythe)
Activity
maxsmythe commentedon Aug 19, 2026
Definitely like the idea of being able to easily view an actor across its extended lifetime.
WRT open questions:
Seems like this is dependent on intent. If we want to use this to help identify frequent crashes, that would imply non-user-intended incarnations. Alternatively, we could also log the reason why the incarnation ended and let the user decide what to keep/drop based off needs?
Sounds like correlation may be a large portion of the value this field provides.
[-][Design] ate.actor.incarnation[/-][+][Design] ate.actor.activation[/+]git286 commentedon Aug 20, 2026
Why? Can't we run a query over the logs today with something like "where uid = xxx AND timestamp in a range"?
I think we already have this one? ate.actor.crashes is a counter in controlapi/metrics.go with template/pool/reason attributes, so crash rate is available today ?
Above you said it won't be added to metrics (since the cardinality will be even higher than actor ids) then why can this be used as metric writer identity?
sfunkenhauser commentedon Nov 23, 2026
A similar field is being added in
actor_status.worker_assignment.actor_execution_uid. Naming aside (which sounds like we should re-name toactor_activation_uid#483 (comment)), can this be re-used for this feature?This field will be set when the actor state switches to
RUNNINGand will be removed onCRASHEDandSUSPENDED(when the worker assignment is cleared).