File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ import (
1919 "path"
2020
2121 "github.com/frostbyte73/core"
22+ "github.com/prometheus/client_golang/prometheus"
23+ "github.com/prometheus/client_golang/prometheus/collectors"
2224 "google.golang.org/grpc"
2325
2426 "github.com/livekit/egress/pkg/config"
@@ -44,6 +46,10 @@ type Handler struct {
4446}
4547
4648func NewHandler (conf * config.PipelineConfig , bus psrpc.MessageBus ) (* Handler , error ) {
49+ // Register all GO process metrics
50+ prometheus .Unregister (prometheus .NewGoCollector ())
51+ prometheus .MustRegister (collectors .NewGoCollector (collectors .WithGoCollectorRuntimeMetrics (collectors .MetricsAll )))
52+
4753 ipcClient , err := ipc .NewServiceClient (path .Join (config .TmpDir , conf .NodeID ))
4854 if err != nil {
4955 return nil , err
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
2121
2222 "github.com/linkdata/deadlock"
2323 "github.com/prometheus/client_golang/prometheus"
24+ "github.com/prometheus/client_golang/prometheus/collectors"
2425 "github.com/prometheus/client_golang/prometheus/promhttp"
2526 dto "github.com/prometheus/client_model/go"
2627 "github.com/prometheus/common/expfmt"
@@ -38,6 +39,9 @@ type MetricsService struct {
3839}
3940
4041func NewMetricsService (pm * ProcessManager ) * MetricsService {
42+ prometheus .Unregister (prometheus .NewGoCollector ())
43+ prometheus .MustRegister (collectors .NewGoCollector (collectors .WithGoCollectorRuntimeMetrics (collectors .MetricsAll )))
44+
4145 return & MetricsService {
4246 pm : pm ,
4347 }
You can’t perform that action at this time.
0 commit comments