ConstOptionalinit: RequestInit<CfProperties<unknown>>Optionaloptions: TracedFetchOptionsimport { instrumentedFetch } from '@grand-board/otel-cloudflare';
// Use like regular fetch
const response = await instrumentedFetch('https://api.example.com/data');
// With options
const response = await instrumentedFetch('https://api.example.com/data', {
method: 'POST',
body: JSON.stringify({ foo: 'bar' }),
});
Instrumented fetch that can be used as a drop-in replacement
Uses the global fetch and automatically adds tracing. The third parameter allows passing TracedFetchOptions.