From 1c78b68e451eaef27ea1854dedda79e28d55552d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Wed, 27 Sep 2023 17:30:51 +0200 Subject: [PATCH] Enable discovery manager metrics in target allocator This adds the following metrics: prometheus_sd_failed_configs prometheus_sd_discovered_targets prometheus_sd_received_updates_total prometheus_sd_updates_delayed_total prometheus_sd_updates_total --- .chloggen/discoverymanager_metrics.yaml | 16 ++++++++++++++++ cmd/otel-allocator/main.go | 2 ++ 2 files changed, 18 insertions(+) create mode 100755 .chloggen/discoverymanager_metrics.yaml diff --git a/.chloggen/discoverymanager_metrics.yaml b/.chloggen/discoverymanager_metrics.yaml new file mode 100755 index 0000000000..7bfe64534e --- /dev/null +++ b/.chloggen/discoverymanager_metrics.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action) +component: target allocator + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Enable discovery manager metrics in target allocator + +# One or more tracking issues related to the change +issues: [2170] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/cmd/otel-allocator/main.go b/cmd/otel-allocator/main.go index 0a7cf8dad8..297b7d58da 100644 --- a/cmd/otel-allocator/main.go +++ b/cmd/otel-allocator/main.go @@ -90,6 +90,8 @@ func main() { discoveryCtx, discoveryCancel := context.WithCancel(ctx) discoveryManager = discovery.NewManager(discoveryCtx, gokitlog.NewNopLogger()) + discovery.RegisterMetrics() // discovery manager metrics need to be enabled explicitly + targetDiscoverer = target.NewDiscoverer(log, discoveryManager, allocatorPrehook, srv) collectorWatcher, collectorWatcherErr := collector.NewClient(log, cfg.ClusterConfig) if collectorWatcherErr != nil {