Glimpse / Glimpse.Prototype

Glimpse v2 prototype
MIT License
185 stars 44 forks source link

Can User-Identification message be fired at the beginning of the request #64

Closed avanderhoorn closed 9 years ago

avanderhoorn commented 9 years ago

Just wondering... I know there are edge cases where the user-identification needs to be set at the end of the request, but I'm wondering if there are any times when the message could be sent at the beginning?

Currently when one us looking at a slow request, we get the begin-request-message come in just fine, but there can be loing periods where we are waiting till the end-request-message to come in... during this time we are also missing the user-identification message. If the logic could be setup to send the message sooner (even if the setting of the cookie happens later in the request), this would mean that we could group the request to a user much sooner.

nikmd23 commented 9 years ago

My thoughts:

Since inspectors are basically "just middleware", we're going to run into middleware ordering problems if we try to capture user-identification before the request's response. I think it's best for Glimpse to be the first piece of middleware installed for user simplicity, and greatest accuracy for the response time timer.

This means that the current implementation, is probably the best we can do generically.

By that I mean we may be able to persuade some authentication middleware implementations to publish TelemetrySource (or similar) information as soon as they authenticate a user - but that will only work in cases where users are using that component.

In either case, I'd be weary of showing a request until we know what user is belongs to, since the main screen in the SPA client is user oriented. It might be best to either 1) wait until we know the user of the request or 2) show requests that we don't currently know the user for in a more muted fashion. I'd really like to avoid a request showing up, and then disappearing because it moved to another user in the interface.

All that said, I don't think there's any work to be done on this issue, so I'm going to close it.