-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add repl_oplog_window_s metric to mongodb input #3964
Conversation
64913c1
to
dfb269c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @subuk, this is a great addition, I do have a couple suggestions:
plugins/inputs/mongodb/README.md
Outdated
@@ -57,6 +57,7 @@ and create a single measurement containing values e.g. | |||
* ttl_passes_per_sec | |||
* repl_lag | |||
* jumbo_chunks (only if mongos or mongo config) | |||
* oplog_timediff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should call the field repl_oplog_window_s
. This more closely matches the linked documentation from mongodb, while still using the same repl prefix as the other replication metrics and also includes the units. I sort of dislike _s
because its not immediately clear what it means, but it matches more in style with existing _ns
readings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will rename oplog_timediff
to repl_oplog_window_s
and move it closer to other repl_*
metrics in code.
localdb := s.Session.DB("local") | ||
oplog_collection_name := "" | ||
|
||
collection_names, err := localdb.CollectionNames() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like instead of checking for the existence of this items we should just try to get the data and if it's not there then we don't report anything. This will result in less network calls and checking doesn't guarantee the data will be there later anyway due to possible changes.
How about we just try to get the entries for oplog.rs
and if that fails we can try oplog.$main
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it makes sense, will be fixed.
Fixed. Metric renamed to repl_oplog_window_s, collection list query removed. |
Thank you, this will be in version 1.7.0 |
Hello!
Here is new metric named oplog_timediff.
References:
https://www.mongodb.com/blog/post/replica-set-health-is-more-than-just-replication
https://github.com/DataDog/integrations-core/blob/master/mongo/datadog_checks/mongo/mongo.py#L972
Required for all PRs: