Skip to content

feat(otlp-exporter-base): allow configuring fetch keepalive for browser OTLP exports #6968

Description

@alesiahancharuk

Problem

FetchTransport in @opentelemetry/otlp-exporter-base enables keepalive: true for payloads under the browser keepalive limits (60KB / 9 concurrent). That is great for unload-safe delivery, but some browsers — notably Smart TV Chromium builds (LG webOS, Samsung Tizen) — reject fetch when both:

  1. keepalive is set, and
  2. the request requires a CORS preflight

Typical OTLP/HTTP JSON exports always preflight because they send Content-Type: application/json and often a collector Authorization header. On those platforms every export fails with:

Preflight request for request with keepalive specified is currently not supported

There is currently no public configuration to disable keepalive for browser OTLP exporters.

Proposal

Expose an option on the browser OTLP HTTP exporter / fetch transport, e.g.:

keepalive?: boolean // default: current auto behavior

When keepalive: false, skip the size/count keepalive budgeting and always call fetch without keepalive.

Workaround

We currently force keepalive: false via patch-package on @opentelemetry/otlp-exporter-base until this is available upstream.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions