summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/api/Trace/NoopTracer.php
blob: bc50248bda25b6ca538f51d123a682c2fb034a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

declare(strict_types=1);

namespace OpenTelemetry\API\Trace;

use OpenTelemetry\Context\Context;

final class NoopTracer implements TracerInterface
{
    private static ?self $instance = null;

    public static function getInstance(): self
    {
        if (null === self::$instance) {
            self::$instance = new self();
        }

        return self::$instance;
    }

    public function spanBuilder(string $spanName): SpanBuilderInterface
    {
        return new NoopSpanBuilder(Context::storage());
    }
}