Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-7463

Investigate changes in SERVER-80676: (SA) Extend the logging system to tag logs with their corresponding service name

    • Type: Icon: Investigation Investigation
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed

      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":{...}} 

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: