
All access is read-only. Openlayer never writes to your Elastic
deployment, never runs an agent, and never changes anyone’s privileges there.
The API key you create only needs to read one index pattern and list your
agents.
This page is for agents you build in Elastic Agent Builder. If you want to
send traces from your own application — one you instrument yourself — use the
OpenTelemetry integration instead. The two are
independent.
How it works
Once connected, Openlayer:- Finds your agents — lists them from the Agent Builder catalog
(
GET /api/agent_builder/agents) and merges in any agent id seen on a trace, so agents that have been deleted from the catalog but still have history are not lost. - Reads the trace data streams — searches
traces-agent_builder.otel-*for spans belonging to the agents you enabled. - Groups spans into conversation rounds — all spans sharing a
trace_idare one round, which becomes one Openlayer trace. - Maps Elastic’s OTel spans onto Openlayer steps — reusing the same OpenTelemetry GenAI parser that every other Openlayer OTel source goes through, so Agent Builder traces behave like any other trace once ingested.
- Keeps pulling on a schedule — every 15, 30, or 60 minutes, resuming from a durable cursor so nothing is dropped and nothing is ingested twice.
Prerequisites
- An Elastic deployment running Agent Builder, with trace collection enabled (see below).
- An Elasticsearch API key with the two privileges in The minimum Elastic role.
- The Admin role in your Openlayer workspace. Connecting, disconnecting, and enabling agents are all admin-only actions.
Enable trace collection in Elastic
Agent Builder does not record traces until an administrator turns collection on.- In Kibana, open Stack Management → GenAI Settings.
- Enable Collect conversation traces for Agent Builder.
- Have at least one conversation with an agent — the data stream is created on first write.
missing_data_streams rather than treating it as a bad credential, so you can tell “not set up yet”
apart from “wrong key”.
The minimum Elastic role
Openlayer needs exactly two privileges: read the trace streams, and list the agents.Verified least-privilege role
PUT /_security/role/read-only-role, then create an API key restricted to
it. Repeat the applications block for each additional Kibana space you want to ingest.
This role has been verified end to end against a live Elastic Cloud
deployment. It is genuinely minimal: it grants no cluster privileges at
all — a key with this role gets
403 on GET /, and the connector never
needs cluster:monitor/main. view_index_metadata is not required
either; it only helps Openlayer enumerate data streams by name.feature_agentBuilder.readis the privilege that unlocks the Agent Builder API.feature_aiAssistant.readlooks like the right one and is not — it returns403onGET /api/agent_builder/agents.- The
applicationvalue is literallykibana-.kibana, not your deployment name.
Setup guide
Step 1: Open the integration
In Openlayer, go to Workspace settings → Integrations and choose Elastic Agent Builder.Step 2: Create the API key
In Kibana, create an API key restricted to the role above (Stack Management → API keys, orPOST /_security/api_key). Copy the encoded key — Openlayer
encrypts it at rest and never returns it again.
Step 3: Connect
Fill in the Connect card:
Click Test connection before connecting. It distinguishes four failure modes rather than
returning one generic error:
You can paste either the Kibana host (
https://<deployment>.kb.<region>.<cloud>.elastic.cloud) or
the Elasticsearch host (*.es.*). Openlayer stores the Elasticsearch host and rewrites .kb.
to .es. for you — then rewrites it back to .kb. when it calls the Kibana Agent Builder API,
because the agent catalog only lives on the Kibana host. Both legs use the same API key.Step 4: Enable the agents you want
Discovered agents appear in the Agents card with a Synced traces count. Nothing is ingested until you enable an agent. Enabling an agent creates an Openlayer project and inference pipeline for it, or maps it onto ones you already have. Agent enablement is independent of space scoping: narrowing the spaces changes which streams are read, not which agents are on.Turning Automatically enable new agents off later preserves your current
selections — it does not re-enable agents you deliberately disabled, and it
does not disable ones already running.
Step 5: Confirm traces are arriving
Use Sync now in the Settings card rather than waiting for the next scheduled run. Traces appear on the project created for the agent, not on the integration page.Privacy and content capture
By default, Elastic records structural metadata only: model, provider, latency, token usage, status, and hashed or anonymized identifiers. Prompt and response content, system instructions, tool arguments, tool results, real names, and real IDs are each a separate administrator opt-in in Elastic’s GenAI settings. The Overview card tells you which case you are in, under Content capture:- Prompt and tool content observed — Openlayer has seen real content on your traces.
- Metadata only — Elastic has not sent prompt, response, system, or tool content. Latency, token usage, model, and status still sync.
custom, and identifiers may be stable hashes rather than the
real agent ids. That is Elastic’s anonymization, not Openlayer’s — it is what was written to the
index.
Sync, backfill, and deduplication
Openlayer tracks a durable cursor of
(@timestamp, span.id) per agent. That pair — rather than a
timestamp alone — is what makes overlapping windows safe: spans written in the same millisecond are
still ordered, so a retried window re-reads the same spans and skips the ones already written.
Two consequences worth knowing:
- A failed tick does not lose data. The cursor only advances past traces that were written successfully, so the next run retries the same window rather than skipping it.
- A conversation still in progress is left alone. Rounds whose newest span is less than 60 seconds old are held back, so Openlayer does not ingest half a trace and then never revisit it.
Settings
The Settings card controls ongoing sync:- Periodic sync — pause or resume scheduled pulls. Pausing preserves everything already ingested.
- Sync frequency — 15, 30, or 60 minutes.
- Sync now — run a sync immediately instead of waiting.
Backfilling history
Use the Backfill action in an agent’s row menu to import history from before you connected, capped at 90 days. Backfill is deduplicated against what you already have, so it is safe to run over a window you have already synced.Disconnecting
Disconnect stops all syncing and removes the stored credential. Traces already ingested are preserved — disconnecting is not a delete. Reconnecting later resumes from a fresh cursor.Troubleshooting
No agents listed. The Kibana leg is failing or the space is wrong. Confirm the key hasfeature_agentBuilder.read on the target space, then Sync now. A 403 mentioning
agentBuilder:read almost always means the role has feature_aiAssistant.read instead.
missing_privileges. Grant read on traces-agent_builder.otel-*. Note that
view_index_metadata is optional — its absence is not the cause.
missing_data_streams. Either trace collection is off in Stack Management → GenAI Settings,
no conversation has been recorded yet, or the spaces you scoped to have no traces. The index pattern
does not exist until the first conversation is written.
Traces arrive but the request row is empty. Elastic is in metadata-only mode — check Content
capture on the Overview card and enable the content opt-ins in Elastic.
Provider reads elastic instead of the real vendor. When an agent calls a model through
Elastic’s Inference service, Elastic reports itself as the provider and names the model with its own
connector id, such as anthropic-claude-4.5-sonnet. Openlayer rewrites the documented connector
prefixes — Anthropic, OpenAI, Azure OpenAI, Bedrock, Gemini, Cohere, Mistral, and DeepSeek — back to
the real vendor and model. A custom connector id outside that set passes through unchanged, which
also leaves cost estimation without a model id to price against.
A sync errored and then recovered. Expected. The cursor does not advance past a failed write, so
the next tick retries the same window. No gap, no duplicates.