mirror of
https://github.com/postmannen/ctrl.git
synced 2025-01-18 21:59:30 +00:00
added metrics to process
This commit is contained in:
parent
56b432f402
commit
86b3ef9e96
3 changed files with 6 additions and 2 deletions
|
@ -103,6 +103,8 @@ type process struct {
|
||||||
signatures *signatures
|
signatures *signatures
|
||||||
// errorKernel
|
// errorKernel
|
||||||
errorKernel *errorKernel
|
errorKernel *errorKernel
|
||||||
|
// metrics
|
||||||
|
metrics *metrics
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepareNewProcess will set the the provided values and the default
|
// prepareNewProcess will set the the provided values and the default
|
||||||
|
@ -132,6 +134,7 @@ func newProcess(ctx context.Context, server *server, subject Subject, processKin
|
||||||
startup: newStartup(server),
|
startup: newStartup(server),
|
||||||
signatures: server.signatures,
|
signatures: server.signatures,
|
||||||
errorKernel: server.errorKernel,
|
errorKernel: server.errorKernel,
|
||||||
|
metrics: server.metrics,
|
||||||
}
|
}
|
||||||
|
|
||||||
return proc
|
return proc
|
||||||
|
|
|
@ -49,6 +49,7 @@ func newProcesses(ctx context.Context, server *server) *processes {
|
||||||
errorKernel: server.errorKernel,
|
errorKernel: server.errorKernel,
|
||||||
configuration: server.configuration,
|
configuration: server.configuration,
|
||||||
Signatures: server.signatures,
|
Signatures: server.signatures,
|
||||||
|
metrics: server.metrics,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare the parent context for the subscribers.
|
// Prepare the parent context for the subscribers.
|
||||||
|
|
|
@ -564,7 +564,7 @@ func (m methodREQOpProcessStop) handler(proc process, message Message, node stri
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the prometheus label
|
// Remove the prometheus label
|
||||||
proc.server.metrics.promProcessesAllRunning.Delete(prometheus.Labels{"processName": string(processName)})
|
proc.metrics.promProcessesAllRunning.Delete(prometheus.Labels{"processName": string(processName)})
|
||||||
|
|
||||||
txt := fmt.Sprintf("info: OpProcessStop: process stopped id: %v, method: %v on: %v", toStopProc.processID, sub, message.ToNode)
|
txt := fmt.Sprintf("info: OpProcessStop: process stopped id: %v, method: %v on: %v", toStopProc.processID, sub, message.ToNode)
|
||||||
er := fmt.Errorf(txt)
|
er := fmt.Errorf(txt)
|
||||||
|
@ -1011,7 +1011,7 @@ func (m methodREQErrorLog) getKind() Event {
|
||||||
|
|
||||||
// Handle the writing of error logs.
|
// Handle the writing of error logs.
|
||||||
func (m methodREQErrorLog) handler(proc process, message Message, node string) ([]byte, error) {
|
func (m methodREQErrorLog) handler(proc process, message Message, node string) ([]byte, error) {
|
||||||
proc.server.metrics.promErrorMessagesReceivedTotal.Inc()
|
proc.metrics.promErrorMessagesReceivedTotal.Inc()
|
||||||
|
|
||||||
// If it was a request type message we want to check what the initial messages
|
// If it was a request type message we want to check what the initial messages
|
||||||
// method, so we can use that in creating the file name to store the data.
|
// method, so we can use that in creating the file name to store the data.
|
||||||
|
|
Loading…
Add table
Reference in a new issue