googleapis / nodejs-logging-winston

Node.js client integration between Stackdriver Logging and Winston.
https://cloud.google.com/logging/
Apache License 2.0
105 stars 50 forks source link

Add support for library instrumentation #714

Closed losalex closed 2 years ago

losalex commented 2 years ago

This feature provides an ability to log extra entry with diagnostics structure which contains logging library information. Such entry is logged only once when first entry is written by a process using logging library. In the future, the diagnostic record could be extended to include more details about libraries used, runtime environment, etc. Below is example of how the logging record with diagnostic info looks:

{
 "jsonPayload": {
   "logging.googleapis.com/diagnostic": {
     "instrumentation_source": [
       {
         "name": "nodejs",
         "version": "10.0.1"
       },
       {
         "name": "nodejs-winston",
         "version": "5.0.0"
       }
     ]
   }
 },
 "insertId": "..........CC_7geD6W7jQV1oz_bQ_ee",
 "severity": "INFO",
 "logName": "projects/startup/logs/hello-log",
}