(chore): Write both copies of an actor lifecycle event from one call (#1771)

An actor lifecycle record went to stdout and to OTLP in two separate
calls. The attributes were shared, but the severity was not, so the slog
level sat at the call site and the OTel severity sat on the `Event`.
Nothing made a caller write both copies either, so a new record could
reach stdout only and no test would notice.

Since this PR `actorevent.Log` now writes both copies. The level comes
from `Event.Severity`, so it is stored once. The OTLP only `Emit` and
the exported body constants are gone, so the dual write is the only way
out of the package.

Also normalizes `ate.actor.operation.name` on the crash event, which the
state change event already did.

Fixes #1744 

Testing

- Unit tests for the level mapping, the dual write, and the registry
check.
- End to end on a fresh kind cluster. Both event names arrive with the
right severity (9 and 17), the right attributes, and trace context on
the record fields. The stdout copies match record for record.

- [x] Tests pass
- [ ] Appropriate changes to documentation are included in the PR
This commit is contained in:
Krisztian F
2026-09-21 20:55:52 +00:00
committed by GitHub
parent aa17b3c297
commit f75e626485
9 changed files with 347 additions and 64 deletions
+2 -1
View File
@@ -17,7 +17,8 @@
#
# An event name promises a fixed set of attributes. The list in each group is
# the reviewable form of the Keys field on the matching internal/actorevent
# Event, and a test in that package holds the two in step.
# Event. TestEventsMatchTheRegistry in that package holds the two in step both
# ways, so an event has to be declared here before it can ship.
#
# Metrics cannot answer what state an actor is in: the cardinality rule
# no-actor-identity bars actor identity from metric labels. These events carry