Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does sampler not support PercentageSampler #48

Closed
summerKK opened this issue Aug 17, 2023 · 0 comments
Closed

Why does sampler not support PercentageSampler #48

summerKK opened this issue Aug 17, 2023 · 0 comments

Comments

@summerKK
Copy link
Contributor

Can we consider making a configuration option to support PercentageSampler?
Sampling may be employed to reduce the data collected and reported out of process.
https://github.com/openzipkin/zipkin-php#sampling

    public function createZipkinDriver()
    {
        $tracer = new ZipkinTracer(
            $this->config->get('tracing.service_name'),
            $this->config->get('tracing.zipkin.host'),
            $this->config->get('tracing.zipkin.port'),
            $this->config->get('tracing.zipkin.options.128bit'),
            $this->config->get('tracing.zipkin.options.request_timeout', 5)
        );

        ZipkinTracer::setMaxTagLen(
            $this->config->get('tracing.zipkin.options.max_tag_len', ZipkinTracer::getMaxTagLen())
        );

        return $tracer->init();
    }
    public function init(): Tracer
    {
        $this->tracing = TracingBuilder::create()
            ->havingLocalEndpoint($this->createEndpoint())
            ->havingTraceId128bits($this->usesTraceId128bits)
            ->havingSampler($this->createSampler())
            ->havingReporter($this->createReporter())
            ->build();

        $this->registerDefaultExtractionFormats();
        $this->registerDefaultInjectionFormats();

        return $this;
    }
    protected function createSampler(): Sampler
    {
        return BinarySampler::createAsAlwaysSample();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants