Skip to content

Commit

Permalink
Enable discovery manager metrics in target allocator
Browse files Browse the repository at this point in the history
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
  • Loading branch information
swiatekm committed Sep 28, 2023
1 parent 37cf662 commit 99322cd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .chloggen/discoverymanager_metrics.yaml
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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: []

# (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:
2 changes: 2 additions & 0 deletions cmd/otel-allocator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 99322cd

Please sign in to comment.