-
Notifications
You must be signed in to change notification settings - Fork 15
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
Adds route naming to improve usability. #6
Conversation
0c38e90
to
3260277
Compare
{ | ||
$routeName = $request->request->get('_route'); | ||
|
||
if (array_key_exists($routeName, $this->routes)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi in brave we default to "get not_found" or "get redirected" when we are in a framework that supports routes, but there was no route found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the same case. If $routeName
is null then we return a not_found
. If $routeName != null
and it is not in the routes
then there is something wrong and we fail gracefully.
3260277
to
106d903
Compare
src/ZipkinBundle/Middleware.php
Outdated
@@ -60,7 +69,7 @@ public function onKernelRequest(GetResponseEvent $event) | |||
|
|||
$span = $this->tracing->getTracer()->nextSpan($spanContext); | |||
$span->start(); | |||
$span->setName($request->getMethod()); | |||
$span->setName($this->spanNaming->getName($request)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should run terminate.
106d903
to
a2b006f
Compare
a2b006f
to
59f1bcb
Compare
The intent of not_found or redirected (in span name) is that someone
crawling or DOS attack wont fill up span namespace. And you can easily
search for this by name. So maybe a test of what happens when you get 404
is helpful.
|
@adriancole sure, https://github.com/jcchavezs/zipkin-symfony/pull/6/files#diff-759dcfcf030a5d11ef05f571c336e998R16 covers the case where the request does not match any route. |
This PR allows to use the route path as span name without injecting the
router
as it degrades significantly the performance.For more info read https://github.com/jcchavezs/zipkin-symfony/pull/6/files#diff-04c6e90faac2675aa89e2176d2eec7d8R144