From ee3fa5310e48d5f8c251fb13e73d03cee9db7f29 Mon Sep 17 00:00:00 2001 From: Luca Abbati Date: Wed, 19 Dec 2018 15:23:33 +0100 Subject: [PATCH 1/2] [laravel4] properly save status code tag --- src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php b/src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php index 8adbc501d8..4caf772166 100644 --- a/src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php +++ b/src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php @@ -104,7 +104,7 @@ public function boot() GlobalTracer::get()->flush(); }); - dd_trace('Illuminate\Foundation\Application', 'handle', function () use ($requestSpan) { + dd_trace('\Illuminate\Routing\Router', 'dispatch', function () use ($requestSpan) { $args = func_get_args(); $response = call_user_func_array([$this, 'handle'], $args); From f41147dc240e398aacc32621b16cd5b758e59f3d Mon Sep 17 00:00:00 2001 From: Luca Abbati Date: Wed, 19 Dec 2018 15:29:25 +0100 Subject: [PATCH 2/2] [laravel4] Properly handle status code tag names in both exception and success calls --- CHANGELOG.md | 3 +++ src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c252a230d..2669abc7b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file - [docs/chan ### Added - PHP code compatibility with PHP 5.4 #194 +### Fixed +- Properly set http status code tag in Laravel 4 integration #195 + ## [0.8.1] ### Fixed - Update Symfony 3 and 4 docs #184 diff --git a/src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php b/src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php index 4caf772166..521dc2d701 100644 --- a/src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php +++ b/src/DDTrace/Integrations/Laravel/V4/LaravelProvider.php @@ -104,14 +104,17 @@ public function boot() GlobalTracer::get()->flush(); }); - dd_trace('\Illuminate\Routing\Router', 'dispatch', function () use ($requestSpan) { + // Properly handle status code tag names in both exception and success calls + $handler = function () use ($requestSpan) { $args = func_get_args(); $response = call_user_func_array([$this, 'handle'], $args); $requestSpan->setTag(Tags\HTTP_STATUS_CODE, $response->getStatusCode()); return $response; - }); + }; + dd_trace('Illuminate\Foundation\Application', 'handle', $handler); + dd_trace('\Illuminate\Routing\Router', 'dispatch', $handler); dd_trace('Illuminate\Routing\Route', 'run', function () { $scope = LaravelProvider::buildBaseScope('laravel.action', $this->uri);