Skip to content

MongoDB: Adding replication lag metric#1066

Closed
victorgp wants to merge 1 commit intoinfluxdata:masterfrom
victorgp:master
Closed

MongoDB: Adding replication lag metric#1066
victorgp wants to merge 1 commit intoinfluxdata:masterfrom
victorgp:master

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