diff --git a/pkg/instrumentation/instrumentation.go b/pkg/instrumentation/instrumentation.go index f19f671f0..beaeb1569 100644 --- a/pkg/instrumentation/instrumentation.go +++ b/pkg/instrumentation/instrumentation.go @@ -118,6 +118,8 @@ func start() error { metrics.WithNamespace("nri"), metrics.WithExporterDisabled(!cfg.PrometheusExport), metrics.WithReportPeriod(cfg.ReportPeriod.Duration), + // TODO(klihub): make this configurable via apis/config/.../instrumentation.Config + metrics.WithMetrics([]string{"buildinfo", "policy"}, nil), ); err != nil { return fmt.Errorf("failed to start metrics: %v", err) } diff --git a/pkg/resmgr/policy/metrics.go b/pkg/resmgr/policy/metrics.go index f815465ce..0d192c3aa 100644 --- a/pkg/resmgr/policy/metrics.go +++ b/pkg/resmgr/policy/metrics.go @@ -44,6 +44,8 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) { } } +// TODO(klihub): protect metrics polling/collection against concurrent policy processing. + func (c *Collector) Collect(ch chan<- prometheus.Metric) { pm, err := c.policy.CollectMetrics(c.policy.PollMetrics()) if err != nil {