How to use the @opencensus/core.SamplerBuilder.getSampler function in @opencensus/core

To help you get started, we’ve selected a few @opencensus/core 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 census-instrumentation / opencensus-node / packages / opencensus-exporter-zpages / src / zpages-frontend / page-handlers / traceconfigz.page-handler.ts View on Github external
private saveChanges(query: Partial): void {
    /** restore the config to default */
    if (query.change === 'restore_default') {
      tracing.tracer.sampler = SamplerBuilder.getSampler(
        this.defaultConfig!.samplingRate
      );
      return;
    }

    /** change the sampling probability value */
    if (query.samplingprobability) {
      tracing.tracer.sampler = SamplerBuilder.getSampler(
        query.samplingprobability
      );
    }
  }
github census-instrumentation / opencensus-node / packages / opencensus-exporter-zpages / src / zpages-frontend / page-handlers / traceconfigz.page-handler.ts View on Github external
private saveChanges(query: Partial): void {
    /** restore the config to default */
    if (query.change === 'restore_default') {
      tracing.tracer.sampler = SamplerBuilder.getSampler(
        this.defaultConfig!.samplingRate
      );
      return;
    }

    /** change the sampling probability value */
    if (query.samplingprobability) {
      tracing.tracer.sampler = SamplerBuilder.getSampler(
        query.samplingprobability
      );
    }
  }