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: Improve state data #2001

Merged
merged 4 commits into from
Dec 16, 2016

Conversation

dougreese
Copy link
Contributor

@dougreese dougreese commented Nov 4, 2016

Required for all PRs:

  • CHANGELOG.md updated (we recommend not updating this until the PR has been approved by a maintainer)
  • Sign CLA (if not already signed)
  • README.md updated (if adding a new plugin)

Adds ARB as a member_status (replica set arbiter). Possible member_status values are now:

  • PRI
  • SEC
  • ARB (new)
  • UNK
  • RTR

The plugin now uses the proper MongoDB replica set state string for state value, as described in the MongoDB documentation. The state value will usually likely be:

  • PRIMARY
  • SECONDARY
  • ARBITER

but might also be:

  • STARTUP
  • STARTUP2
  • ROLLBACK
  • RECOVERING

This differs from previous behavior in that the state would be the same as member_status unless member_status was UNK (and then state was empty). The new behavior provides more information about the actual state of a replica set member.

Note: The other few states in the MongoDB documentation not mentioned are not seen by the Telegraf process, but would be reflected if read.

Adds ARB as a "member_status" (replica set arbiter).
Uses MongoDB replica set state string for "state" value.
@sparrc
Copy link
Contributor

sparrc commented Nov 7, 2016

thanks @dougreese, is this change dependent on the MongoDB version at all?

@sparrc sparrc added this to the 1.2.0 milestone Nov 7, 2016
@dougreese
Copy link
Contributor Author

No, this is not dependent on MongoDB version. All the relevant status data has been in MongoDB for quite some time; at least back through 2.6.

@sparrc sparrc merged commit bc13d32 into influxdata:master Dec 16, 2016
njwhite pushed a commit to njwhite/telegraf that referenced this pull request Jan 31, 2017
* MongoDB input plugin: Improve state data

Adds ARB as a "member_status" (replica set arbiter).
Uses MongoDB replica set state string for "state" value.

* MongoDB input plugin: Improve state data - changelog update
maxunt pushed a commit that referenced this pull request Jun 26, 2018
* MongoDB input plugin: Improve state data

Adds ARB as a "member_status" (replica set arbiter).
Uses MongoDB replica set state string for "state" value.

* MongoDB input plugin: Improve state data - changelog update
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.

2 participants