MongoDB client
August 31, 2025 · View on GitHub
Connect helper with integrated OpenTelemetry tracing via the official driver’s monitor and added duration metrics.
- Package:
github.com/beatlabs/patron/client/mongo - Upstream:
go.mongodb.org/mongo-driver/mongo
Usage
cl, err := mongoclient.Connect(ctx, options.Client().ApplyURI(uri))
- Tracing is enabled using
otelmongomonitor. - Patron records an OTEL histogram
mongo.durationwith command name and status.