-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Helps users quickly understand if a resource script was loaded from a cache or not #79651
Comments
Thanks for considering my proposal! I'll post my algorithm here again, just to have things where they belong: function wasResourceCached(attributes: SpanAttributes): 'hit' | 'miss' | 'unknown' {
const deliveryType = attributes['http.response_delivery_type'];
if (deliveryType != null) {
return deliveryType === '' ? 'miss' : 'hit';
}
const transferSize = attributes['http.http.response_transfer_size'] as number | undefined;
if (!transferSize) {
return 'unknown';
}
if (transferSize > 0) {
return 'miss';
}
const decodedBodySize = attributes['http.decoded_response_content_length'] as number | undefined;
if (!decodedBodySize) {
return 'unknown';
}
if (decodedBodySize > 0) {
return 'hit';
}
return 'unknown';
} (There are some type issues in this code which we should adress to get rid of the typecast. Please feel free to adjust as you see fit!) I'll also link some sources as to where I took this from:
Edit: Updated algorithm to what the SDK is going to send once getsentry/sentry-javascript#13502 lands |
Update: I will make a slight adjustment to what specific strings we send, since the SDK depends on a Relay change (getsentry/relay#4174) to keep things better aligned with the values sent from the browser. We'll not send |
Update: The SDK changes have landed in v8.37.0. So from SDK PoV, the product can now adapt the changes :) |
Problem Statement
Lukas has made a helpful proposal here: getsentry/sentry-javascript#14056
Let's use his logic and new attribute to show users whether a resource span was fetched from a cache or not
Solution Brainstorm
.
Product Area
Explore
The text was updated successfully, but these errors were encountered: