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 input plugin: Adding per DB stats #1466

Merged
merged 1 commit into from
Jul 19, 2016
Merged

Conversation

victorgp
Copy link
Contributor

@victorgp victorgp commented Jul 8, 2016

I'm adding stats per DB (configurable by gather_db_stats parameter) obtained with db.stats()

And stored in a different measurement called mongodb_db_stats because storing all these data in the same one ends up a big mess with null values everywhere.

Useful to see how each DB grow by size, indexes, number of collections, etc.

@victorgp
Copy link
Contributor Author

@sparrc does this look good?

@sparrc
Copy link
Contributor

sparrc commented Jul 14, 2016

I've been on vacation and then gophercon so haven't had a chance to review yet, please be patient as I work through my backlog :)

@@ -32,6 +33,7 @@ var sampleConfig = `
## mongodb://10.10.3.33:18832,
## 10.0.0.1:10000, etc.
servers = ["127.0.0.1:27017"]
gather_db_stats = true (false by default)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to gather_per_db_stats = false (and delete the comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -10,6 +10,7 @@
## mongodb://10.10.3.33:18832,
## 10.0.0.1:10000, etc.
servers = ["127.0.0.1:27017"]
gather_db_stats = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change to gather_perdb_stats, so it's clear what this option is doing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guys, we are trying to use gather_per_db stats in InfluxDB 1.0-beta3 and it keeps giving us this error:
Error parsing /apps/dftmongo/bin/telegraf/conf/telegraf.conf, line 50: field corresponding to gather_perdb_stats' is not defined in*mongodb.MongoDB'

I thought the latest release notes for Telegraf 1.0-Beta3 said this feature was enabled. Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is incorrectly labelled in the changelog, sorry about that, it's not available yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that
@sparrc do you want me to update the changelog? where should i put it? in "v1.0 [unreleased]"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that would be great, thx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sparrc
Copy link
Contributor

sparrc commented Jul 19, 2016

You'll also need to rebase the changes so I can merge

@victorgp
Copy link
Contributor Author

Done and rebased

@sparrc
Copy link
Contributor

sparrc commented Jul 19, 2016

thanks @victorgp

@vaishaleee
Copy link

When I set gather_perdb_stats in conf file, I get following error,

Error parsing /apps/dftmongo/bin/telegraf/conf/telegraf.conf, line 51: field corresponding to gather_perdb_stats' is not defined in*mongodb.MongoDB'

My conf file is,
[[inputs.mongodb]]
servers = ["mongodb://xxxx:[email protected]:18000/mydatabase?authSource=admin"]
gather_perdb_stats = true

if I remove gather_perdb_stats it works ok.

@sparrc
Copy link
Contributor

sparrc commented Jul 28, 2016

it's not in a release yet

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

Successfully merging this pull request may close these issues.

4 participants