You just need to uninstall the legacy integration and install the new version.
In case of need, both versions can coexist in the same host and monitor the same MongoDB instance.
Metrics equivalency between legacy and new version
The new MongoDB integration reports dimensional metrics which have a different structure from sample metrics reported by the legacy integration.
To help you find your old metrics in the new format, see these examples on how they should be queried.
There're several specific dimensions added depending on the metric. Check which dimensions are assigned to each metric on our metric list.
Metrics from the legacy MongoCollectionSample are reported under the prefix mongodb_collstats_.
These specific dimensions have been added: database and collection. Use them to narrow down your queries to a specific database and/or collection.
Legacy metric
New metric
collection.avgObjSizeInBytes
mongodb_collstats_storageStats_avgObjSize
collection.count
mongodb_collstats_storageStats_count
collection.nindexes
mongodb_collstats_storageStats_nindexes
Collection metrics report latency metrics per collection under the prefix mongodb_collstats_latencyStats_.
This is an example of query:
FROM Metric SELECT latest(mongodb_collstats_storageStats_size)WHEREdatabase='DB1'AND collection='Collection1'
Metrics from the legacy MongoConfigServerSample are reported under the prefix mongodb_ss_ (Server Stats) with the cl_role dimension populated with an empty value.
There're several specific dimensions added depending on the metric. Check which dimensions are assigned to each metric.
Legacy metric
New metric
asserts.regularPerSecond
mongodb_ss_asserts
You can use the assert_type dimension to retrieve the value for a specific type of assertion. In this case assert_type='regular'.
commands.insertPerSecond
mongodb_ss_metrics_commands_insert_total
connections.current
mongodb_ss_connections
You can use the conn_type dimension to retrieve the value for a specific type of connection. In this case conn_type='current'.