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

Fix Laravel Lumen txn naming #135

Merged
merged 1 commit into from
Apr 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions agent/fw_lumen.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "util_strings.h"

/*
* Sets the web transaction name. If strip_base == true,
* Sets the web transaction name. If strip_base == true,
* leading class path components will be stripped.
*/
static int nr_lumen_name_the_wt(const char* name TSRMLS_DC,
Expand All @@ -36,6 +36,8 @@ static int nr_lumen_name_the_wt(const char* name TSRMLS_DC,
} else {
path += 1;
}
} else {
path = name;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed otherwise the path is NULL when strip_base is set to false

}

nr_txn_set_path(
Expand Down Expand Up @@ -103,7 +105,7 @@ NR_PHP_WRAPPER(nr_lumen_handle_found_route) {

if (NULL != route_name) {
if (NR_SUCCESS
!= nr_lumen_name_the_wt_from_zval(route_name TSRMLS_CC, "Lumen", 0)) {
!= nr_lumen_name_the_wt_from_zval(route_name TSRMLS_CC, "Lumen", false)) {
nrl_verbosedebug(NRL_TXN, "Lumen: located route name is a non-string");
}
} else {
Expand All @@ -119,7 +121,7 @@ NR_PHP_WRAPPER(nr_lumen_handle_found_route) {
if (NULL != controller_name) {
if (NR_SUCCESS
!= nr_lumen_name_the_wt_from_zval(controller_name TSRMLS_CC, "Lumen",
1)) {
true)) {
nrl_verbosedebug(NRL_TXN,
"Lumen: located controller name is a non-string");
}
Expand Down Expand Up @@ -163,7 +165,7 @@ NR_PHP_WRAPPER(nr_lumen_exception) {
*/
class_name = get_active_class_name(&ignored TSRMLS_CC);
name = nr_formatf("%s@%s", class_name, get_active_function_name(TSRMLS_C));
nr_lumen_name_the_wt(name TSRMLS_CC, "Lumen", 1);
nr_lumen_name_the_wt(name TSRMLS_CC, "Lumen", true);
nr_free(name);

exception = nr_php_arg_get(1, NR_EXECUTE_ORIG_ARGS TSRMLS_CC);
Expand Down