Skip to content

Commit

Permalink
Revert "Issue-358 | Replace --enable.COLLECTOR with --collector.COLLE…
Browse files Browse the repository at this point in the history
…CTOR (#365)"

This reverts commit 537c995.
Reverted enable.COLLECTOR because it is a breaking change that needs
exahustive testing. By reverting it, we can make the release v0.20.9
without affecting the current behavior for PMM.
  • Loading branch information
percona-csalguero committed Oct 27, 2021
1 parent 6dd4086 commit feb9dc8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ linters:
- testpackage
- wsl
- exhaustivestruct
- forbidigo
issues:
exclude-use-default: false
exclude:
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,10 @@ Currently, these metric sources are implemented:
|\-\-web.listen-address|Address to listen on for web interface and telemetry|\-\-web.listen-address=":9216"|
|\-\-web.telemetry-path|Metrics expose path|\-\-web.telemetry-path="/metrics"|
|\-\-log.level|Only log messages with the given severity or above. Valid levels: [debug, info, warn, error]|\-\-log.level=error|
|\-\-no-collector.diagnosticdata|Disable collecting metrics from getDiagnosticData||
|\-\-no-collector.replicasetstatus|Disable collecting metrics from replSetGetStatus||
|\-\-collector.dbstats|Enable collecting metrics from dbStats||
|\-\-enable.top|Enable collecting metrics from top admin command||
|--version|Show version and exit|
|\-\-version|Show version and exit|

### Build the exporter
### Build the exporter
The build process uses the dockerized version of goreleaser so you don't need to install Go.
Just run `make release` and the new binaries will be generated under the build directory.
```
Expand Down
32 changes: 17 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,23 @@ var (

// GlobalFlags has command line flags to configure the exporter.
type GlobalFlags struct {
CollStatsCollections string `name:"mongodb.collstats-colls" help:"List of comma separared databases.collections to get $collStats" placeholder:"db1.col1,db2.col2"`
IndexStatsCollections string `name:"mongodb.indexstats-colls" help:"List of comma separared databases.collections to get $indexStats" placeholder:"db1.col1,db2.col2"`
URI string `name:"mongodb.uri" help:"MongoDB connection URI" env:"MONGODB_URI" placeholder:"mongodb://user:[email protected]:27017/admin?ssl=true"`
GlobalConnPool bool `name:"mongodb.global-conn-pool" help:"Use global connection pool instead of creating new pool for each http request."`
DirectConnect bool `name:"mongodb.direct-connect" help:"Whether or not a direct connect should be made. Direct connections are not valid if multiple hosts are specified or an SRV URI is used." default:"true"`
WebListenAddress string `name:"web.listen-address" help:"Address to listen on for web interface and telemetry" default:":9216"`
WebTelemetryPath string `name:"web.telemetry-path" help:"Metrics expose path" default:"/metrics"`
LogLevel string `name:"log.level" help:"Only log messages with the given severuty or above. Valid levels: [debug, info, warn, error, fatal]" enum:"debug,info,warn,error,fatal" default:"error"`
DisableDiagnosticData bool `name:"no-collector.diagnosticdata" help:"Disable collecting metrics from getDiagnosticData"`
DisableReplicasetStatus bool `name:"no-collector.replicasetstatus" help:"Disable collecting metrics from replSetGetStatus"`
EnableDBStats bool `name:"collector.dbstats" help:"Enable collecting metrics from dbStats"`
EnableTop bool `name:"enable.top" help:"Enable collecting metrics from top admin command"`
DiscoveringMode bool `name:"discovering-mode" help:"Enable autodiscover collections"`
CompatibleMode bool `name:"compatible-mode" help:"Enable old mongodb-exporter compatible metrics"`
Version bool `name:"version" help:"Show version and exit"`
CollStatsCollections string `name:"mongodb.collstats-colls" help:"List of comma separared databases.collections to get $collStats" placeholder:"db1.col1,db2.col2"`
IndexStatsCollections string `name:"mongodb.indexstats-colls" help:"List of comma separared databases.collections to get $indexStats" placeholder:"db1.col1,db2.col2"`
URI string `name:"mongodb.uri" help:"MongoDB connection URI" env:"MONGODB_URI" placeholder:"mongodb://user:[email protected]:27017/admin?ssl=true"`
GlobalConnPool bool `name:"mongodb.global-conn-pool" help:"Use global connection pool instead of creating new pool for each http request."`
DirectConnect bool `name:"mongodb.direct-connect" help:"Whether or not a direct connect should be made. Direct connections are not valid if multiple hosts are specified or an SRV URI is used." default:"true"`
WebListenAddress string `name:"web.listen-address" help:"Address to listen on for web interface and telemetry" default:":9216"`
WebTelemetryPath string `name:"web.telemetry-path" help:"Metrics expose path" default:"/metrics"`
LogLevel string `name:"log.level" help:"Only log messages with the given severuty or above. Valid levels: [debug, info, warn, error, fatal]" enum:"debug,info,warn,error,fatal" default:"error"`

DisableDiagnosticData bool `name:"disable.diagnosticdata" help:"Disable collecting metrics from getDiagnosticData"`
DisableReplicasetStatus bool `name:"disable.replicasetstatus" help:"Disable collecting metrics from replSetGetStatus"`
EnableDBStats bool `name:"enable.dbstats" help:"Enable collecting metrics from dbStats"`
EnableTop bool `name:"enable.top" help:"Enable collecting metrics from top admin command"`

DiscoveringMode bool `name:"discovering-mode" help:"Enable autodiscover collections"`
CompatibleMode bool `name:"compatible-mode" help:"Enable old mongodb-exporter compatible metrics"`
Version bool `name:"version" help:"Show version and exit"`
}

func main() {
Expand Down

0 comments on commit feb9dc8

Please sign in to comment.