@@ -18,11 +18,11 @@ Monitoring is the process of getting information about the activities a running
18
18
program performs for use in an application or an application performance
19
19
management library.
20
20
21
- Monitoring the {+driver-short+} to monitor cluster, driver command, and
21
+ You can use the {+driver-short+} to monitor cluster, driver command, and
22
22
connection pool events. These features help you make informed decisions when
23
23
designing and debugging your application.
24
24
25
- In this guide you will learn how to perform these tasks:
25
+ This guide shows how to perform the following tasks:
26
26
27
27
- :ref:`Monitor specific events by using the {+driver-short+} <monitoring-monitor-events>`
28
28
- :ref:`Monitor connection pool events with Java Management Extensions (JMX) and JConsole <monitoring-jmx>`
@@ -56,7 +56,7 @@ The {+driver-short+} organizes the events it defines into three categories:
56
56
- Connection Pool events
57
57
58
58
The following sections show how to monitor each event category. For a full list of the events you can monitor,
59
- `see the event package of the {+language+} driver
59
+ `see the Java event package
60
60
<{+core-api+}/com/mongodb/event/package-summary.html>`__.
61
61
62
62
.. _command-events-kotlin:
@@ -72,8 +72,9 @@ To monitor command events, create a class that implements the
72
72
``CommandListener`` interface and register an instance of that class with your
73
73
``MongoClient`` instance.
74
74
75
- For more information on MongoDB database commands, see the
76
- :manual:`MongoDB manual entry on database commands </reference/command/>`.
75
+ For more information on MongoDB database commands, see the
76
+ :manual:`MongoDB manual entry on database commands </reference/command/>`in
77
+ the {+mdb-server+} manual.
77
78
78
79
.. note:: Internal Commands
79
80
@@ -100,7 +101,7 @@ To make a counter, follow these steps:
100
101
101
102
#. Make a class with counter functionality that implements the ``CommandListener`` interface.
102
103
#. Add an instance of the new class to a ``MongoClientSettings`` object.
103
- #. Configure you ``MongoClient`` instance with the ``MongoClientSettings`` object.
104
+ #. Configure your ``MongoClient`` instance with the ``MongoClientSettings`` object.
104
105
105
106
The following code implements these steps:
106
107
@@ -138,9 +139,9 @@ in the state of the MongoDB instance or cluster you have connected the driver to
138
139
The driver defines nine SDAM events and provides the following listener
139
140
interfaces, which listen for three SDAM events each:
140
141
141
- - ``ClusterListener``: topology-related events
142
- - ``ServerListener``: events related to ``mongod`` or ``mongos`` processes
143
- - ``ServerMonitorListener``: heartbeat related events
142
+ - ``ClusterListener``: Listens for topology-related events
143
+ - ``ServerListener``: Listens for events related to ``mongod`` or ``mongos`` processes
144
+ - ``ServerMonitorListener``: Listens for heartbeat- related events
144
145
145
146
To monitor a type of SDAM event, create a class that implements one of the three
146
147
preceding interfaces and register an instance of that class with your
@@ -151,12 +152,12 @@ For a detailed description of each SDAM event, see the :spec:`MongoDB SDAM monit
151
152
Example
152
153
^^^^^^^
153
154
154
- This example shows how to make a listener class that prints a message that lets
155
- you know if the driver can write to your MongoDB instance.
155
+ This example shows how to make a listener class that prints a message about the write
156
+ availability of your MongoDB instance.
156
157
157
- To make an event that reports write status:
158
+ To make an event that reports write status, perform the following tasks :
158
159
159
- #. Make a class that tracks and checks cluster description changes, and
160
+ #. Make a class that tracks cluster description changes, and
160
161
implements the ``CommandListener`` interface.
161
162
#. Add an instance of the new class to a ``MongoClientSettings`` object.
162
163
#. Configure your ``MongoClient`` instance with the ``MongoClientSettings`` object.
@@ -203,7 +204,7 @@ Example
203
204
This example shows how to make a listener class that prints a message each time
204
205
you check out a connection from your connection pool.
205
206
206
- To make an event that reports connection checkouts:
207
+ To make an event that reports connection checkouts, perform the following tasks :
207
208
208
209
#. Make a class that tracks checkouts and implements the ``CommandListener`` interface.
209
210
#. Add an instance of the new class to a ``MongoClientSettings`` object.
@@ -328,7 +329,7 @@ navigate to JConsole and inspect your connection pools.
328
329
329
330
Navigate to JConsole to see your connection pools...
330
331
331
- Once you have started your server, open JConsole in your terminal using the
332
+ Once you have started your server, open JConsole in your terminal by using the
332
333
following command:
333
334
334
335
.. code-block:: shell
@@ -345,8 +346,8 @@ Once JConsole is open, perform the following actions in the GUI:
345
346
When you no longer want to inspect your connection pools in JConsole, do the
346
347
following:
347
348
348
- #. Exit JConsole by closing the JConsole window
349
- #. Stop the program running by the preceding code snippet
349
+ #. Exit JConsole by closing the JConsole window.
350
+ #. Stop the program running by the preceding code snippet.
350
351
351
352
For more information on JMX and JConsole, see the following resources from
352
353
Oracle:
@@ -367,25 +368,12 @@ tracks requests as they propagate throughout different services in a
367
368
service-oriented architecture.
368
369
369
370
If you use the driver in a `Spring Cloud <https://spring.io/projects/spring-cloud>`__
370
- application, use
371
- `Spring Cloud Sleuth <https://spring.io/projects/spring-cloud-sleuth>`__ to
372
- include MongoDB event data in the
373
- `Zipkin <https://zipkin.io/>`__ distributed tracing system.
371
+ application, use to include MongoDB event data in the `Zipkin
372
+ <https://zipkin.io/>`__ distributed tracing system.
374
373
375
374
If you do not use Spring Cloud or want to include driver event data in a distributed
376
375
tracing system other than Zipkin, you must write a command event listener that
377
- manages `spans
378
- <https://docs.spring.io/spring-cloud-sleuth/docs/current-SNAPSHOT/reference/html/getting-started.html#getting-started-terminology>`__
379
- for your desired distributed tracing system. To see an implementation of such a
380
- listener, see the Java source code for the :github:`TraceMongoCommandListener <spring-cloud/spring-cloud-sleuth/blob/eb01d5952b2e736970efbe3fc7e9784d119eeae9/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/mongodb/TraceMongoCommandListener.java>`
381
- class in the Spring Cloud Sleuth source code.
382
-
383
- To learn more about Spring Cloud Sleuth, see
384
- `Getting Started <https://docs.spring.io/spring-cloud-sleuth/docs/current-SNAPSHOT/reference/html/getting-started.html>`__
385
- in the Spring Cloud Sleuth documentation.
386
-
387
- To view a detailed description of a distributed tracing system, see
388
- `Dapper <https://research.google/pubs/pub36356/>`__ from Google Research.
376
+ manages **spans** for your desired distributed tracing system.
389
377
390
378
.. tip::
391
379
@@ -395,7 +383,9 @@ To view a detailed description of a distributed tracing system, see
395
383
- `Spring Cloud <https://spring.io/projects/spring-cloud>`__
396
384
- `Spring Cloud Sleuth <https://spring.io/projects/spring-cloud-sleuth>`__
397
385
- `spans <https://docs.spring.io/spring-cloud-sleuth/docs/current-SNAPSHOT/reference/html/getting-started.html#getting-started-terminology>`__
398
- - :github:`TraceMongoCommandListener <spring-cloud/spring-cloud-sleuth/blob/eb01d5952b2e736970efbe3fc7e9784d119eeae9/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/mongodb/TraceMongoCommandListener.java>`
386
+ - :github:`TraceMongoCommandListener <spring-cloud/spring-cloud-sleuth/blob/eb01d5952b2e736970efbe3fc7e9784d119eeae9/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/mongodb/TraceMongoCommandListener.java>` : An
387
+ implementation of an event listen than manages spans
399
388
- `Getting Started <https://docs.spring.io/spring-cloud-sleuth/docs/current-SNAPSHOT/reference/html/getting-started.html>`__
400
389
- `Zipkin <https://zipkin.io/>`__
401
- - `Dapper <https://research.google/pubs/pub36356/>`__
390
+ - `Dapper <https://research.google/pubs/pub36356/>`__ : A detailed
391
+ description of a distributed tracing system from Google Research
0 commit comments