DataDog / dd-sdk-kotlin-multiplatform

Datadog SDK for Kotlin Multiplatform
Apache License 2.0
8 stars 0 forks source link

RUM-5233: Report response size in Ktor instrumentation #93

Closed 0xnm closed 1 month ago

0xnm commented 1 month ago

What does this PR do?

This PR brings the ability to report response size in Ktor instrumentation by reading Content-Size header.

However, it may be missing for the chunked response or for the streams (in that case we cannot report response size anyway), or engines like OkHttp may drop it compression-like Content-Encoding is applied.

In Android SDK in that case we try to read response body manually, but it seems it is somewhat complicated / dangerous to do with Ktor, because:

Review checklist (to be filled by reviewers)