diff --git a/pkg/config/service.go b/pkg/config/service.go index 98dea18b..9b467be6 100644 --- a/pkg/config/service.go +++ b/pkg/config/service.go @@ -47,7 +47,7 @@ type ServiceConfig struct { PrometheusPort int `yaml:"prometheus_port"` // prometheus handler port DebugHandlerPort int `yaml:"debug_handler_port"` // egress debug handler port - CPUCostConfig `yaml:"cpu_cost"` // CPU costs for the different egress types + *CPUCostConfig `yaml:"cpu_cost"` // CPU costs for the different egress types } type CPUCostConfig struct { @@ -69,7 +69,8 @@ func NewServiceConfig(confString string) (*ServiceConfig, error) { ApiSecret: os.Getenv("LIVEKIT_API_SECRET"), WsUrl: os.Getenv("LIVEKIT_WS_URL"), }, - TemplatePort: defaultTemplatePort, + TemplatePort: defaultTemplatePort, + CPUCostConfig: &CPUCostConfig{}, } if confString != "" { if err := yaml.Unmarshal([]byte(confString), conf); err != nil { diff --git a/pkg/stats/monitor.go b/pkg/stats/monitor.go index 94a72bcc..3c2b0c8c 100644 --- a/pkg/stats/monitor.go +++ b/pkg/stats/monitor.go @@ -32,7 +32,7 @@ import ( ) type Monitor struct { - cpuCostConfig config.CPUCostConfig + cpuCostConfig *config.CPUCostConfig promCPULoad prometheus.Gauge promProcCPULoad *prometheus.GaugeVec