Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--mongodb.uri vs MONGODB_URL #108

Open
arvenil opened this issue Sep 10, 2018 · 0 comments
Open

--mongodb.uri vs MONGODB_URL #108

arvenil opened this issue Sep 10, 2018 · 0 comments

Comments

@arvenil
Copy link

arvenil commented Sep 10, 2018

func mongodbDefaultURI() string {
	if u := os.Getenv("MONGODB_URL"); u != "" {
		return u
	}
	return "mongodb://localhost:27017"
}

var (
	mongodbURIFlag = flag.String("mongodb.uri", mongodbDefaultURI(), "Mongodb URI, format: [mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options]")
)

I find it confusing that flag is --mongodb.uri but env is MONGODB_URL - and looks like not only me percona/mongodb_exporter#113
Do you have any preference to change this? Either to MONGODB_URI or flag to --mongodb.url? MongoDB documentation states https://docs.mongodb.com/manual/reference/connection-string/#connection-string-uri-format
I can prepare PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant