From 2bc924e73cada29e39b5211c34aadcee3d592e6f Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Sun, 10 Nov 2024 00:43:17 +0200 Subject: [PATCH] WiP: mark TODO items. Signed-off-by: Krisztian Litkey --- pkg/instrumentation/instrumentation.go | 2 ++ pkg/resmgr/policy/metrics.go | 2 ++ 2 files changed, 4 insertions(+) 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 {