Procstat input plugin - functionality for overriding of process_name (#1192)
Being able to override the process_name in the procstat module is useful for daemonized perl, ruby, erlang etc. processes. This allows for manually setting process_name rather than it being set to the interpreter/VM of the process.
This commit is contained in:
committed by
Cameron Sparr
parent
debf7bf149
commit
ab54064689
@@ -17,13 +17,19 @@ type SpecProcessor struct {
|
||||
}
|
||||
|
||||
func NewSpecProcessor(
|
||||
processName string,
|
||||
prefix string,
|
||||
acc telegraf.Accumulator,
|
||||
p *process.Process,
|
||||
tags map[string]string,
|
||||
) *SpecProcessor {
|
||||
if name, err := p.Name(); err == nil {
|
||||
tags["process_name"] = name
|
||||
if processName != "" {
|
||||
tags["process_name"] = processName
|
||||
} else {
|
||||
name, err := p.Name()
|
||||
if err == nil {
|
||||
tags["process_name"] = name
|
||||
}
|
||||
}
|
||||
return &SpecProcessor{
|
||||
Prefix: prefix,
|
||||
|
||||
Reference in New Issue
Block a user