ADK for TypeScript: API Reference
    Preparing search index...

    Function runWithAgentEngineContext

    • Experimental

      Runs fn in a context that continues an Agent Engine request trace.

      When Google-Agent-Engine-Traceparent holds a valid W3C traceparent and no span is active, the Agent Engine span becomes the remote parent of the spans fn starts. An invalid value is ignored. The traceparent header is recorded as the supportID attribute of the invocation's top span.

      Without either header, fn runs in the active context unchanged.

      (Experimental, subject to change)

      Type Parameters

      • T

      Parameters

      • headers: Readonly<Record<string, string | string[] | undefined>>

        The incoming request headers, such as Node's IncomingMessage.headers.

      • fn: () => T

        The request handler to run.

      Returns T

      What fn returns.