Skip to main content

What are Agent Gates?

An agent gate is the identity of one agent in Verlon, the way a standard gate is the identity of one LLM call. It answers two questions:
  • What did my agent do? Every run of your agent becomes a trace: a grouped timeline of its LLM calls, tool executions, and sub-agents, with cost, latency, and coverage accounting.
  • What should each call site run on? A call site that needs its own model or settings becomes a job on the gate, changed without redeploying code.
Verlon sits in the request path, so LLM calls are captured automatically. The run and its tools reach Verlon as standard OpenTelemetry spans. There is no Verlon package to install.

When to use an agent gate

A chatbot’s traces are legitimately thin — one generation per turn — and that’s fine: the session grouping (one row per conversation, turns in order) is what the agent gate buys you there.

Vocabulary

Agent gates use standard observability terms with their standard meanings: Every span also carries provenance: Observed (captured at the gateway — ground truth) or OTel (sent by your OpenTelemetry instrumentation). Tool calls that only appear in proxied traffic show as Evidenced — facts without fabricated measurements.

Quickstart

1

Create an agent gate

Dashboard → Agent Gates → Create Agent Gate. Only a name is required — no model configuration. The name (support-agent) is how your code calls it.
2

Give each call site a job

A job is one LLM call site (respond, classify) with its own model. Create it on the gate’s page, or with the API in Jobs. Your code calls it as support-agent/respond.
3

Point OpenTelemetry at Verlon

Any OTLP/HTTP exporter works. Set two environment variables:
4

Mark the run, and call models through the gate

One span per run, marked as an agent. Model calls inside it join the run’s trace. The Node and Python setups below show the full code.
5

Open the gate

The gate’s Traces tab shows every run; click one for the timeline. The Sessions tab groups runs by conversation.

Node

Install the OpenTelemetry SDK, the OTLP exporter, and two instrumentations, alongside the official provider SDK:
For the Anthropic SDK, construct the client the same way with baseURL: 'https://api.verlon.ai', and send the same model.

Python

The openai package (3.x) makes its requests with httpx2, which the OpenTelemetry httpx instrumentation doesn’t cover. Inject the trace context into each call yourself — two lines:

What Verlon reads from your spans

Every other attribute is kept verbatim on its span. The endpoint also reads the common GenAI dialects — the official OTel gen_ai conventions, OpenInference, and OpenLLMetry — so framework instrumentation (Vercel AI SDK telemetry, LangChain instrumentors, the OpenAI Agents SDK through an OTel processor) works without changes.

Tools on the timeline

Two capture modes, and you usually get the first one for free: Evidenced (zero setup). When the model requests a tool and your loop feeds the result back, both directions pass through Verlon. The timeline reconstructs the execution — name, arguments, result — marked Evidenced because the execution itself wasn’t observed (so no made-up durations). Measured (one span per tool). Wrap each execution in a span and it becomes a measured tool span — exact duration, error capture, and visibility for tools the model never sees:

Sessions: multi-turn conversations

gen_ai.conversation.id is the id of the conversation, not the message. Each user message becomes one trace; the shared conversation id is what groups those traces into a session.
Don’t generate a fresh conversation id per message (crypto.randomUUID() inside the message handler is the classic mistake). That creates a one-trace session for every message and grouping never happens. Pass the id your app already has for the conversation — the chat id, thread id, or ticket number. If your Sessions tab shows exactly one trace in every session, this is why.
A session is only a label — a chat resumed after a month just keeps grouping, with no lifecycle to manage. The gate’s Sessions tab shows one row per label with trace counts and cumulative cost. Click a session to read the conversation forward, turn by turn.

In the trace, or beside it?

A trace is the work that produced one run’s output. When a run triggers side work that doesn’t shape its output — generating a chat title, indexing the exchange, firing a notification — give that work its own trace in the same conversation, linked to the run that caused it:
The rule: if the work contributes to the run’s output, it’s a span inside the trace; if the run merely triggers it, it’s a sibling trace with a link. Keeping side work out of the run’s trace keeps the run’s duration and cost honest; the link keeps the causation visible — the run’s page shows “spawned →”, the side work’s page shows “triggered by →”, and the session view draws the edge between the siblings. A link is a reference, never parentage: durations, costs, and coverage never aggregate across it. Links to runs that were never observed are kept and shown as “triggered by an unobserved run” — same honesty rule as coverage.

Jobs: settings per call site

Each LLM call site is a job on the gate, with its own model and settings. Create one with its name and a description of what it does (both required), then set its model and any other groups of settings it should change: $AGENT_GATE_ID is the gate’s id, shown in its page header or returned by GET /v1/gates/name/support-agent; $JOB_ID is job.id from the first call’s response.
Then name the gate and the job in the model field, <gate name>/<job>:
  • A group the job sets (model, system prompt, fallbacks, request defaults, limits, keys) replaces the gate’s whole group. Every change to a job takes effect on the next call, with no redeploy.
  • A call that names a job the gate doesn’t have is refused with a 404 (no_job_named) that lists the gate’s jobs. Names are never registered from traffic, so a typo fails loudly instead of running unconfigured.
  • An agent gate has no model of its own. A call that names the gate without a job, or a job whose model isn’t set, is refused with a 400.
Set the model on every job before its first call. The job’s address in the create response (support-agent/respond) is the string to put in your code.

Sub-agents

An agent calling another agent nests naturally — start the sub-agent’s span inside the parent’s and it becomes an agent span in the same trace:
Recursive agents are safe: each invocation is a new span, so a run always renders as a finite tree.

Crossing process boundaries

Within a process, OpenTelemetry carries the active span for you. Across processes — a queue, a worker, another service — use OpenTelemetry’s standard W3C propagation:
If your services already propagate traceparent (most tracing middleware does), Verlon rides it as-is.

Exporting

  • Endpoint. OTEL_EXPORTER_OTLP_ENDPOINT=https://api.verlon.ai — the exporter adds /v1/traces. If you set a traces-only endpoint instead (OTEL_EXPORTER_OTLP_TRACES_ENDPOINT), give the full https://api.verlon.ai/v1/traces.
  • Auth. Authorization: Bearer <your Verlon API key>. In OTEL_EXPORTER_OTLP_HEADERS, write it as Authorization=Bearer <key>.
  • Formats. OTLP/HTTP with protobuf or JSON bodies, optionally gzip-compressed.
  • Short scripts. The batch processor exports every few seconds. A script that exits sooner must flush first — await sdk.shutdown() in Node, provider.shutdown() (or force_flush()) in Python — or its spans are lost. Long-running servers need nothing extra.
The gateway records each model call the moment it answers; your own spans appear once your exporter sends them.

Cost alerts

Per-gate thresholds under Settings → Cost alerts, both alert-only — a fired alert notifies you and never interrupts a run:
  • Per-trace cost — one run exceeded the threshold (fires once per trace).
  • Per-session cumulative cost — one conversation’s traces add up past the threshold (fires at most once per day per session).

Coverage: what the timeline doesn’t know

Agent gates never present a partial picture as a complete one. Each trace shows a coverage strip: the share of wall-clock covered by observed work (computed correctly under parallelism), with unobserved gaps labeled inline and evidenced-only executions counted. Two boundary rules make the math predictable:
  • The trace’s wall-clock is the run span’s lifetime — from its start to its end, not first child to last. Work inside the run that has no span of its own (a database write before the first model call, post-processing after the last) shows up as an unobserved gap. That’s deliberate: the gap is the honest record that something happened the timeline can’t account for. Give it a tool span if you want it measured, or move it outside the run span if it isn’t part of the run.
  • The run span itself doesn’t count as observation. Coverage measures generations and tools, so a trace whose LLM calls bypassed Verlon reads as 0% covered — not 100% because the run span technically covers everything.