@@ -63,7 +63,8 @@ def start_process(event)
63
63
attributes = {
64
64
pid : process . pid ,
65
65
hostname : process . hostname ,
66
- process_id : process . process_id
66
+ process_id : process . process_id ,
67
+ name : process . name
67
68
} . merge ( process . metadata )
68
69
69
70
info formatted_event ( event , action : "Started #{ process . kind } " , **attributes )
@@ -75,15 +76,16 @@ def shutdown_process(event)
75
76
attributes = {
76
77
pid : process . pid ,
77
78
hostname : process . hostname ,
78
- process_id : process . process_id
79
+ process_id : process . process_id ,
80
+ name : process . name
79
81
} . merge ( process . metadata )
80
82
81
83
info formatted_event ( event , action : "Shutdown #{ process . kind } " , **attributes )
82
84
end
83
85
84
86
def register_process ( event )
85
87
process_kind = event . payload [ :kind ]
86
- attributes = event . payload . slice ( :pid , :hostname , :process_id )
88
+ attributes = event . payload . slice ( :pid , :hostname , :process_id , :name )
87
89
88
90
if error = event . payload [ :error ]
89
91
warn formatted_event ( event , action : "Error registering #{ process_kind } " , **attributes . merge ( error : formatted_error ( error ) ) )
@@ -99,6 +101,7 @@ def deregister_process(event)
99
101
process_id : process . id ,
100
102
pid : process . pid ,
101
103
hostname : process . hostname ,
104
+ name : process . name ,
102
105
last_heartbeat_at : process . last_heartbeat_at . iso8601 ,
103
106
claimed_size : event . payload [ :claimed_size ] ,
104
107
pruned : event . payload [ :pruned ]
@@ -147,7 +150,7 @@ def replace_fork(event)
147
150
termsig : status . termsig
148
151
149
152
if replaced_fork = event . payload [ :fork ]
150
- info formatted_event ( event , action : "Replaced terminated #{ replaced_fork . kind } " , **attributes . merge ( hostname : replaced_fork . hostname ) )
153
+ info formatted_event ( event , action : "Replaced terminated #{ replaced_fork . kind } " , **attributes . merge ( hostname : replaced_fork . hostname , name : replaced_fork . name ) )
151
154
else
152
155
warn formatted_event ( event , action : "Tried to replace forked process but it had already died" , **attributes )
153
156
end
0 commit comments