kinetex - v1.0.0-rc.1
    Preparing search index...

    Function toOTelSpan

    • Convert a log entry to OpenTelemetry-compatible semantic conventions.

      Maps HTTP log entries to OpenTelemetry semantic conventions (HTTP span attributes). Produces span attributes compatible with OpenTelemetry specification v1.21.0+.

      Output format:

      • request: http.request.id, http.request.method, url.full
      • response: http.response.status_code, http.response.body.size, http.time_to_first_byte
      • error: error, error.type, error.message, http.status_code

      Parameters

      • entry: LogEntry

        A log entry from HTTPLogger

      Returns Record<string, unknown>

      OpenTelemetry-compliant span attributes

      const spanAttrs = toOTelSpan(responseEntry);
      // { "http.request.id": "req-123", "http.request.method": "GET", "url.full": "https://api.example.com", ... }