Query oplog only when connected to a replica set (#6307)

This commit is contained in:
Daniel Nelson
2019-08-27 10:31:42 -07:00
committed by GitHub
parent 701339b024
commit 2d2e793c90
5 changed files with 220 additions and 153 deletions

View File

@@ -210,7 +210,7 @@ func (a *Agent) Test(ctx context.Context, waitDuration time.Duration) error {
// Special instructions for some inputs. cpu, for example, needs to be
// run twice in order to return cpu usage percentages.
switch input.Config.Name {
case "inputs.cpu", "inputs.mongodb", "inputs.procstat":
case "cpu", "mongodb", "procstat":
nulAcc := NewAccumulator(input, nulC)
nulAcc.SetPrecision(a.Precision())
if err := input.Input.Gather(nulAcc); err != nil {