opentracing / opentracing-php

OpenTracing API for PHP
Apache License 2.0
505 stars 56 forks source link

Fluent interface for Span #110

Open memboc opened 4 years ago

memboc commented 4 years ago

Proposal

Would be great to make fluent interface for Span. It's very popular practice

now:

        $scope->getSpan()->setTag(Tags::ERROR, true);
        $scope->getSpan()->setTag(Tags::STATUS_CODE, $httpCode);
        $scope->getSpan()->log(['message' => $response]);

fluent interface:

        $scope->getSpan()
            ->setTag(Tags::ERROR, true)
            ->setTag(Tags::STATUS_CODE, $httpCode)
            ->log(['message' => $response]);