--- id: opentelemetry-instrumentation-pymongo version: "0.65b0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-instrumentation-pymongo — OpenTelemetry pymongo instrumentation License: permissive · Maintenance: active · Downloads: 5.4M/mo ## What it is and what it does This package integrates pymongo with OpenTelemetry, the industry-standard observability framework. It automatically captures database operations as distributed traces, allowing you to see MongoDB queries alongside other application telemetry in your observability backend. The instrumentation depends on opentelemetry-api, opentelemetry-instrumentation, and opentelemetry-semantic-conventions to provide the tracing infrastructure. It's designed for applications that already use OpenTelemetry for application-wide observability and need to extend that visibility into their MongoDB layer. Once installed and initialized, it intercepts pymongo calls and emits spans with operation details, timing, and status information compatible with standard OpenTelemetry exporters. Use it for: - Add MongoDB query tracing to a microservice already instrumented with OpenTelemetry. - Correlate slow database operations with application performance issues in a distributed system. - Export pymongo activity to a centralized observability platform like Jaeger or Datadog. - Debug application behavior by viewing the full trace of database operations in context. - Monitor database performance and query patterns across your fleet of services. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds automatic tracing and observability instrumentation for pymongo database operations, capturing MongoDB queries and performance metrics for OpenTelemetry. Yes, if you are already using OpenTelemetry in your application and need to instrument pymongo. The package is actively maintained, has low install friction, and carries a permissive license. The beta version status warrants checking release notes before production use, but the recent activity and top-5000 popularity suggest it is stable enough for most use cases. ## Install pip install opentelemetry-instrumentation-pymongo uv add opentelemetry-instrumentation-pymongo poetry add opentelemetry-instrumentation-pymongo ## Installing opentelemetry-instrumentation-pymongo Before you install: Low friction install with three stable runtime dependencies. Active maintenance as of 2026-07-16, repository shows recent activity. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions. Quickstart: pip install opentelemetry-instrumentation-pymongo from opentelemetry.instrumentation.pymongo import PymongoInstrumentor PymongoInstrumentor().instrument() Requires Python 3.10 or later; pymongo must be installed separately in your application. Verify before relying: - Whether this package automatically instruments existing pymongo connections or requires explicit setup per connection. - What span attributes and metrics are captured for different pymongo operations (find, insert, update, delete). - Whether the beta status (0.65b0) indicates known limitations or breaking changes expected before 1.0. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 5.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pymongo tracing, mongodb observability, opentelemetry instrumentation, database query monitoring, pymongo performance metrics, mongodb span collection, distributed tracing mongodb, observability, distributed-tracing, mongodb [View on SkillFed](https://skillfed.io/packages/opentelemetry-instrumentation-pymongo) · [View on PyPI](https://pypi.org/project/opentelemetry-instrumentation-pymongo/)