Skip to content

Instantly share code, notes, and snippets.

@jaycdave88
Last active July 11, 2023 20:38
Show Gist options
  • Save jaycdave88/60e9d7b69e68bd96534dcca561f52f08 to your computer and use it in GitHub Desktop.
Save jaycdave88/60e9d7b69e68bd96534dcca561f52f08 to your computer and use it in GitHub Desktop.
LenovoSSG
rem Set Datadog Node APM Tracing Library Environment Variables within the application process
SET DD_PROFILING_ENABLED="true"
SET DD_RUNTIME_METRICS_ENABLED="true"
SET DD_ENV="testing"
SET DD_VERSION="3.0.0"
rem Start node application
...
----
// Adding the bunya logging library for Trace_ID injection.
// Full list of settings: https://datadoghq.dev/dd-trace-js/#tracer-settings
const bunyan = require('bunyan')
const logger = bunyan.createLogger({
name: 'dd-trace',
level: 'trace'
})
const tracer = require('dd-trace').init({
env: 'prod',
service: 'my-web-app',
version: '3.0.1',
logInjection: true,
profiling: true,
runtimeMetrics: true,
logger: {
error: err => logger.error(err),
warn: message => logger.warn(message),
info: message => logger.info(message),
debug: message => logger.trace(message),
},
debug: true
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment