# Error retrieving collection totals from Mongo module metric beat

**URL:** <https://discuss.elastic.co/t/error-retrieving-collection-totals-from-mongo-module-metric-beat/254861>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [November 10, 2020, 7:54am UTC](https://discuss.elastic.co/t/error-retrieving-collection-totals-from-mongo-module-metric-beat/254861 "2020-11-10T07:54:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarund](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@tarund](https://discuss.elastic.co/u/tarund)\
**Post date:** [November 10, 2020, 7:54am UTC](https://discuss.elastic.co/t/error-retrieving-collection-totals-from-mongo-module-metric-beat/254861/1 "2020-11-10T07:54:34Z")

</div>

Hi,

I have configured metric beat on mongodb sending data to Elasticsearch. I am getting data except for collstats. I am 2000+ databases in mongo. So, probably the number of metrics of collstats is large.  
I am getting the below error from metricbeat mongodb module for collstats metricset.  
Is there a limit of 16MB on the json size. How can we increase it ?

```auto
{
  "_index": "metricbeat-7.3.2-2020.06.03-000001",
  "_type": "_doc",
  "_id": "q-ISsXUB8oCfemQBNWYp",
  "_version": 1,
  "_score": null,
  "_source": {
    "@timestamp": "2020-11-10T07:32:07.009Z",
    "ecs": {
      "version": "1.0.1"
    },
    "host": {
      "containerized": false,
      "name": "mongo",
      "hostname": "mongo.nze.com",
      "architecture": "x86_64",
      "os": {
        "kernel": "3.10.0-514.el7.x86_64",
        "codename": "Core",
        "platform": "centos",
        "version": "7 (Core)",
        "family": "redhat",
        "name": "CentOS Linux"
      },
      "id": "05e5a8dc48ed4764ad739d4df280b6dd"
    },
    "metricset": {
      "name": "collstats"
    },
    "service": {
      "type": "mongodb",
      "address": "test.nze.com:27019"
    },
    "event": {
      "module": "mongodb",
      "duration": 1168734966,
      "dataset": "mongodb.collstats"
    },
    "error": {
      "message": "Error retrieving collection totals from Mongo instance: BSONObj size: 19536693 (0x12A1B35) is invalid. Size must be between 0 and 16793600(16MB) First element: note: \"all times in microseconds\""
    },
    "tags": [
      "3",
    ],
    "agent": {
      "version": "7.3.2",
      "name": "mongo",
      "type": "metricbeat",
      "ephemeral_id": "a8a8b0da-a18d-4306-8e6b-69e859c9517b",
      "hostname": "mongo.nze.com",
      "id": "17d0d1d9-c9c8-445c-b388-7d9ef6ead244"
    }
  },
  "fields": {
    "@timestamp": [
      "2020-11-10T07:32:07.009Z"
    ]
  },
  "highlight": {
    "metricset.name": [
      "@kibana-highlighted-field@collstats@/kibana-highlighted-field@"
    ]
  },
  "sort": [
    1604993527009
  ]
}

```

> indent preformatted text by 4 spaces

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 8, 2020, 9:54am UTC](https://discuss.elastic.co/t/error-retrieving-collection-totals-from-mongo-module-metric-beat/254861/2 "2020-12-08T09:54:36Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
