Assets Module

Browser SDKs should auto-instrument javascript, stylesheet and image assets with the ops resource.script, resource.css and resource.img respectively. The Asset module is technology agnostic, it only cares about span data properties.

Span conventions

Span Description

The description of an asset span should be the full URL of the asset, e.g., https://cdn.com/main.hash123.js?q=11274713.

Span Data

Data KeyTypeDescriptionConditions
http.response_content_lengthintencoded size of the asset in bytes (what is sent over the network)required on all asset operations
http.decoded_response_content_lengthintthe decoded size of the asset in bytesrecommended on all asset operations
http.response_transfer_sizeintthe size of the encoded asset plus the response headers in bytesrecommended on all asset operations
resource.render_blocking_statusstringwhether the resource blocks UI rendering, values are 'non-blocking' or 'blocking'recommended on all asset operations

Instrumentation Example

The SDK should create a span per asset fetched by the browser.

Consider a basic HTML file that fetches a single script:

Copied
<head>
  <script src="https://cdn.com/main.hash123.js"></script>
</head>

Should result in the following span, assuming the request was successful:

Copied
{
  "description": "https://cdn.com/main.hash123.js",
  "op": "resource.script",
  "data": {
    "http.decoded_response_content_length": 123,
    "http.response_content_length": 123,
    "http.response_transfer_size": 123,
    "server.address": "cdn.com",
    ... other span properties
  }
}
You can edit this page on GitHub.