@@ -61,6 +61,17 @@ def start_process(event)
61
61
info formatted_event ( event , action : "Started #{ process . kind } " , **attributes )
62
62
end
63
63
64
+ def shutdown_process ( event )
65
+ process = event . payload [ :process ]
66
+
67
+ attributes = {
68
+ pid : process . pid ,
69
+ hostname : process . hostname
70
+ } . merge ( process . metadata )
71
+
72
+ info formatted_event ( event , action : "Shut down #{ process . kind } " , **attributes )
73
+ end
74
+
64
75
def register_process ( event )
65
76
process_kind = event . payload [ :kind ]
66
77
attributes = event . payload . slice ( :pid , :hostname )
@@ -119,10 +130,15 @@ def unhandled_signal_error(event)
119
130
120
131
def replace_fork ( event )
121
132
status = event . payload [ :status ]
122
- attributes = event . payload . slice ( :pid ) . merge ( status : status . exitstatus , pid_from_status : status . pid )
133
+ attributes = event . payload . slice ( :pid ) . merge \
134
+ status : ( status . exitstatus || "no exit status set" ) ,
135
+ pid_from_status : status . pid ,
136
+ signaled : status . signaled? ,
137
+ stopsig : status . stopsig ,
138
+ termsig : status . termsig
123
139
124
140
if replaced_fork = event . payload [ :fork ]
125
- info formatted_event ( event , action : "Replaced #{ replaced_fork . kind } " , **attributes . merge ( hostname : replaced_fork . hostname ) )
141
+ info formatted_event ( event , action : "Replaced terminated #{ replaced_fork . kind } " , **attributes . merge ( hostname : replaced_fork . hostname ) )
126
142
else
127
143
warn formatted_event ( event , action : "Tried to replace forked process but it had already died" , **attributes )
128
144
end
0 commit comments