feat: custom fetcher - #2
sittiponghaus wants to merge 4 commits into
Conversation
|
Is this repository open to contributions? |
|
Hey! yes it is |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d61092f. Configure here.
| constructor(config: OTLPExporterConfig) { | ||
| this.url = config.url | ||
| this.headers = Object.assign({}, DEFAULT_OTLP_HEADERS, config.headers) | ||
| this.fetcher = config.fetcher ?? fetch |
There was a problem hiding this comment.
Custom fetcher unused in exporter
High Severity
OTLPExporter accepts and stores config.fetcher, but send still calls global fetch via unwrap(fetch) instead of this.fetcher. Custom fetchers (including VPC bindings shown in the README) are ignored for traces, while OTLPTransport correctly uses this.fetcher.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d61092f. Configure here.


Add custom fetcher support for export via VPC Bindings
Note
Low Risk
Optional API with default
fetchpreserves existing behavior; custom fetch only affects OTLP HTTP export routing when configured.Overview
Adds an optional
fetcher(Fetcher['fetch']) so OTLP telemetry can be sent through a bound implementation (e.g. Workers VPCfetch) instead of only the globalfetch.OTLPTransportandOTLPTransportConfigacceptfetcher, defaulting tofetch, and export requests useunwrap(this.fetcher).OTLPExporterConfig/OTLPExporterstore the same optionalfetcherin the constructor. README adds a Custom Fetcher example wiring trace exporter and log transport fromenv.VPC_BINDING.Reviewed by Cursor Bugbot for commit d61092f. Bugbot is set up for automated code reviews on this repo. Configure here.