From 77c0efacb1a3e9c523a89b819f9d9e2635240dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Ch=C3=A1vez?= Date: Fri, 13 Apr 2018 14:32:29 +0200 Subject: [PATCH] Fixes wording in documentation. --- README.md | 30 ++++++++++++++++++------------ src/OpenTracing/Tracer.php | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 446052a..1b09303 100644 --- a/README.md +++ b/README.md @@ -106,17 +106,23 @@ An example of a linear, two level deep span tree using active spans looks like this in PHP code: ```php -$root = $tracer->startActiveSpan('php'); - - $controller = $tracer->startActiveSpan('controller'); - - $http = $tracer->startActiveSpan('http'); - file_get_contents('http://php.net'); - $http->close(); - - $controller->close(); +// At dispatcher level +$scope = $tracer->startActiveSpan('request'); +... +$scope->close(); +``` +```php +// At controller level +$scope = $tracer->startActiveSpan('controller'); +... +$scope->close(); +``` -$root->close(); +```php +// At RPC calls level +$scope = $tracer->startActiveSpan('http'); +file_get_contents('http://php.net'); +$scope->close(); ``` #### Creating a child span assigning parent manually @@ -247,8 +253,8 @@ SpanOptions wrapper object. The following keys are valid: - `child_of` is an object of type `OpenTracing\SpanContext` or `OpenTracing\Span`. - `references` is an array of `OpenTracing\Reference`. - `tags` is an array with string keys and scalar values that represent OpenTracing tags. -- `finish_span_on_close` is a boolean that determines whether a span should be finished when the -scope is closed or not. +- `finish_span_on_close` is a boolean that determines whether a span should be finished or not when the +scope is closed. ```php $span = $tracer->startActiveSpan('my_span', [ diff --git a/src/OpenTracing/Tracer.php b/src/OpenTracing/Tracer.php index ef63194..220720e 100644 --- a/src/OpenTracing/Tracer.php +++ b/src/OpenTracing/Tracer.php @@ -20,7 +20,7 @@ public function getScopeManager(); * Tracer::getScopeManager()->getActive()->getSpan(), * and null will be returned if {@link Scope#active()} is null. * - * @return ScopedSpan|null + * @return Span|null */ public function getActiveSpan();