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: Adding replication lag metric #1066

Closed
wants to merge 1 commit into from

Conversation

victorgp
Copy link
Contributor

To get replication lag data i needed to obtain it from a different command "replSetGetStatus".

The code was meant to work only with a single command "serverStatus", to allow getting data from different places/commands, i changed the structure a little bit
I created a MongoStatus type that holds any other type from any other command, in this case, it has a ServerStatus object (the one that existed before) and a ReplSetStatus object, a new one that i created to store the data from "replSetGetStatus".

Using this approach, adding more metrics that come from different commands is a matter of adding the attribute to the MongoStatus type.

I tested this with a replicated setup and with a non replicated, for the non replicated it won't do anything.

@victorgp victorgp changed the title Adding replication lag metric MongoDB: Adding replication lag metric Apr 21, 2016
@sparrc sparrc closed this in 194288c Apr 22, 2016
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.

1 participant