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

Improve nested Sinatra app instrumentation #1097

Merged
merged 1 commit into from
Jun 19, 2024

Commits on Jun 18, 2024

  1. Improve nested Sinatra app instrumentation

    Sinatra apps, mounted in Rails app, would run into the issue that the
    Rails middleware has already created a transaction for the request. It
    would "force" a new transaction to be made, which loses information from
    everything that happened before it.
    
    Previously, before PR #1089, it would also leave a transaction that was
    not closed properly. Even with that change, for one request, now two
    transactions are created, one for Rails and one for the nested Sinatra
    app.
    
    This change reads if there's a current transaction from the request env,
    and uses that instead of creating a new one. Some logic in the
    Transaction class would read from the request object given to it on
    `Transaction.create` to set metadata like parameters, so these need to
    be set manually now.
    
    It will also make sure not to close the transaction if one existed
    already before this middleware was called.
    
    Part of #329, the Rack middleware refactor.
    tombruijn committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    39e3342 View commit details
    Browse the repository at this point in the history