bugsnag-php icon indicating copy to clipboard operation
bugsnag-php copied to clipboard

Auto on session tracking

Open Cawllec opened this issue 6 years ago • 2 comments

Goal

  • Make AutoCaptureSessions true by default
    • This is the end goal of this PR
  • Allow endpoints to be set through the Client/Configuration after initialization.
    • Previously the endpoint could only be set during initialization by its inclusion in the GuzzleHttp\Client. As the Guzzle client is immutable after instantiation, this meant that any method of ensuring that the notify and session endpoints were both set would be needlessly complex.
    • By removing the notify endpoint setup from initialization, and setting it with the session endpoint in setEndpoint, it allows the same logic that's been used across the other notifiers for setting endpoints to be utilized.
    • This also allows consistency with how the other notifiers work.
  • Ensure only one GuzzleClient is created (by the notifier) during each run and only if necessary.
    • Previously a guzzle client was always created during the initialization, which made up approximately 75% of the initialization memory usage.
    • By lazily creating the guzzle client when necessary, it saves a lot of the Bugsnag overhead in scenarios where no notifications will be delivered.
    • This is also required by this PR to allow users to configure a custom guzzle to be used for testing or custom delivery setup, which they may have required previously.

Cawllec avatar Feb 06 '19 09:02 Cawllec

I've removed the non-pertinent changes that were a part of this PR originally, and attempted to clarify a number of the questions that require more context.

Cawllec avatar Feb 12 '19 14:02 Cawllec

This is on hold for now, and will require review and possibly redevelopment in the future

Cawllec avatar Nov 01 '19 09:11 Cawllec