Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
import type { SpanOptions } from '@opentelemetry/api';
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
export interface CrawleeInstrumentationConfig extends InstrumentationConfig {
requestHandlingInstrumentation?: boolean;
logInstrumentation?: boolean;
customInstrumentation?: ClassMethodToInstrument[];
}
/** One class method to wrap in a span, and the module that has to be loaded for it to exist. */
export interface ClassMethodToInstrument {
/** The Crawlee package the class is exported from, for example `@crawlee/basic`. */
moduleName: string;
/** The class name to patch. */
className: string;
/** The method name to patch. */
methodName: string;
/**
* The name of the span. Defaults to `className.methodName`.
*
* When given a function, it is called with the arguments of the patched method, and `this` is the instance the
* method was called on. The arguments are `any` because they are whatever the patched method receives.
*/
spanName?: string | ((this: any, ...args: any[]) => string);
/** The attributes of the span. Follows the same calling convention as {@link ClassMethodToInstrument.spanName}. */
spanOptions?: SpanOptions | ((this: any, ...args: any[]) => SpanOptions);
}