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

Add Laravel Lumen support #38

Merged
merged 10 commits into from
Dec 2, 2020
Merged

Add Laravel Lumen support #38

merged 10 commits into from
Dec 2, 2020

Conversation

kneitinger
Copy link
Contributor

Purpose

Adds framework detection for Lumen, and upon detection of it, will automatically name transactions by the route name, or in the absence of a usable route name, the controller name (this behavior mirrors our implementation of symfony route naming).

Logs

2020-11-25 01:31:26.579 +0000 (13752 13752) debug: 'Lumen' naming is 'ProductController@show'
2020-11-25 01:31:26.580 +0000 (13752 13752) verbosedebug: RSHUTDOWN processing started
2020-11-25 01:31:26.580 +0000 (13752 13752) verbosedebug: request_uri='/api/v1/items/1'
2020-11-25 01:31:26.581 +0000 (13752 13752) verbosedebug: RSHUTDOWN processing done
2020-11-25 01:31:26.581 +0000 (13752 13752) verbosedebug: post-deactivate processing started
2020-11-25 01:31:26.581 +0000 (13752 13752) verbosedebug: /proc/self read: 7753 of 4096-byte pages
2020-11-25 01:31:26.581 +0000 (13752 13752) debug: txn naming freeze
2020-11-25 01:31:26.584 +0000 (13752 13752) verbosedebug: sending txnname='WebTransaction/Action/ProductController@show' agent_run_id=omitted segment_count=342 duration=510619 threshold=20000 priority=1.612345

Reviewing

It might be helpful to compare this with the Symfony 4 instrumentation, as it is very similar. Lumen uses an Illuminate Request class that extends the Symfony Request class, but routing information is obtained in a slightly different way.

@kneitinger
Copy link
Contributor Author

ok jenkins

@zsistla
Copy link
Contributor

zsistla commented Nov 30, 2020

Thanks for doing this work!

One question regarding exception handling.
For Symfony4 exceptions, we hook onto this to handle exceptions.
For Laravel exceptions, we hook onto this to handle exceptions.

Should something similar be done for lumen?

Lumen says exceptions are handled by App\Exceptions\Handler

agent/fw_lumen.c Outdated Show resolved Hide resolved
@joshuabenuck
Copy link
Contributor

This PR seems to have recent changes from main included in it. Can this be rebased or something so it only includes the changes related to adding Laravel Lumen support?

@kneitinger
Copy link
Contributor Author

ok jenkins

joshuabenuck
joshuabenuck previously approved these changes Dec 1, 2020
@kneitinger kneitinger merged commit bab8316 into newrelic:main Dec 2, 2020
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.

4 participants