How to use the @opencensus/propagation-stackdriver.generate function in @opencensus/propagation-stackdriver

To help you get started, we’ve selected a few @opencensus/propagation-stackdriver 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 googleapis / nodejs-logging / src / middleware / context.ts View on Github external
export function getOrInjectContext(
  headerWrapper: HeaderWrapper
): context.SpanContext {
  let spanContext = context.extract(headerWrapper);
  if (spanContext) {
    return spanContext;
  }

  // We were the first actor to detect lack of context. Establish context.
  spanContext = context.generate();
  context.inject(headerWrapper, spanContext);
  return spanContext;
}

@opencensus/propagation-stackdriver

Opencensus propagation package for Stackdriver format.

Apache-2.0
Latest version published 3 years ago

Package Health Score

61 / 100
Full package analysis