@launchdarkly/observability-react-native
    Preparing search index...

    Interface Observe

    interface Observe {
        flush(): Promise<void>;
        getSessionInfo(): SessionInfo;
        isInitialized(): boolean;
        parseHeaders(headers: Record<string, string>): RequestContext;
        recordCount(metric: Metric): void;
        recordError(
            error: Error,
            attributes?: Attributes,
            options?: { span: Span },
        ): void;
        recordHistogram(metric: Metric): void;
        recordIncr(metric: Metric): void;
        recordLog(message: any, level: string, attributes?: Attributes): void;
        recordMetric(metric: Metric): void;
        recordUpDownCounter(metric: Metric): void;
        runWithHeaders(
            name: string,
            headers: Record<string, string>,
            cb: (span: Span) => any,
            options?: SpanOptions,
        ): any;
        startActiveSpan<T>(
            spanName: string,
            fn: (span: Span) => T,
            options?: SpanOptions,
        ): T;
        startSpan(spanName: string, options?: SpanOptions): Span;
        startWithHeaders(
            spanName: string,
            headers: Record<string, string>,
            options?: SpanOptions,
        ): Span;
        stop(): Promise<void>;
    }
    Index

    Methods

    • Flush all pending telemetry data.

      Returns Promise<void>

    • Get the current session information.

      Returns SessionInfo

    • Check if the observability client is initialized.

      Returns boolean

    • Record a count metric.

      Parameters

      • metric: Metric

        The count metric to record

      Returns void

    • Record an error with optional context.

      Parameters

      • error: Error

        The error to record

      • Optionalattributes: Attributes

        Optional additionalattributes

      • Optionaloptions: { span: Span }

        Optional span options

      Returns void

    • Record a histogram metric.

      Parameters

      • metric: Metric

        The histogram metric to record

      Returns void

    • Record an increment metric.

      Parameters

      • metric: Metric

        The increment metric to record

      Returns void

    • Record a log message.

      Parameters

      • message: any

        The log message

      • level: string

        The log level

      • Optionalattributes: Attributes

        Optional additional attributes

      Returns void

    • Record an up/down counter metric.

      Parameters

      • metric: Metric

        The up/down counter metric to record

      Returns void

    • Run a function with header context.

      Parameters

      • name: string

        The span name

      • headers: Record<string, string>

        The headers

      • cb: (span: Span) => any

        The callback function

      • Optionaloptions: SpanOptions

        Optional span options

      Returns any

    • Start a new active span and run a callback function within its context.

      Type Parameters

      • T

      Parameters

      • spanName: string

        The span name

      • fn: (span: Span) => T

        The callback function to run with the active span

      • Optionaloptions: SpanOptions

        Optional span options

      Returns T

    • Start a new span without making it active.

      Parameters

      • spanName: string

        The span name

      • Optionaloptions: SpanOptions

        Optional span options

      Returns Span

    • Start a span with header context.

      Parameters

      • spanName: string

        The span name

      • headers: Record<string, string>

        The headers

      • Optionaloptions: SpanOptions

        Optional span options

      Returns Span

    • Stop the observability client.

      Returns Promise<void>