OpenTelemetry SDK
    Preparing search index...

    Variable ATTR_HTTP_RESPONSE_BODY_CONTENTConst Experimental

    ATTR_HTTP_RESPONSE_BODY_CONTENT: "http.response.body.content" = ...

    The content of the HTTP response body, with any content coding indicated by Content-Encoding removed, captured as a string when the response content is textual or as byte array otherwise.

    Hello world!
    
    {"foo": "bar"}
    

    Captured value MAY be limited in size and thus value is expected to be truncated in many cases. When an instrumentation applies a byte-based limit while capturing the body as a string, it SHOULD truncate on a character boundary so that the recorded value remains valid text.

    Instrumentations MUST NOT capture this attribute by default and MAY provide an option to enable it.

    Warning

    This attribute may contain sensitive information.

    When instrumentations record body, they SHOULD capture the body as string whenever possible as it makes it easier to use in human-readable form, also it allows to implement sanitization if needed.

    Textual content is typically detected based on the Content-Type header using heuristics such as checking if the type/subtype (compared case-insensitively, ignoring any parameters) starts with text/, ends with /json, +json, /xml, +xml, /yaml or +yaml, is application/x-www-form-urlencoded, or if the header declares a charset parameter.

    Instrumentations that implement response body recording MUST NOT intentionally introduce side effects such as changing stream position or closing body stream independently from the application.

    When body is recorded, the instrumentation SHOULD record part of the body that was sent or received at the time HTTP call has ended. Note that HTTP client spans SHOULD end sometime after the response headers are fully read, which may or may not include reading the response body, so on client spans this attribute is often absent or holds only part of the body.

    The value MUST be either a string or a byte array. Instrumentations MUST NOT record a parsed or otherwise structured representation of the body, and MUST NOT base64-encode binary content into a string value.

    This attribute is experimental and is subject to breaking changes in minor releases of @opentelemetry/semantic-conventions.