@launchdarkly/observability + @launchdarkly/session-replay
    Preparing search index...

    Function convertHeadersToOtelAttributes

    • Converts headers object to OpenTelemetry semantic convention format. Headers are set as individual attributes with the pattern:

      • http.request.header.: value (or [value1, value2] if multiple)
      • http.response.header.: value (or [value1, value2] if multiple)

      According to OTel spec, header values should be arrays when they contain comma-separated values. Single values remain as strings for simpler querying.

      Parameters

      • headers: { [key: string]: string }

        Object with header key-value pairs

      • prefix: "http.request.header" | "http.response.header"

        Either 'http.request.header' or 'http.response.header'

      Returns { [key: string]: string | string[] }

      Object with OTel semantic convention attribute names