Skip to content

Commit dc55a71

Browse files
authored
DOCS-15016 add apiversion to serverStatus (#443) (#514)
* DOCS-15016 add apiversion to serverStatus * add code block to versioned-api.txt * remove quotes * remove reference to 4.7 * Add placeholder comments * Add context * verb tense update * populates -> appears * xuerui comments #1 * command -> metric * monospace appname on versioned-api.txt * a -> for a
1 parent 13d1b3e commit dc55a71

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

source/reference/command/serverStatus.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4840,6 +4840,11 @@ metrics
48404840
.. code-block:: javascript
48414841

48424842
"metrics" : {
4843+
"apiVersions": {
4844+
"<appName1>": <string>,
4845+
"<appName2>": <string>,
4846+
"<appName3>": <string>
4847+
},
48434848
"aggStageCounters" : {
48444849
"<aggregation stage>" : NumberLong(<num>)
48454850
},
@@ -5016,6 +5021,36 @@ metrics
50165021

50175022
*New in version 4.4 (4.2.6 and 4.0.19).*
50185023

5024+
.. _server-status-apiVersions:
5025+
5026+
.. serverstatus:: metrics.apiVersions
5027+
5028+
A document with client applications and the version of Stable
5029+
API which they are configured with. Consider the following when
5030+
viewing ``metrics.apiVersions``:
5031+
5032+
- The only possible returned values for each ``appname`` are
5033+
``default`` or ``1``.
5034+
5035+
- API version metrics are retained for 24 hours. If
5036+
no commands are issued with a specific API version from an
5037+
application in the past 24 hours, that ``appname`` and API version
5038+
will be removed from the metrics. This also applies to the
5039+
``default`` API version metric.
5040+
5041+
- Set the ``appname`` when connecting to a MongoDB instance by
5042+
specifying the ``appname`` in the connection URI. ``?appName=ZZZ``
5043+
sets the ``appname`` to ``ZZZZ``.
5044+
5045+
- Drivers accessing the Stable API can set a default ``appname``.
5046+
5047+
- If no ``appname`` is configured, a default value will be
5048+
automatically populated based on the product. For example, for a
5049+
:compass:`MongoDB Compass </>` connection with no ``appname`` in
5050+
the URI, the metric returns: ``'MongoDB Compass': [ 'default' ]``.
5051+
5052+
*New in version 5.0.*
5053+
50195054
.. serverstatus:: metrics.operatorCounters
50205055

50215056
A document with a number that indicates how often

source/reference/stable-api.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,21 @@ By default, clients are *non-strict*. A non-strict client allows you
206206
to run any command, regardless of whether or not it belongs to the
207207
Stable API.
208208

209+
Checking Client API Versions
210+
----------------------------
211+
212+
Use the :dbcommand:`serverStatus` command to check for your
213+
application's configured API version. For each application connected to
214+
your MongoDB instance, an ``appname`` appears in the ``apiVersions``
215+
document.
216+
217+
See :ref:`metrics.apiVersions <server-status-apiVersions>` for more
218+
information.
219+
220+
.. code-block:: javascript
221+
222+
db.runCommand( { serverStatus: 1 } ).metrics.apiVersions
223+
209224
Create a Strict Client
210225
----------------------
211226

source/release-notes/5.0.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,9 @@ Aggregation Metrics
10041004
- :serverstatus:`metrics.dotsAndDollarsFields`
10051005
- :serverstatus:`metrics.operatorCounters`
10061006

1007+
API Version Metrics
1008+
- :serverstatus:`metrics.apiVersions`
1009+
10071010
Replication Metrics
10081011
- :serverstatus:`metrics.repl.reconfig.numAutoReconfigsForRemovalOfNewlyAddedFields`
10091012

0 commit comments

Comments
 (0)