...

Text file src/go.mongodb.org/mongo-driver/testdata/command-monitoring/logging/service-id.json

Documentation: go.mongodb.org/mongo-driver/testdata/command-monitoring/logging

     1{
     2  "description": "service-id",
     3  "schemaVersion": "1.13",
     4  "createEntities": [
     5    {
     6      "client": {
     7        "id": "client",
     8        "observeLogMessages": {
     9          "command": "debug"
    10        }
    11      }
    12    },
    13    {
    14      "database": {
    15        "id": "database",
    16        "client": "client",
    17        "databaseName": "logging-server-connection-id-tests"
    18      }
    19    },
    20    {
    21      "collection": {
    22        "id": "collection",
    23        "database": "database",
    24        "collectionName": "logging-tests-collection"
    25      }
    26    }
    27  ],
    28  "initialData": [
    29    {
    30      "databaseName": "logging-server-connection-id-tests",
    31      "collectionName": "logging-tests-collection",
    32      "documents": []
    33    }
    34  ],
    35  "tests": [
    36    {
    37      "description": "command log messages include serviceId when in LB mode",
    38      "runOnRequirements": [
    39        {
    40          "topologies": [
    41            "load-balanced"
    42          ]
    43        }
    44      ],
    45      "operations": [
    46        {
    47          "name": "insertOne",
    48          "object": "collection",
    49          "arguments": {
    50            "document": {
    51              "x": 1
    52            }
    53          }
    54        },
    55        {
    56          "name": "find",
    57          "object": "collection",
    58          "arguments": {
    59            "filter": {
    60              "$or": true
    61            }
    62          },
    63          "expectError": {
    64            "isError": true
    65          }
    66        }
    67      ],
    68      "expectLogMessages": [
    69        {
    70          "client": "client",
    71          "messages": [
    72            {
    73              "level": "debug",
    74              "component": "command",
    75              "data": {
    76                "message": "Command started",
    77                "commandName": "insert",
    78                "serviceId": {
    79                  "$$type": "string"
    80                }
    81              }
    82            },
    83            {
    84              "level": "debug",
    85              "component": "command",
    86              "data": {
    87                "message": "Command succeeded",
    88                "commandName": "insert",
    89                "serviceId": {
    90                  "$$type": "string"
    91                }
    92              }
    93            },
    94            {
    95              "level": "debug",
    96              "component": "command",
    97              "data": {
    98                "message": "Command started",
    99                "commandName": "find",
   100                "serviceId": {
   101                  "$$type": "string"
   102                }
   103              }
   104            },
   105            {
   106              "level": "debug",
   107              "component": "command",
   108              "data": {
   109                "message": "Command failed",
   110                "commandName": "find",
   111                "serviceId": {
   112                  "$$type": "string"
   113                }
   114              }
   115            }
   116          ]
   117        }
   118      ]
   119    },
   120    {
   121      "description": "command log messages omit serviceId when not in LB mode",
   122      "runOnRequirements": [
   123        {
   124          "topologies": [
   125            "single",
   126            "replicaset",
   127            "sharded"
   128          ]
   129        }
   130      ],
   131      "operations": [
   132        {
   133          "name": "insertOne",
   134          "object": "collection",
   135          "arguments": {
   136            "document": {
   137              "x": 1
   138            }
   139          }
   140        },
   141        {
   142          "name": "find",
   143          "object": "collection",
   144          "arguments": {
   145            "filter": {
   146              "$or": true
   147            }
   148          },
   149          "expectError": {
   150            "isError": true
   151          }
   152        }
   153      ],
   154      "expectLogMessages": [
   155        {
   156          "client": "client",
   157          "messages": [
   158            {
   159              "level": "debug",
   160              "component": "command",
   161              "data": {
   162                "message": "Command started",
   163                "commandName": "insert",
   164                "serviceId": {
   165                  "$$exists": false
   166                }
   167              }
   168            },
   169            {
   170              "level": "debug",
   171              "component": "command",
   172              "data": {
   173                "message": "Command succeeded",
   174                "commandName": "insert",
   175                "serviceId": {
   176                  "$$exists": false
   177                }
   178              }
   179            },
   180            {
   181              "level": "debug",
   182              "component": "command",
   183              "data": {
   184                "message": "Command started",
   185                "commandName": "find",
   186                "serviceId": {
   187                  "$$exists": false
   188                }
   189              }
   190            },
   191            {
   192              "level": "debug",
   193              "component": "command",
   194              "data": {
   195                "message": "Command failed",
   196                "commandName": "find",
   197                "serviceId": {
   198                  "$$exists": false
   199                }
   200              }
   201            }
   202          ]
   203        }
   204      ]
   205    }
   206  ]
   207}

View as plain text