Skip to content
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

Merged
merged 3 commits into from
Feb 27, 2018
Merged

Conversation

jcchavezs
Copy link
Owner

@jcchavezs jcchavezs commented Jan 29, 2018

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

@jcchavezs
Copy link
Owner Author

FYI openzipkin/brave#602

{
$routeName = $request->request->get('_route');

if (array_key_exists($routeName, $this->routes)) {

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.

Copy link
Owner Author

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.

@@ -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));
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should run terminate.

@codefromthecrypt
Copy link

codefromthecrypt commented Feb 24, 2018 via email

@jcchavezs
Copy link
Owner Author

@adriancole sure, https://github.com/jcchavezs/zipkin-symfony/pull/6/files#diff-759dcfcf030a5d11ef05f571c336e998R16 covers the case where the request does not match any route.

@jcchavezs jcchavezs merged commit 908cf02 into master Feb 27, 2018
@jcchavezs jcchavezs deleted the adds_router_naming branch February 27, 2018 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants