Skip to content

Commit

Permalink
Bug 2242324: avoid fetching performance metrics from mgr/prometheus
Browse files Browse the repository at this point in the history
Avoid fetching performance counters of ceph daemons in prometheus module
by setting `exclude_perf_counters` to true, given ceph-exporter takes of it in 4.14

Signed-off-by: Avan Thakkar <[email protected]>
  • Loading branch information
avanthakkar committed Feb 1, 2024
1 parent 29e71f9 commit 6f63d4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pkg/operator/ceph/cluster/mgr/mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@ func (c *Cluster) configurePrometheusModule() error {
logger.Infof("prometheus config will change, interval: %v", interval)
}

// Disable fetching of performance counters from the prometheus exporter as ceph-exporter is enabled for 4.14
err = monStore.Set("mgr", "mgr/prometheus/exclude_perf_counters", "true")
if err != nil {
return errors.Wrapf(err, "failed to enable exclude_perf_counters")
}

if portHasChanged || intervalHasChanged {
logger.Info("prometheus config has changed. restarting the prometheus module")
return c.restartMgrModule(PrometheusModuleName)
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/ceph/cluster/mgr/mgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ func TestCluster_configurePrometheusModule(t *testing.T) {
assert.Equal(t, 2, modulesEnabled)
assert.Equal(t, 1, modulesDisabled)
assert.Equal(t, "30001", configSettings["mgr/prometheus/server_port"])
assert.Equal(t, 1, len(configSettings))
assert.Equal(t, 2, len(configSettings))

modulesEnabled = 0
modulesDisabled = 0
Expand All @@ -527,7 +527,7 @@ func TestCluster_configurePrometheusModule(t *testing.T) {
assert.Equal(t, 2, modulesEnabled)
assert.Equal(t, 1, modulesDisabled)
assert.Equal(t, "30001", configSettings["mgr/prometheus/server_port"])
assert.Equal(t, 1, len(configSettings))
assert.Equal(t, 2, len(configSettings))

// Enable prometheus module, port and interval changed
modulesEnabled = 0
Expand Down

0 comments on commit 6f63d4c

Please sign in to comment.