@grand-board/otel-cloudflare - v6.11.0
    Preparing search index...

    Interface InstrumentOptionsObject

    Options object for instrumentation

    interface InstrumentOptionsObject {
        disableExport?: boolean;
        exporter?: OTLPExporterConfig;
        ignoreUrls?: (string | RegExp)[];
        serviceName?: string;
    }
    Index

    Properties

    disableExport?: boolean

    Disable OTLP export entirely (even if env vars are set) Useful for local development without export

    OTLP exporter configuration

    • If not provided (default), auto-detects from env vars:

      • OTEL_EXPORTER_OTLP_ENDPOINT: Base OTLP endpoint
      • OTEL_EXPORTER_OTLP_HEADERS: Headers in "Authorization=Basic xxx" format
      • Or: GRAFANA_INSTANCE_ID + GRAFANA_OTLP_TOKEN for Grafana Cloud
    • If explicitly provided, uses the given config

    • If env vars not set and no explicit config, spans/logs are not exported

    ignoreUrls?: (string | RegExp)[]

    URL patterns to ignore from tracing (fetch handler only) Useful for health check endpoints that don't need tracing

    Can be:

    • string: exact match on pathname (e.g., "/health", "/ready")
    • RegExp: pattern match on pathname (e.g., /^/health/)

    When a request matches, the original handler is called without creating spans

    Default: ["/health", "/healthz", "/ready", "/readyz", "/live", "/livez", "/ping"]

    Pass an empty array to disable default ignoring.

    // Use custom patterns
    instrument(handler, {
    ignoreUrls: ["/health", "/healthz", /^/internal//]
    })
    // Disable default ignoring (trace all URLs)
    instrument(handler, {
    ignoreUrls: []
    })
    serviceName?: string

    Service name for tracing Used as resource attribute