How to use the jaeger-client.ProbabilisticSampler function in jaeger-client

To help you get started, we’ve selected a few jaeger-client 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 moleculerjs / moleculer-metrics / packages / moleculer-jaeger / src / index.js View on Github external
getSampler(serviceName) {
			if (isFunction(this.settings.sampler))
				return this.settings.sampler;

			if (this.settings.sampler.type == "RateLimiting")
				return new Jaeger.RateLimitingSampler(this.settings.sampler.options.maxTracesPerSecond, this.settings.sampler.options.initBalance);

			if (this.settings.sampler.type == "Probabilistic")
				return new Jaeger.ProbabilisticSampler(this.settings.sampler.options.samplingRate);

			if (this.settings.sampler.type == "GuaranteedThroughput")
				return new GuaranteedThroughputSampler(this.settings.sampler.options.lowerBound, this.settings.sampler.options.samplingRate);

			if (this.settings.sampler.type == "RemoteControlled")
				return new RemoteControlledSampler(serviceName, this.settings.sampler.options);

			return new Jaeger.ConstSampler(this.settings.sampler.options && this.settings.sampler.options.decision != null ? this.settings.sampler.options.decision : 1);
		},