Skip to content

Commit 4fc98ca

Browse files
committed
chore: uses span error API.
1 parent eb76e08 commit 4fc98ca

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

src/Zipkin/Instrumentation/Http/Server/DefaultParser.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,4 @@ public function response(ResponseInterface $response, TraceContext $context, Spa
3131
$span->tag(Tags\ERROR, (string) $response->getStatusCode());
3232
}
3333
}
34-
35-
public function error(Throwable $e, TraceContext $context, SpanCustomizer $span): void
36-
{
37-
$span->tag(Tags\ERROR, $e->getMessage());
38-
}
3934
}

src/Zipkin/Instrumentation/Http/Server/Middleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
8080
$this->parser->response($response, $span->getContext(), $spanCustomizer);
8181
return $response;
8282
} catch (Throwable $e) {
83-
$this->parser->error($e, $span->getContext(), $spanCustomizer);
83+
$span->setError($e);
8484
throw $e;
8585
} finally {
8686
$span->finish();

src/Zipkin/Instrumentation/Http/Server/Parser.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,4 @@ public function request(ServerRequestInterface $request, TraceContext $context,
4343
* payload can be added.
4444
*/
4545
public function response(ResponseInterface $response, TraceContext $context, SpanCustomizer $span): void;
46-
47-
/**
48-
* error parses the exception when doing a HTTP call, usually it is good enough to tag
49-
* the throwable message but depending on the wrapping client, one might want to enrich
50-
* the error with meaningful information from the exception.
51-
*/
52-
public function error(Throwable $e, TraceContext $context, SpanCustomizer $span): void;
5346
}

0 commit comments

Comments
 (0)