@launchdarkly/observability-node - v0.2.1
    Preparing search index...

    Interface Observe

    interface Observe {
        flush(): Promise<void>;
        parseHeaders(headers: Headers | IncomingHttpHeaders): RequestContext;
        recordCount(metric: Metric): void;
        recordError(
            error: Error,
            secureSessionId: undefined | string,
            requestId: undefined | string,
            metadata?: Attributes,
            options?: { span: Span },
        ): void;
        recordHistogram(metric: Metric): void;
        recordIncr(metric: Omit<Metric, "value">): void;
        recordLog(
            message: any,
            level: string,
            secureSessionId?: string,
            requestId?: string,
            metadata?: Attributes,
        ): void;
        recordMetric(metric: Metric): void;
        recordUpDownCounter(metric: Metric): void;
        runWithHeaders<T>(
            name: string,
            headers: Headers | IncomingHttpHeaders,
            cb: (span: Span) => T | Promise<T>,
            options?: SpanOptions,
        ): Promise<T>;
        setAttributes(attributes: Attributes): void;
        startWithHeaders<T>(
            spanName: string,
            headers: Headers | IncomingHttpHeaders,
            options?: SpanOptions,
        ): { ctx: Context; span: Span };
        stop(): Promise<void>;
    }
    Index

    Methods

    • Flushes all pending telemetry data

      Returns Promise<void>

    • Record an error.

      Parameters

      • error: Error
      • secureSessionId: undefined | string
      • requestId: undefined | string
      • Optionalmetadata: Attributes
      • Optionaloptions: { span: Span }

      Returns void

    • Logs a message with optional session and request context

      Parameters

      • message: any
      • level: string
      • OptionalsecureSessionId: string
      • OptionalrequestId: string
      • Optionalmetadata: Attributes

      Returns void

    • Runs a callback with headers context and returns the result

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

    • Sets attributes on the active span

      Parameters

      • attributes: Attributes

      Returns void

    • Starts a span with headers context

      Type Parameters

      • T

      Parameters

      Returns { ctx: Context; span: Span }

    • Stops the observability client and flushes remaining data

      Returns Promise<void>