metric 중복 등록 에러는 무시

This commit is contained in:
2024-07-29 17:49:47 +09:00
parent ae98abe61d
commit 8e3d6c28f0

View File

@ -135,7 +135,11 @@ func (pe *prometheusExporter) loop(ctx context.Context) {
}
if err := prometheus.Register(nextcollector); err != nil {
if _, ok := err.(prometheus.AlreadyRegisteredError); ok {
// 이미 등록된 metric. child process를 여럿 실행하면 발생됨
} else {
logger.Error("prometheus register err :", *nm, err)
}
} else {
collector = nextcollector
}