ext/pymongo: Add instrumentor (#612)
ext/pymongo: Add instrumentor (#612)

The current Pymongo integration uses the monitoring.register() [1] to hook
the different internal calls of Pymongo. This integration doesn't allow to
unregister a monitor. This commit workaround that limitation by adding an
enable flag to the CommandTracer class and adds a logic to disable the
integration.  This solution is not perfect becasue there will be some overhead
even when the instrumentation is disabled, but that's what we can do with
the current approach.

[1] https://api.mongodb.com/python/current/api/pymongo/monitoring.html#pymongo.monitoring.register

Co-authored-by: Alex Boten <1e5a92690ae5061b029620512ac8ae33d4f3a3b3@lightstep.com>
open-telemetry/opentelemetry-python-contrib,open-telemetry/opentelemetry-python-contrib,open-telemetry/opentelemetry-python-contrib