How to use the @opencensus/propagation-stackdriver.StackdriverFormat 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 / cloud-trace-nodejs / src / tracing.ts View on Github external
.get()
      .initialize()
      .catch(err => {
        this.logger.error(
          'StackdriverTracer#start: Disabling the Trace Agent for the',
          `following reason: ${err.message}`
        );
        this.disable();
      });
    cls.get().enable();

    const tracePolicy =
      this.config.overrides.tracePolicy ||
      new BuiltinTracePolicy(this.config.tracePolicyConfig);
    const propagation =
      this.config.overrides.propagation || new StackdriverFormat();

    const tracerComponents = {logger: this.logger, tracePolicy, propagation};

    this.traceAgent.enable(
      this.config.pluginLoaderConfig.tracerConfig,
      tracerComponents
    );
    pluginLoader
      .create(this.config.pluginLoaderConfig, tracerComponents)
      .activate();

    // Require http and https again, now that the plugin loader is activated.
    // This forces them to be patched.
    require('http');
    require('https');

@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