houston에 constlabel 설정 가능
This commit is contained in:
@ -213,7 +213,7 @@ func (hc *houstonClient) launch(meta *procmeta) error {
|
||||
return err
|
||||
}
|
||||
|
||||
stdReader := func(childProcName string, r io.ReadCloser, index int) {
|
||||
stdReader := func(jobName string, r io.ReadCloser, index int) {
|
||||
defer func() {
|
||||
reco := recover()
|
||||
if reco != nil {
|
||||
@ -308,7 +308,12 @@ func (hc *houstonClient) launch(meta *procmeta) error {
|
||||
if desc.ConstLabels == nil {
|
||||
desc.ConstLabels = make(map[string]string)
|
||||
}
|
||||
desc.ConstLabels["index"] = fmt.Sprintf("%d", index)
|
||||
|
||||
for k, v := range hc.config.ConstLabels {
|
||||
desc.ConstLabels[k] = v
|
||||
}
|
||||
|
||||
desc.ConstLabels["job"] = jobName
|
||||
|
||||
metricExporter.RegisterMetric(&desc)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user