RequestTraceConfiginterface
Properties (21)
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| canBeRoot⚓︎ | boolean | true | x | Whether request instrumentation spans can be root spans of new traces. This allows you to trace requests without any instrumentation in your own code, but may create a large number of traces. This will not affect metrics. |
| enabled⚓︎ | boolean | x | Whether fetch and XHR requests will be instrumented with traces automatically. |
|
| errorStatusCodes⚓︎ | (string | number)[] | ["4xx", "5xx"] | x | An array of HTTP response status codes to consider as errors. Status code families can be described as 4xx, 5xx, etc. |
| ignorePattern⚓︎ | string | x | x | Optional regex pattern for URLs that should be excluded from auto instrumentation. |
| ignoreTelemetryURLs⚓︎ | boolean | true | x | If |
| matchPattern⚓︎ | string | x | x | Optional regex pattern, if specified, only matching URLs will be auto instrumented. |
| platform⚓︎ | boolean | false | x | If |
| preInit⚓︎ | boolean | true | x | Unless |
| requestBodyDownloadDurationMetric⚓︎ | boolean | string | null | false | x | If Same population and cost caveats as requestTotalDurationMetric: successful requests with an observable body completion only, and enabling it causes abandoned fetch response bodies to be downloaded in full. |
| requestBodyDownloadDurationMetricBuckets⚓︎ | number[] | [0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60, 120, 240] | x | Explicit histogram bucket boundaries for requestBodyDownloadDurationMetric, in seconds, ascending. |
| requestBodyDownloadThroughputMetric⚓︎ | boolean | string | null | false | x | If Derived from the same observation as requestBodyDownloadDurationMetric (same population and cost caveats), so it contributes samples only for successful requests with an observable body completion - and only bodies of at least 32KB: smaller transfers complete within the initial congestion window and would measure round-trip time, not bandwidth. Per-stream effective throughput: concurrent transfers share the link. |
| requestBodyDownloadThroughputMetricBuckets⚓︎ | number[] | [65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456] | x | Explicit histogram bucket boundaries for requestBodyDownloadThroughputMetric, in bytes per second, ascending. |
| requestBytesMetric⚓︎ | boolean | string | null | false | x | If |
| requestFirstByteDurationMetric⚓︎ | boolean | string | null | false | x | If Deliberately not named after the semantic convention: samples other instrumentations publish under "http.client.request.duration" cover the full operation, and mixing time-to-headers samples into that name would skew cross-tool comparisons - the semconv name is instead the default of requestTotalDurationMetric. Cheap and always available: measured for every request (including failures, until the failure), with no response body observation required. |
| requestFirstByteDurationMetricBuckets⚓︎ | number[] | [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10] | x | Explicit histogram bucket boundaries for requestFirstByteDurationMetric, in seconds, ascending. The default is the semantic-convention-recommended set for HTTP client durations, which suits time-to-first-byte distributions well. |
| requestTotalDurationMetric⚓︎ | boolean | string | null | false | x | If Successful requests only. Requests whose body completion cannot be observed (e.g. streaming responses) contribute no sample, so this metric's sample count is expected to be lower than requestFirstByteDurationMetric's. Cost caveat: when this or requestBodyDownloadDurationMetric is enabled, body delivery of every
non-streaming fetch response is observed by fully reading a clone of the body. As a
side effect, responses the application abandons without reading (e.g. only checking
|
| requestTotalDurationMetricBuckets⚓︎ | number[] | [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, 30, 60, 120, 240] | x | Explicit histogram bucket boundaries for requestTotalDurationMetric, in seconds, ascending. The default is the semantic-convention-recommended set (this metric carries the semconv name by default), extended upward to cover long transfers of large payloads; overriding the sub-10s boundaries trades away comparability with other instrumentations that use the recommended set. |
| responseBytesMeasurement⚓︎ | "content-length" | "raw" | "both" | "content-length" | x | Which measurement responseBytesMetric (and the corresponding span data) reports:
|
| responseBytesMetric⚓︎ | boolean | string | null | false | x | If |
| spanNames⚓︎ | "semconv" | "product" | "semconv" | x | Controls only the naming of the fetch/XHR request spans. "semconv" (default) names the spans by the normalized HTTP request method (e.g. "GET"), per the OTEL semantic conventions for HTTP client spans. "product" keeps the product span names ("interopio.api.instrumentation.fetch"/".xhr"). Everything else is the same in both modes: the spans always carry the semconv attributes (url.full, http.request.method[_original], http.response.status_code, http.response.header.*, server.address/server.port, http.request.body.size / http.response.body.size, error.type), span kind CLIENT, and the semconv status rules. The filtering identity is also unaffected: span filters match these spans on source "interopio.api.instrumentation.fetch"/".xhr" and on context.url / context.method. |
| trace⚓︎ | boolean | true | x | If |