Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Get Prometheus MongoDB aggregation query exporter, either as a binaray from the
For kubernetes users there is an official helm chart for the MongoDB query exporter.
Please read the installation instructions [here](https://github.com/raffis/mongodb-query-exporter/blob/master/chart/mongodb-query-exporter/README.md).

### Docker
You can run the exporter using docker (This will start it using the example config provided in the example folder):
```sh
docker run -e MDBEXPORTER_CONFIG=/config/configv3.yaml -v $(pwd)/example:/config ghcr.io/raffis/mongodb-query-exporter:latest
```

## Usage

```
Expand Down
6 changes: 2 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,12 @@ func initConfig() {
} else {
// Find home directory.
usr, err := user.Current()
if err != nil {
panic(err)
if err == nil {
viper.AddConfigPath(usr.HomeDir + "/.mongodb_query_exporter")
}

// System wide config
viper.AddConfigPath("/etc/mongodb_query_exporter")
// Search config in home directory with name ".mongodb_query_exporter" (without extension).
viper.AddConfigPath(usr.HomeDir + "/.mongodb_query_exporter")
}

viper.SetConfigType("yaml")
Expand Down