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

Lumen does not have the Illuminate\Routing\Events\RouteMatched event. #821

Closed
summerKK opened this issue Dec 20, 2023 · 1 comment · Fixed by #822
Closed

Lumen does not have the Illuminate\Routing\Events\RouteMatched event. #821

summerKK opened this issue Dec 20, 2023 · 1 comment · Fixed by #822

Comments

@summerKK
Copy link
Contributor

How do you use Sentry?

Self-hosted / on-premises

SDK version

4.1

Steps to reproduce

Lumen uses nikic/fast-route instead of illuminate/routing. This event will not be triggered, causing tracing information to be unable to be reported. $this->didRouteMatch is always false

vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php

  public function terminate(Request $request, $response): void
  {
      // If there is no transaction or the HubInterface is not bound in the container there is nothing for us to do
      if ($this->transaction === null || !$this->app->bound(HubInterface::class)) {
          return;
      }

      // We stop here if a route has not been matched unless we are configured to trace missing routes
      if (!$this->didRouteMatch && config('sentry.tracing.missing_routes', false) === false) {
          return;
      }
  }

If it's lumen, can we just determine didRouteMatch based on $response->getStatusCode() === 404

Expected result

Report normally

Actual result

Unable to report

@summerKK
Copy link
Contributor Author

fixed by #822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants