-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Feature description
Some of the HTTP requests that we track with the Flutter Datadog SDK report Resource size 0b. This causes visibility issues in our dashboards: We would like to see all requests' size so that we can spot large responses, and we can take action and improve our app.
I checked the implementation and it looks like the tracking_http_client only reports Content-Length and if that is not available, the request size will show up as 0b.
We would like to see the response size in the Datadog web UI for all requests are app makes.
Proposed solution
Use Content-Length when available, manually count response bytes otherwise, and report that value as resource size.
Rough draft to clarify idea:
int _bytesReceived = 0;
return innerResponse.listen(
(data) {
_bytesReceived += data.length;
if (onData != null) onData(data);
},
// ...
);
final size = innerResponse.contentLength > 0
? innerResponse.contentLength
: (_bytesReceived > 0 ? _bytesReceived : null);
rum.stopResource(rumKey!, statusCode, resourceType, size, attributes);Other relevant information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request