Skip to content

[Design] Actor lifecycle events #1683

Open

Description

Problem

We cannot answer "what state is this actor in, and since when?" today.

Metrics can't tell you as actor name and uid aren't allowed as metric labels. Traces can't either, due to sampling. So it has to be logs.

Since #1638, ateapi writes a record every time an actor changes state. But it only goes to stdout, and nothing reads stdout. #1658 fixes that by adding OTLP support. This issue is for the bigger picture, because there are really two sets of records to get consensus on.

ateapi + ateom

ateapi state is ready. It even covers transitions that never reach a worker, e.g.

  • an actor created and never resumed,
  • a delete while suspended,
  • a resume that fails in the scheduler

This is what we have in #1638 on stdout, and what you can export via OTLP in #1658.

What we don't yet have is ateom and residency, so we can track an actor over workers.

Right now, ateom can't know the operation or the state. A pause and a suspend send the exact same CheckpointWorkloadRequest, and a teardown is only a delete because that's what we have an ateapi. We can extend the proto if we want, and store operation and state there too, but if we don't want to change the proto "only" for this reason then ateom records can have a name and identity. That's fine, ateapi already answers state.

The names

#1658 adds two, both in docs/metrics/registry/events.yaml so make verify checks them:

  • ate.actor.state_changed
  • ate.actor.crashed

I am proposing two names, not one per state, because ate.actor.state already tells you which transition it was. A name per state would break the first time we add a state. Crash gets its own name because it has two extra attributes.

One thing to remember is to never sample or filter this stream. Consumers read the last record per uid, so dropping one record gives you a stale state and no hint that anything is missing.

How this relates to #1041

ate.actor.activation is a different axis on the same records. An activation id would sit right next to ate.actor.state. Worth designing the two together.

Entity events

We were discussing this with Jeff Luo (@JeffLuoo) on #1638. ate.actor.uid identifies, everything else describes, so entity.state can be added later without any changes. We are actively tracking this upstream.

Open questions

  1. Are we fine adding otlp support? I think consuming these via otlp backend is preferred, and adding one more destination than stdout saves us requiring Daemonset collectors.
  2. Is the ateom set worth building? It needs a logs in internal/otlprelay + the OTEL_LOGS_EXPORTER plumbing. Users get the per pod timeline out of it. Nothing is blocked on it though. Do we want this timeline?
  3. Should the worker pod go on the ateapi record? ateapi knows it at transition time. That would get us most of the timeline without building the ateom set at all.
  4. Actor checkpointed on worker stdout is still ambiguous, it fires for both suspend and pause. Annoying, but not a real gap now that state comes from elsewhere. Fixing it needs ateom to learn the operation somehow without a proto field (if we don't want to add that). What do we think about this?

cc. Jeff Luo (@JeffLuoo) Da Huang (@git286)

Activity

  1. JeffLuoo commented on Sep 17, 2026

    @JeffLuoo
    Collaborator

    Thank you filing the issue!

    Are we fine adding otlp support? I think consuming these via otlp backend is preferred, and adding one more destination than stdout saves us requiring Daemonset collectors.

    I am fine with OTLP for logs. My one concern is the result for a person who reads the logs.

    After #1638 and #1658 we have two transports. Every ate system component writes all of its logs to stdout: ateapi, atelet, atecontroller, atenet, ateom, and podcertcontroller. On top of that, ateapi sends two record types over OTLP, ate.actor.state_changed and ate.actor.crashed. Nothing else goes over OTLP.

    So my question before we go further: can we collect stdout first, with a filelog receiver in the manifests, or with fluent-bit? Then one pipeline carries every record from every component, and the actor state records come with it.

    We can explore options to send logs to otlp endpoint in the future. What's more, having logs sent to OTLP will lost the ability to query logs using kubectl logs xxx

  2. krisztianfekete commented on Sep 17, 2026

    @krisztianfekete
    CollaboratorAuthor

    Thank you filing the issue!

    Are we fine adding otlp support? I think consuming these via otlp backend is preferred, and adding one more destination than stdout saves us requiring Daemonset collectors.

    I am fine with OTLP for logs. My one concern is the result for a person who reads the logs.

    After #1638 and #1658 we have two transports. Every ate system component writes all of its logs to stdout: ateapi, atelet, atecontroller, atenet, ateom, and podcertcontroller. On top of that, ateapi sends two record types over OTLP, ate.actor.state_changed and ate.actor.crashed. Nothing else goes over OTLP.

    So my question before we go further: can we collect stdout first, with a filelog receiver in the manifests, or with fluent-bit? Then one pipeline carries every record from every component, and the actor state records come with it.

    We can explore options to send logs to otlp endpoint in the future. What's more, having logs sent to OTLP will lost the ability to query logs using kubectl logs xxx

    We do NOT lose kubectl logs. Stdout keeps functioning as it is today, #1658 just adds a second destination for the same two records and it's fully opt-in.

    I think it's useful to think about logs vs. events differently, e.g.

    • stdout is what every component log, and filelog should collect it. Fully agree, happy to help build that.
    • OTLP carries two events in a given schema, with a real event.name, severity, and trace context on the record's own fields.

    I don't think it's a good idea to combine the two into one stdout output as

    1. event.name is a top level OTLP field. filelogreceiver and its json_parser doesn't give you this, so you'd need OTTL logics per deployment + explicit severity parsing (as filelog doesn't give you this by default) and a trace_parser block. The SDK gets users all these out of the box.
    2. filelogreciever requires a DaemonSet so you can mount the logs from disk. If you do want to have a hard requirement/preference on collecting all logs, that's probably fine, but based on my experience, folks are usually cost conscious and prefer not to add yet another DaemonSet if they can help it. Following this thinking, I think separating out our schema'd actor log events shouldn't require a log level component and it's additional plumbing , especially if we can avoid doing this work.
    3. Deduplication is one line change when users are fine with filelogreceiver. This is already documented in the OTLP PR.

    We can definitely include/document using filelogreceiver (likely as an optional piece for the reasons mentioned above) as it's a valid use-case, but this design proposal is more about providing actor lifecycle events (without any changes, those should be their own PRs as well) as an OTel-native way.

  3. added
    kind/design
    on Sep 17, 2026
  4. krisztianfekete commented on Sep 18, 2026

    @krisztianfekete
    CollaboratorAuthor

    Jeff Luo (@JeffLuoo), do you have any objections proceeding with the OTLP PR? Happy to continue the discussion on the remaining open questions and I also opened an issue for adding filelogreceiver: #1741

  5. JeffLuoo commented on Sep 18, 2026

    @JeffLuoo
    Collaborator

    Thanks for your reply. Ack'd for kubectl logs part and agree on the logs versus events split. Let's keep our doc updated then for people / agent to understand: "When should I add this as a log?" vs "When should I add this as an event"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/observabilitykind/design

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions