Skip to content

Commit 17c0fd3

Browse files
jason-price-mongodbandf-mongodb
authored andcommitted
DOCS-13884 Log profiler changes
1 parent 4ac3f9e commit 17c0fd3

File tree

5 files changed

+36
-20
lines changed

5 files changed

+36
-20
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Starting in MongoDB 5.0 (also available starting in 4.4.2, 4.2.12, and
2+
4.0.22), changes made to the :ref:`database profiler
3+
<database-profiler>` ``level``, ``slowms``, ``sampleRate``, or
4+
``filter`` using the :dbcommand:`profile` command or
5+
:method:`db.setProfilingLevel()` wrapper method are recorded in the
6+
:option:`log file <mongod --logpath>`.

source/reference/command/profile.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Definition
1515

1616
.. dbcommand:: profile
1717

18-
.. versionchanged:: 4.4.2
18+
.. versionchanged:: 5.0
1919

2020
For a :binary:`~bin.mongod` instance, the command enables, disables,
2121
or configures the :doc:`/tutorial/manage-the-database-profiler`. The
@@ -42,13 +42,15 @@ Definition
4242
:ref:`filter <set-profiling-level-options-filter>` affect
4343
only the diagnostic log.
4444

45-
(*Starting in MongoDB 4.0*): For :binary:`~bin.mongos` instance, the
45+
Starting in MongoDB 4.0, for a :binary:`~bin.mongos` instance, the
4646
command only configures how operations get written to the diagnostic
4747
log. You cannot enable the
4848
:doc:`/tutorial/manage-the-database-profiler` on a
4949
:binary:`~bin.mongos` instance because ``mongos`` does not have any
5050
collections that the profiler can write to.
5151

52+
.. include:: /includes/log-changes-to-database-profiler.rst
53+
5254
On :binary:`~bin.mongos`, you can set ``profile`` level to:
5355

5456
- ``0`` to set the ``slowms``, ``sampleRate``, and ``filter`` for

source/reference/method/db.setProfilingLevel.txt

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Definition
1717

1818
.. method:: db.setProfilingLevel(level, options)
1919

20-
.. versionchanged:: 4.4.2
20+
.. versionchanged:: 5.0
2121

2222
For a :binary:`~bin.mongod` instance, the method enables, disables,
2323
or configures the :doc:`/tutorial/manage-the-database-profiler`. The
@@ -28,22 +28,22 @@ Definition
2828
log.
2929

3030
If the :ref:`database profiler level <set-profiling-level-level>` is
31-
``1`` or ``2`` (i.e. the :doc:`database profiler
31+
``1`` or ``2`` (specifically, the :doc:`database profiler
3232
</tutorial/manage-the-database-profiler/>` is enabled), the
3333
:ref:`slowms <set-profiling-level-options-slowms>`,
3434
:ref:`sampleRate <set-profiling-level-options-sampleRate>` affect
3535
the behavior of both the profiler and the :option:`diagnostic log
3636
<mongod --logpath>`.
3737

3838
If the :ref:`database profiler level <set-profiling-level-level>` is
39-
``0`` (i.e. :doc:`database profiler
39+
``0`` (specifically, :doc:`database profiler
4040
</tutorial/manage-the-database-profiler/>` is disabled), the
4141
:ref:`slowms <set-profiling-level-options-slowms>` and
4242
:ref:`sampleRate <set-profiling-level-options-sampleRate>`, affect
4343
only the diagnostic log.
4444

45-
(*Starting in MongoDB 4.0*): For a :binary:`~bin.mongos` instance,
46-
the method sets the ``slowms``, ``sampleRate`` and ``filter``
45+
Starting in MongoDB 4.0, for a :binary:`~bin.mongos` instance, the
46+
method sets the ``slowms``, ``sampleRate`` and ``filter``
4747
configuration settings, which configure how operations get written to
4848
the diagnostic log. You cannot enable the
4949
:doc:`/tutorial/manage-the-database-profiler` on a
@@ -62,6 +62,8 @@ Definition
6262
:method:`db.setProfilingLevel()` provides a wrapper around the
6363
:dbcommand:`profile` command.
6464

65+
.. include:: /includes/log-changes-to-database-profiler.rst
66+
6567
Syntax
6668
~~~~~~
6769

@@ -97,7 +99,7 @@ Parameters
9799

98100
.. include:: /includes/database-profiler-levels.rst
99101

100-
Since profiling is not available on :binary:`~bin.mongos`,
102+
Because profiling is not available on :binary:`~bin.mongos`,
101103
:method:`db.setProfilingLevel()` cannot be used to set the profiling
102104
level to a value other than ``0`` on a :binary:`~bin.mongos` instance.
103105

@@ -128,9 +130,9 @@ Parameters
128130
For :binary:`~bin.mongod` instances, the setting affects both the
129131
diagnostic log and, if enabled, the profiler.
130132

131-
For :binary:`~bin.mongos` instances, the setting affects the
132-
diagnostic log only and not the profiler since profiling is not
133-
available on :binary:`~bin.mongos`.
133+
For :binary:`~bin.mongos` instances, the setting affects
134+
the diagnostic log only and not the profiler because
135+
profiling is not available on :binary:`~bin.mongos`.
134136

135137
.. note::
136138
This argument affects the same setting as the configuration
@@ -149,9 +151,9 @@ Parameters
149151
For :binary:`~bin.mongod` instances, the setting affects both the
150152
diagnostic log and, if enabled, the profiler.
151153

152-
For :binary:`~bin.mongos` instances, the setting affects the
153-
diagnostic log only and not the profiler since profiling is not
154-
available on :binary:`~bin.mongos`.
154+
For :binary:`~bin.mongos` instances, the setting affects
155+
the diagnostic log only and not the profiler because
156+
profiling is not available on :binary:`~bin.mongos`.
155157

156158
.. note::
157159
This argument affects the same setting as the configuration option
@@ -170,9 +172,9 @@ Parameters
170172
For :binary:`~bin.mongod` instances, the setting affects both the
171173
diagnostic log and, if enabled, the profiler.
172174

173-
For :binary:`~bin.mongos` instances, the setting affects the
174-
diagnostic log only and not the profiler since profiling is not
175-
available on :binary:`~bin.mongos`.
175+
For :binary:`~bin.mongos` instances, the setting affects
176+
the diagnostic log only and not the profiler because
177+
profiling is not available on :binary:`~bin.mongos`.
176178

177179
For an example of a filter used to control logged
178180
operations, see :ref:`profiler-filter-example`.

source/release-notes/5.0.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ See:
251251
- :method:`db.setProfilingLevel()`
252252
- :dbcommand:`profile`
253253

254+
Log Changes to Database Profiler Settings
255+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
256+
257+
.. include:: /includes/log-changes-to-database-profiler.rst
258+
254259
``serverStatus`` Output Change
255260
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
256261

source/tutorial/manage-the-database-profiler.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ When enabled, profiling has an effect on database performance and
3131
disk use. See :ref:`Database Profiler Overhead<database-profiling-overhead>` for more information.
3232

3333
This document outlines a number of key administration options for the
34-
database profiler. For additional related information, consider the
35-
following resources:
34+
database profiler. For additional related information, see:
3635

3736
- :doc:`/reference/database-profiler`
3837
- :doc:`Profile Command </reference/command/profile>`
@@ -53,7 +52,7 @@ The following profiling levels are available:
5352
Enable and Configure Database Profiling
5453
---------------------------------------
5554

56-
You can enable database profiling for :binary:`~bin.mongod` instances .
55+
You can enable database profiling for :binary:`~bin.mongod` instances.
5756

5857
This section uses the :binary:`~bin.mongo` shell helper
5958
:method:`db.setProfilingLevel()` helper to enable profiling. For
@@ -86,6 +85,8 @@ The ``"ok" : 1`` key-value pair indicates the operation succeeded:
8685
To verify the new setting, see the
8786
:ref:`database-profiling-view-status` section.
8887

88+
.. include:: /includes/log-changes-to-database-profiler.rst
89+
8990
Global and Per-Database Profiling Settings
9091
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9192

0 commit comments

Comments
 (0)