mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-02 03:24:42 +08:00
(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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user