Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-9454

MongoDB exporter timeouts with a lots of collections

Details

    • Bug
    • Status: Done
    • Critical
    • Resolution: Fixed
    • 2.26.0
    • 2.26.0
    • MongoDB_Exporter
    • Yes
    • 8
    • Yes
    • Yes
    • Yes
    • C/S Core

    Description

      User Impact

      No metrics are collected for MongoDB.

       

      Description

      When a MongoDB instance is being added to PMM, even if the limit of 200 collections is active, the metrics collections is taking too much time.

       

      Here is a debug output:

      ./mongodb_exporter --collector.collstats --collector.collstats-limit=20000 --collector.dbstats --collector.diagnosticdata --collector.indexstats --collector.replicasetstatus --collector.topmetrics --compatible-mode --discovering-mode --mongodb.global-conn-pool --mongodb.uri=mongodb://127.0.0.1:27018
      level=info ts=2022-01-13T18:16:56.477Z caller=tls_config.go:195 msg="TLS is disabled." http2=false
      Start: 2022-01-13 18:17:01.830445413 +0000 UTC m=+5.365602998Finish: 2022-01-13 18:17:01.90742765 +0000 UTC m=+5.442585225
      Total collections count took 76.982227ms
      Collstats collector took 20.625976294s
      DBStats collector took 134.991127ms
      DBStats collector took 679.660172ms
      Top collector took 4.28177123s
      Collstats collector took 23.33693319s
       

      As shown in the example above, Collstats, DBStats and Top Collectors are taking more than 1 second (which is the default timeout in high resolution).

      Also Collectors Collect method is being called twice because since the list of metrics is being made on the fly, on the Describe function is calling prometheus.DescribeByCollect which actually collects the metrics to create a list of metric names so, Collect is being called twice.

       

      Even without Collstats, DBStats and Top are taking too much time, 4-5 Sec. So with smaller limit for Collstat - it would timeout anyway.

      Attachments

        Activity

          People

            jiri.ctvrtka Jiří Čtvrtka
            carlos.salguero Carlos Salguero
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist