| 1 | description: "service-id" |
| 2 | |
| 3 | schemaVersion: "1.13" |
| 4 | |
| 5 | createEntities: |
| 6 | - client: |
| 7 | id: &client client |
| 8 | observeLogMessages: |
| 9 | command: debug |
| 10 | - database: |
| 11 | id: &database database |
| 12 | client: *client |
| 13 | databaseName: &databaseName logging-server-connection-id-tests |
| 14 | - collection: |
| 15 | id: &collection collection |
| 16 | database: *database |
| 17 | collectionName: &collectionName logging-tests-collection |
| 18 | |
| 19 | initialData: |
| 20 | - databaseName: *databaseName |
| 21 | collectionName: *collectionName |
| 22 | documents: [] |
| 23 | |
| 24 | tests: |
| 25 | - description: "command log messages include serviceId when in LB mode" |
| 26 | runOnRequirements: |
| 27 | - topologies: |
| 28 | - load-balanced |
| 29 | operations: |
| 30 | - name: insertOne |
| 31 | object: *collection |
| 32 | arguments: |
| 33 | document: { x: 1 } |
| 34 | - name: find |
| 35 | object: *collection |
| 36 | arguments: |
| 37 | filter: { $or: true } |
| 38 | expectError: |
| 39 | isError: true |
| 40 | expectLogMessages: |
| 41 | - client: *client |
| 42 | messages: |
| 43 | - level: debug |
| 44 | component: command |
| 45 | data: |
| 46 | message: "Command started" |
| 47 | commandName: insert |
| 48 | serviceId: { $$type: string } |
| 49 | - level: debug |
| 50 | component: command |
| 51 | data: |
| 52 | message: "Command succeeded" |
| 53 | commandName: insert |
| 54 | serviceId: { $$type: string } |
| 55 | - level: debug |
| 56 | component: command |
| 57 | data: |
| 58 | message: "Command started" |
| 59 | commandName: find |
| 60 | serviceId: { $$type: string } |
| 61 | - level: debug |
| 62 | component: command |
| 63 | data: |
| 64 | message: "Command failed" |
| 65 | commandName: find |
| 66 | serviceId: { $$type: string } |
| 67 | |
| 68 | - description: "command log messages omit serviceId when not in LB mode" |
| 69 | runOnRequirements: |
| 70 | - topologies: |
| 71 | - single |
| 72 | - replicaset |
| 73 | - sharded |
| 74 | operations: |
| 75 | - name: insertOne |
| 76 | object: *collection |
| 77 | arguments: |
| 78 | document: { x: 1 } |
| 79 | - name: find |
| 80 | object: *collection |
| 81 | arguments: |
| 82 | filter: { $or: true } |
| 83 | expectError: |
| 84 | isError: true |
| 85 | expectLogMessages: |
| 86 | - client: *client |
| 87 | messages: |
| 88 | - level: debug |
| 89 | component: command |
| 90 | data: |
| 91 | message: "Command started" |
| 92 | commandName: insert |
| 93 | serviceId: { $$exists: false } |
| 94 | - level: debug |
| 95 | component: command |
| 96 | data: |
| 97 | message: "Command succeeded" |
| 98 | commandName: insert |
| 99 | serviceId: { $$exists: false } |
| 100 | - level: debug |
| 101 | component: command |
| 102 | data: |
| 103 | message: "Command started" |
| 104 | commandName: find |
| 105 | serviceId: { $$exists: false } |
| 106 | - level: debug |
| 107 | component: command |
| 108 | data: |
| 109 | message: "Command failed" |
| 110 | commandName: find |
| 111 | serviceId: { $$exists: false } |