Skip to content

Commit

Permalink
removed postgres name, just use dbaas for flag (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorfour authored Feb 28, 2019
1 parent 215dfef commit 59bb6db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions cmd/do-agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (
noProcesses bool
noNode bool
kubernetes string
postgres string
dbaas string
}

// additionalParams is a list of extra command line flags to append
Expand Down Expand Up @@ -81,8 +81,8 @@ func init() {
kingpin.Flag("no-collector.node", "disable processes node collection").Default("false").
BoolVar(&config.noNode)

kingpin.Flag("postgres-metrics-path", "enable DO DBAAS postgres metrics collection (this must be a DO DBAAS postgres metrics endpoint)").
StringVar(&config.postgres)
kingpin.Flag("dbaas-metrics-path", "enable DO DBAAS metrics collection (this must be a DO DBAAS metrics endpoint)").
StringVar(&config.dbaas)
}

func checkConfig() error {
Expand Down Expand Up @@ -162,10 +162,10 @@ func initCollectors() []prometheus.Collector {
}
}

if config.postgres != "" {
k, err := collector.NewScraper("dopostgres", config.postgres, postgresWhitelist, defaultTimeout)
if config.dbaas != "" {
k, err := collector.NewScraper("dodbaas", config.dbaas, dbaasWhitelist, defaultTimeout)
if err != nil {
log.Error("Failed to initialize DO DBaaS postgres metrics collector: %+v", err)
log.Error("Failed to initialize DO DBaaS metrics collector: %+v", err)
} else {
cols = append(cols, k)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/do-agent/whitelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var k8sWhitelist = map[string]bool{
"kube_node_status_capacity": true,
}

var postgresWhitelist = map[string]bool{
var dbaasWhitelist = map[string]bool{

"postgresql_pg_stat_activity_conn_count": true,
"postgresql_pg_stat_database_blks_hit": true,
Expand Down

0 comments on commit 59bb6db

Please sign in to comment.