@@ -398,3 +398,32 @@ Oracle:
398398For more information on the ``JMXConnectionPoolListener`` class, see
399399the API Documentation for
400400`JMXConnectionPoolListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/management/JMXConnectionPoolListener.html>`__.
401+
402+ Include the Driver in Your Distributed Tracing System
403+ -----------------------------------------------------
404+
405+ If you use a **distributed tracing system**, you can include event data from the
406+ driver. A distributed tracing system is an application that
407+ tracks requests as they propagate throughout different services in a
408+ service-oriented architecture.
409+
410+ If you use the driver in a `Spring Cloud <https://spring.io/projects/spring-cloud>`__
411+ application, use
412+ `Spring Cloud Sleuth <https://spring.io/projects/spring-cloud-sleuth>`__ to
413+ include MongoDB event data in the
414+ `Zipkin <https://zipkin.io/>`__ distributed tracing system.
415+
416+ If you do not use Spring Cloud or need to include driver event data in a distributed
417+ tracing system other than Zipkin, you must write a command event listener that
418+ manages `spans <https://docs.spring.io/spring-cloud-sleuth/docs/current-SNAPSHOT/reference/html/getting-started.html#getting-started-terminology>`__
419+ for your desired distributed tracing system. To see an implementation of such a
420+ listener, see the
421+ :github:`TraceMongoCommandListener <spring-cloud/spring-cloud-sleuth/blob/main/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/mongodb/TraceMongoCommandListener.java>`
422+ class in the Spring Cloud Sleuth source code.
423+
424+ To learn more about Spring Cloud Sleuth, see
425+ `Getting Started <https://docs.spring.io/spring-cloud-sleuth/docs/current-SNAPSHOT/reference/html/getting-started.html>`__
426+ in the Spring Cloud Sleuth documentation.
427+
428+ To view a detailed description of a distributed tracing system, see
429+ `Dapper <https://research.google/pubs/pub36356/>`__ from Google Research.
0 commit comments