[COMPASS-7463] Investigate changes in SERVER-80676: (SA) Extend the logging system to tag logs with their corresponding service name Created: 16/Nov/23  Updated: 29/Nov/23  Resolved: 29/Nov/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

Type: Investigation Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-80676 (SA) Extend the logging system to tag... Closed
Documentation Changes: Not Needed

 Description   
Original Downstream Change Summary

As a result of changes introduced here, logging messages produced by servers with the embeddedRouter feature flag set will contain a new top-level attribute between the "ctx" and "msg" fields named "svc". As such, any log ingestion that is sensitive to the format of log messages may need to be updated to account for the presence of this field.

Example of the same (truncated) log line before and after this change:
```
[js_test:config_settings_schema] s20043| {"t":

{"$date":"2023-11-01T14:49:14.124+00:00"}

,"s":"I", "c":"COMMAND", "id":51803, "ctx":"ClusterServerParameterRefresher","msg":"Slow query","attr" ...
[js_test:config_settings_schema] s20043| {"t":

{"$date":"2023-11-01T15:00:05.151+00:00"}

,"s":"I", "c":"COMMAND", "id":51803, "svc":"r", "ctx":"ClusterServerParameterRefresher","msg":"Slow query","attr":
```

Description of Linked Ticket

By embedding the router service into the MongoD binary, the process will combine logging information for both router and shard roles in the same file, i.e., mongod.log.

To discriminate log traces produced by routers and shards with the same content (e.g., Slow query), a new attribute should be added to the log traces to specify the role that produced it. For example:

{"t":{"$date":"2023-08-08T08:56:43.638+00:00"},"s":"I","c":"COMMAND",  "id":51803,"service":"router","ctx":"conn6","msg":"Slow query","attr":{...}} 



 Comments   
Comment by Rhys Howell [ 29/Nov/23 ]

No devtools impact, we aren't sensitive to the server log fields

Generated at Wed Feb 07 22:46:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.