How to use the dd-trace.use function in dd-trace

To help you get started, we’ve selected a few dd-trace examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github artsy / metaphysics / src / lib / tracer.ts View on Github external
export function init() {
  tracer.init({
    service: DD_TRACER_SERVICE_NAME,
    hostname: DD_TRACER_HOSTNAME,
    plugins: false,
    logger: { debug, error },
    debug: !PRODUCTION_ENV,
  })
  tracer.use("express", {
    // We want the root spans of MP to be labelled as just `metaphysics`
    service: DD_TRACER_SERVICE_NAME,
    headers: ["User-Agent", "X-User-ID"],
  } as any)
  tracer.use("http", {
    service: `${DD_TRACER_SERVICE_NAME}.http-client`,
  })
  tracer.use("graphql", {
    service: `${DD_TRACER_SERVICE_NAME}.graphql`,
    /**
     * NOTE: This means we capture _all_ variables. When/if needed, we can
     *       use this callback to redact sensitive variables.
     */
    variables: variables => variables,
  } as any)
}
github artsy / metaphysics / src / lib / tracer.ts View on Github external
tracer.init({
    service: DD_TRACER_SERVICE_NAME,
    hostname: DD_TRACER_HOSTNAME,
    plugins: false,
    logger: { debug, error },
    debug: !PRODUCTION_ENV,
  })
  tracer.use("express", {
    // We want the root spans of MP to be labelled as just `metaphysics`
    service: DD_TRACER_SERVICE_NAME,
    headers: ["User-Agent", "X-User-ID"],
  } as any)
  tracer.use("http", {
    service: `${DD_TRACER_SERVICE_NAME}.http-client`,
  })
  tracer.use("graphql", {
    service: `${DD_TRACER_SERVICE_NAME}.graphql`,
    /**
     * NOTE: This means we capture _all_ variables. When/if needed, we can
     *       use this callback to redact sensitive variables.
     */
    variables: variables => variables,
  } as any)
}
github artsy / metaphysics / src / lib / tracer.ts View on Github external
export function init() {
  tracer.init({
    service: DD_TRACER_SERVICE_NAME,
    hostname: DD_TRACER_HOSTNAME,
    plugins: false,
    logger: { debug, error },
    debug: !PRODUCTION_ENV,
  })
  tracer.use("express", {
    // We want the root spans of MP to be labelled as just `metaphysics`
    service: DD_TRACER_SERVICE_NAME,
    headers: ["User-Agent", "X-User-ID"],
  } as any)
  tracer.use("http", {
    service: `${DD_TRACER_SERVICE_NAME}.http-client`,
  })
  tracer.use("graphql", {
    service: `${DD_TRACER_SERVICE_NAME}.graphql`,
    /**
     * NOTE: This means we capture _all_ variables. When/if needed, we can
     *       use this callback to redact sensitive variables.
     */
    variables: variables => variables,
  } as any)
}