Skip to content

Problem with gathering stats in MongoDB 5.0.2 v2 #9968

@ypuzyrev

Description

@ypuzyrev

Relevant telegraf.conf:

[[inputs.mongodb]]

  servers = ["mongodb://mongodb_exporter:*****@*****"]

  ## When true, collect per database stats
   gather_perdb_stats = true

  ## When true, collect per collection stats
   gather_col_stats = false

  ## List of db where collections stats are collected
  ## If empty, all db are concerned
  # col_stats_dbs = ["local"]


  ## Optional TLS Config
   tls_ca = "/ssl/ca.pem"
   tls_cert = "/ssl/mongodb.pem"
   tls_key = "/ssl/mongodb.pem"
  ## Use TLS but skip chain & host verification
   insecure_skip_verify = true

# Read metrics about cpu usage
[[inputs.cpu]]
  ## Whether to report per-cpu stats or not
  percpu = true
  ## Whether to report total system cpu stats or not
  totalcpu = true
  ## If true, collect raw CPU time metrics.
  collect_cpu_time = false

# Read metrics about memory usage
[[inputs.mem]]

[[inputs.disk]]
  mount_points = ["/", "/data"]

[[inputs.system]]

[[inputs.exec]]
  commands = ["bash /data/scripts/check_status_ssl.sh"]
  timeout = "3s"
  data_format = "influx"

 # Configuration for the Prometheus client to spawn
 [[outputs.prometheus_client]]
   ## Address to listen on
   listen = ":9216"
   collectors_exclude = ["gocollector","process"]
   metric_version = 2
   expiration_interval = "15s"

System info:

Telegraf version = 1.20.0-1, OS = CentOS8, db = MongoDB 5.0.2

Steps to reproduce:

  1. Install MongoDB 5.0.2
  2. Configure and start telegraf 1.20.0-1
  3. Previous problem: Problem with gather in MongoDB 5.0 #9622

Expected behavior:

Gathering stats.

Actual behavior:

Take a bug:

Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: panic: interface conversion: interface {} is nil, not bool
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: goroutine 188 [running]:
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: github.com/influxdata/telegraf/plugins/inputs/mongodb.NewStatLine({{0xc04f2575808fb5ae, 0x244159a4d, 0x7d68800}, 0xc00
0c1b7a0, 0xc000156620, 0xc001411570, 0xc0011660a8, 0x0, 0xc0011b7d10, 0xc001108cd8, ...}, ...)
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: #011/go/src/github.com/influxdata/telegraf/plugins/inputs/mongodb/mongostat.go:1166 +0x2d85
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: github.com/influxdata/telegraf/plugins/inputs/mongodb.(*Server).gatherData(0xc0010bd590, {0x542d1a0, 0xc00047d440}, 0x
1, 0x0, 0x0, 0x0, {0xc00044ac50, 0x1, 0x1})
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: #011/go/src/github.com/influxdata/telegraf/plugins/inputs/mongodb/mongodb_server.go:353 +0x779
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: github.com/influxdata/telegraf/plugins/inputs/mongodb.(*MongoDB).Gather.func1(0x0)
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: #011/go/src/github.com/influxdata/telegraf/plugins/inputs/mongodb/mongodb.go:167 +0x97
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: created by github.com/influxdata/telegraf/plugins/inputs/mongodb.(*MongoDB).Gather
Oct  5 09:44:00 mongo-test-01 telegraf[1286865]: #011/go/src/github.com/influxdata/telegraf/plugins/inputs/mongodb/mongodb.go:165 +0x68
Oct  5 09:44:00 mongo-test-01 systemd[1]: telegraf.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct  5 09:44:00 mongo-test-01 systemd[1]: telegraf.service: Failed with result 'exit-code'.
Oct  5 09:44:00 mongo-test-01 systemd[1]: telegraf.service: Service RestartSec=100ms expired, scheduling restart.
Oct  5 09:44:00 mongo-test-01 systemd[1]: telegraf.service: Scheduled restart job, restart counter is at 4.
Oct  5 09:44:00 mongo-test-01 systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.

Statistics not gathering

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/execbugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions