Web frameworks

    LLM observability for Koa

    koaMiddleware() is the adapter; the rest is the same init() as every other Node.js app.

    Set up Koa

    The snippet is copied from the SDK README, not paraphrased. Keys shown as tk_live_... are the environment key from Settings › Environments.

    TypeScript
    import evalkit from "syntropylabs-evalkit";
    
    evalkit.init({
      subscriptionKey: process.env.EVALKIT_SUBSCRIPTION_KEY!,   // Dashboard → Settings → Tracing
      serviceName: "my-service",
    });
    
    // Every OpenAI / Anthropic / DB / HTTP call from here on is traced automatically.

    Copied from sdk-ts/README.md § Quick start

    Install → first trace

    1. 01

      Install the SDK

      pip install syntropylabs-evalkit or npm install syntropylabs-evalkit.

    2. 02

      Call init() once

      At the top of your entrypoint, with your environment key and a service name.

    3. 03

      Add koaMiddleware()

      Each incoming request becomes a root trace with downstream model, database and HTTP calls nested underneath.

    4. 04

      Send one request and open its trace

      The request appears in Traces as a root span; Services shows the endpoint.

    What a turn looks like

    Sample data in the product’s own table. Hover, focus or tap a claim to see the columns it points at.

    Sample run

    Operation Service StatusModel LatencyTokens≈CostScore
    support_agent.turn8f3a1c0d94e2session sess_4b1esupport-apiokgpt-4o-mini1.84 s3,412$0.000692%auto
    refund_agent.turnc21d7e5a30b8session sess_9a02tool looprefund-workerokclaude-sonnet-44.31 s7,905$0.038968%auto
    claude-code.turn5be04f7d1a96session sess_f77cClaude Codeunsetclaude-sonnet-448.20 s61,208$0.19
    rag.answere9a2b6c4d015errordocs-boterrorgpt-4o6.02 s9,880$0.031241%auto
    voice.turn17c8d3f2a4e0session sess_20d1ivr-agentokgpt-4o-realtime0.92 s1,104$0.0071

    fig. 1 · the traces table this integration fills · sample data

    What you see

    Taken from the SDK READMEs’ coverage tables. with flag means the signal leaves your machine only when you opt in.

    What Syntropylabs shows for Koa
    SignalCapturedDetail
    Each incoming request becomes a root traceyes
    Model, database and HTTP calls nested under the requestyes
    End-user identity on the request’s tracepartialsetUser() inside the request binds the identity to that trace only
    Your own functionswith flagtraceFunction, traceTool, @Traced or traceObject

    Limitations

    • The README names koaMiddleware() in its adapter list and shows a full wiring example for Express only; the docs page carries the per-framework wiring.
    • The TypeScript SDK attaches completion and token counts only on the success path, so a failed stream carries the error but not the partial output; the Python SDK keeps both.

    Next steps

    Trace Koa today

    Tracing is free for one project on every plan, coding-agent traces included. Evaluations, datasets and simulation are Pro and up.