googleapis / nodejs-logging-bunyan

Node.js client integration between Stackdriver Logging and Bunyan.
https://cloud.google.com/logging/
Apache License 2.0
63 stars 34 forks source link

Add support for library instrumentation #630

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-bunyan",
         "version": "4.0.0"
       }
     ]
   }
 },
 "insertId": "..........BB_7geD6W7jQV1oz_bQ_ee",
 "severity": "INFO",
 "logName": "projects/startup/logs/hello-log-bunyan",
}