Skip to content

Commit b6bb121

Browse files
authored
[*] remove deprecated reaper constants (#670)
1 parent 48ac24f commit b6bb121

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

internal/reaper/reaper.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ func (r *Reaper) reapMetricMeasurements(ctx context.Context,
379379
}
380380
t1 := time.Now()
381381
if metricStoreMessages == nil {
382-
metricStoreMessages, err = FetchMetrics(ctx, mfm, hostState, r.measurementCh, "", r.Options)
382+
metricStoreMessages, err = FetchMetrics(ctx, mfm, hostState, r.measurementCh, r.Options)
383383
}
384384
t2 := time.Now()
385385

@@ -540,7 +540,6 @@ func FetchMetrics(ctx context.Context,
540540
msg MetricFetchConfig,
541541
hostState map[string]map[string]string,
542542
storageCh chan<- []metrics.MeasurementEnvelope,
543-
context string,
544543
opts *cmdopts.Options) ([]metrics.MeasurementEnvelope, error) {
545544

546545
var dbSettings MonitoredDatabaseSettings
@@ -613,9 +612,9 @@ func FetchMetrics(ctx context.Context,
613612
return nil, nil
614613
}
615614

616-
if msg.MetricName == specialMetricChangeEvents && context != contextPrometheusScrape { // special handling, multiple queries + stateful
615+
if msg.MetricName == specialMetricChangeEvents { // special handling, multiple queries + stateful
617616
CheckForPGObjectChangesAndStore(ctx, msg.DBUniqueName, dbSettings, storageCh, hostState) // TODO no hostState for Prometheus currently
618-
} else if msg.MetricName == recoMetricName && context != contextPrometheusScrape {
617+
} else if msg.MetricName == recoMetricName {
619618
if data, err = GetRecommendations(ctx, msg.DBUniqueName, dbSettings); err != nil {
620619
return nil, err
621620
}

internal/reaper/types.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ const (
1111
tagPrefix string = "tag_"
1212
persistQueueMaxSize = 10000 // storage queue max elements. when reaching the limit, older metrics will be dropped.
1313

14-
gathererStatusStart = "START"
15-
gathererStatusStop = "STOP"
16-
metricdbIdent = "metricDb"
17-
configdbIdent = "configDb"
18-
contextPrometheusScrape = "prometheus-scrape"
19-
2014
monitoredDbsDatastoreSyncIntervalSeconds = 600 // write actively monitored DBs listing to metrics store after so many seconds
2115
monitoredDbsDatastoreSyncMetricName = "configured_dbs" // FYI - for Postgres datastore there's also the admin.all_unique_dbnames table with all recent DB unique names with some metric data
2216

0 commit comments

Comments
 (0)