<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title><![CDATA[Agentic Observability - Elastic Observability Labs]]></title>
    <description><![CDATA[Trusted security news & research from the team at Elastic.]]></description>
    <copyright><![CDATA[© 2026. Elasticsearch B.V. All Rights Reserved]]></copyright>
    <image>
      <title><![CDATA[Agentic Observability - Elastic Observability Labs]]></title>
      <url>https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltad972c1c27dbefc6/6a88d9782904ea5e8511d473/observability-labs-thumbnail.png</url>
      <link>https://www.elastic.co/observability-labs/blog/category/agentic-observability</link>
    </image>
    <link>https://www.elastic.co/observability-labs/blog/category/agentic-observability</link>
    <atom:link href="https://www.elastic.co/observability-labs/rss/category/agentic-observability.xml" rel="self" type="application/rss+xml"/>
    <language><![CDATA[en]]></language>
    <lastBuildDate>Wed, 16 Sep 2026 02:07:58 GMT</lastBuildDate>
  <item>
    <title><![CDATA[Collecting rootless Podman logs with Elastic Agent: the CRI parser, user-scoped paths, and the Podman socket]]></title>
    <description><![CDATA[Rootless Podman containers write their logs in CRI format. This Fleet policy reads them and attaches container.* fields, with the match_source_index value that rootless paths need.]]></description>
    <content:encoded><![CDATA[<p>Rootless Podman exposes a Docker-compatible API, but its logs are a different matter. They use CRI format, they live under the user's home directory, and the API socket is per-user. The Elastic Docker integration is built for Docker's JSON logs and its <code>/var/lib</code> paths, so a Custom Logs integration is the right input here. Collecting rootless Podman logs with Elastic Agent needs three settings: <code>format: cri</code> on the container parser, a file path into the user's <code>overlay-containers</code> storage, and <code>add_docker_metadata</code> pointed at the rootless Podman socket with <code>match_source_index: 7</code>. The default of <code>4</code> is correct for Docker's shorter path.</p><p>This post builds that pipeline from a real debugging session and ends with Agent Builder diagnosing a Jellyfin playback failure from the enriched logs. It also covers the alternatives, <code>journald</code> and the OpenTelemetry Collector, and when to prefer them.</p><h2>How rootless Podman logs differ from Docker logs</h2><p>The Docker integration reads Docker's format, paths and socket, and rootless Podman uses different ones for all three. Each produced a distinct symptom during our debugging session.</p><h3>The log format is CRI, not Docker JSON</h3><p>Podman's default file-based log driver is <code>k8s-file</code>, and even <code>--log-driver=json-file</code> is just an alias for it.</p><p>Instead of Docker's one-JSON-object-per-line format, Podman writes the format used by Kubernetes container runtimes (CRI): a timestamp, the stream name, a partial/full flag, and then the message.</p><p>An example follows:</p>2026-08-31T09:15:04.518084921+02:00 stdout F 10.89.0.2 - - [31/Aug/2026:07:15:04 +0000] "GET / HTTP/1.1" 200 615<p>A parser expecting Docker JSON breaks on this immediately.</p><h3>Where rootless Podman stores container logs</h3><p>Rootful Docker writes logs under <code>/var/lib/docker/containers/&lt;container-id&gt;/</code>. Rootless Podman stores everything under the user's home instead:</p>/home/&lt;user&gt;/.local/share/containers/storage/overlay-containers/&lt;container-id&gt;/userdata/ctr.log<p>Any integration with a hardcoded <code>/var/lib/...</code> path finds nothing.</p><h3>The Podman API socket is per-user</h3><p>In rootless Podman there is no <code>/var/run/docker.sock</code>. Instead, it exposes a Docker-compatible API on a user-scoped socket, typically <code>/run/user/&lt;uid&gt;/podman/podman.sock</code>.</p><h2>Where Elastic Agent runs: host install vs containerized</h2><p>This walkthrough assumes Elastic Agent is installed directly on the host, not in a container. In our case, the Agent is Fleet-managed and installed directly on a Ubuntu host. It is <em>not</em> running in a container. That matters because the paths in the Agent Policy are resolved by the Agent process itself: a containerized Agent only sees its own mount namespace, so the host directories above would have to be volume-mounted into the Agent container and referenced by their in-container paths. Running as root with default privileges is also what lets the Agent read files under another user's home directory.</p><h2>How the rootless Podman log pipeline fits together</h2><p>The setup we ended up with is simple once all the pieces are known:</p><ol><li>Elastic Agent tails the raw CRI log files from the rootless user's container storage.</li><li>A <code>container</code> parser with <code>format: cri</code> strips the timestamp, stream, and flag prefix from each line.</li><li>A processor extracts the container ID from a fixed position in the log file path.</li><li>The <code>add_docker_metadata</code> processor resolves that ID against the rootless Podman socket and attaches container name, image, and labels.</li><li>Enriched events are shipped to Elasticsearch.</li></ol><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt417ffefa1a64204c/6aa4376bf548681006812d7e/architecture.png" alt="Diagram showing Elastic Agent on the host reading CRI log files from the rootless user's container storage, enriching events with metadata from the Podman user socket, and shipping them to Elasticsearch" /><p>Let's now build the log ingestion pipeline step by step.</p><h2>Step 1: Confirm the Podman log driver</h2><p>First, check which log driver Podman uses on your host, because the default varies by distribution and <code>containers.conf</code>:</p>podman info --format '{{ .Host.LogDriver }}'<p>If it prints <code>journald</code>, either switch to the file-based driver or jump to the journald alternative at the end of this post. To make <code>k8s-file</code> the default for all containers of this user, set it in <code>~/.config/containers/containers.conf</code>:</p>[containers]
log_driver = "k8s-file"<p>You can also set it per container with <code>podman run --log-driver=k8s-file</code>. Remember that <code>json-file</code> is accepted but silently behaves as <code>k8s-file</code>: do not expect Docker-formatted JSON from it. Containers pick up the driver at creation time, so you will need to recreate any containers that were started with a different driver.</p><h2>Step 2: Enable the rootless Podman API socket</h2><p>The metadata enrichment in step 4 needs the Podman API. Enable the user-scoped socket as the user that runs the containers:</p>systemctl --user enable --now podman.socket  # without sudo!
loginctl enable-linger $USER<p>The <code>enable-linger</code> call keeps the user's systemd instance, and with it the socket, alive when the user is not logged in. Verify the socket answers Docker-compatible API calls:</p>curl --unix-socket /run/user/$(id -u)/podman/podman.sock \
  http://d/v1.41/containers/json<p>You should get a JSON array describing the running containers. This compatibility layer is exactly why a processor named <code>add_docker_metadata</code> will work against Podman later.</p><h2>Step 3: Collect rootless Podman logs with a Custom Logs integration</h2><p>In Fleet, add the <strong>Custom Logs (Filestream)</strong> integration to your agent policy instead of the Docker integration.</p><p>Set the file path pattern to the rootless storage location:</p>/home/&lt;user&gt;/.local/share/containers/storage/overlay-containers/*/userdata/ctr.log<p>Then, in the advanced options, configure the parser so the agent understands the CRI format:</p>- container:
    format: cri<p>The <code>container</code> parser removes the <code>&lt;timestamp&gt; &lt;stream&gt; &lt;flag&gt;</code> prefix, reassembles partial lines (the <code>P</code> flag marks a message that was split), and stores the original timestamp and stream in the event.</p><p>For standalone agents, the equivalent input configuration looks like this:</p>- type: filestream
  id: rootless-podman-logs
  data_stream:
    dataset: podman.container_logs
  paths:
    - /home/&lt;user&gt;/.local/share/containers/storage/overlay-containers/*/userdata/ctr.log
  parsers:
    - container:
        format: cri<p>At this point you should see clean log messages in Discover, but without any container context: no name, no image, no labels. A raw container ID buried in <code>log.file.path</code> is all you have, which makes the data hard to filter and nearly impossible to correlate.</p><h2>Step 4: Enrich with container metadata using add_docker_metadata</h2><p>The <code>add_docker_metadata</code> processor enriches our logs with information such as the container name. It extracts a container ID from the log file path, queries the Docker-compatible API for that container, and attaches the container's metadata to each event.</p><p>Add it to the integration's processors field (or under <code>processors:</code> in a standalone input):</p>- add_docker_metadata:
    # Replace `1000` with the UID of the user running the containers (`id -u &lt;user&gt;`).
    host: "unix:///run/user/1000/podman/podman.sock"
    match_source: true
    match_source_index: 7<p>The <code>match_source_index</code> value deserves an explanation, as it is not a commonly used one. The processor splits the log file path on <code>/,</code> discards the empty leading element, and picks the component at the given index as the container ID.</p><p>For the rootless Podman path, the indices work out like this:</p><p>Index</p><p>Component</p><p>0</p><p><code>home</code></p><p>1</p><p><code>&lt;user-id&gt;</code></p><p>2</p><p><code>.local</code></p><p>3</p><p><code>share</code></p><p>4</p><p><code>containers</code></p><p>5</p><p><code>storage</code></p><p>6</p><p><code>overlay-containers</code></p><p>7</p><p><code>&lt;container-id&gt;</code></p><p>8</p><p><code>userdata</code></p><p></p><p>The default value of <code>4</code> exists because Docker's path is <code>/var/lib/docker/containers/&lt;container-id&gt;/...</code>, where index 4 lands on the ID. However, as you can see from the table above, in our case the proper value is <code>7</code>.</p><p>Note that the correct index depends on the depth of the home directory. <code>/home/&lt;user-id&gt;/...</code> puts the ID at index 7, but a nonstandard home location shifts it. Count the components of your actual path to verify whether <code>7</code> is the right value for you.</p><p>Once the ID resolves correctly, the processor calls the Podman socket and each event gains the familiar <code>container.*</code> fields. Here is a real document from a Jellyfin container managed with podman-compose:</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt1eeffc8b04e32828/6aa43d0048a68a62da1d8e1d/discover-enriched.png" alt="Kibana Discover document flyout showing a rootless Podman log event enriched with container.id, container.image.name and container labels, including podman-compose and OCI image labels" /><p>The metadata is more complete than it first appears: alongside <code>container.id</code> and <code>container.image.name</code>, every label on the container arrives too, including the <code>com_docker_compose_*</code> and <code>io_podman_compose_*</code> labels set by <code>podman-compose</code> and the standard <code>org_opencontainers_image_*</code> labels baked into the image. Filtering all logs of a compose project is now one query on <code>container.labels.com_docker_compose_project</code>.</p><h2>Step 5: Validate the rootless Podman log pipeline</h2><p>Generate some traffic and check Discover:</p>podman run -d --name nginx-demo -p 8080:80 nginx
curl localhost:8080<p>A healthy pipeline produces events where:</p><ul><li><code>message</code> contains only the application log line, with no CRI prefix.</li><li><code>@timestamp</code> matches the timestamp Podman wrote.</li><li><code>log.file.path</code> points into <code>overlay-containers</code>.</li><li><code>container.id</code> is the full 64-character ID, and <code>container.name</code> and <code>container.image.name</code> are populated.</li></ul><p>If metadata is missing but messages parse fine, test the socket with the <code>curl</code> command from step 2 and re-check <code>match_source_index</code>. If messages still carry a timestamp prefix, the CRI parser is not applied; verify the parser YAML made it into the integration policy.</p><h2>Alternatives for collecting rootless Podman logs</h2><p>The file-based approach above yields the same ECS <code>container.*</code> fields as the Docker integration, but three alternatives are worth weighing first.</p><p></p><p>Approach</p><p>Metadata</p><p>ECS <code>container.*</code></p><p>Throughput</p><p>Best when</p><p>Custom Logs + <code>add_docker_metadata</code></p><p>Name, image, and all labels from the Podman socket</p><p>Native</p><p>High, plain file tailing</p><p>You want the same fields the Docker integration produces</p><p><code>journald</code> log driver</p><p>Container ID, name, and image as journal fields</p><p>Needs a rename step</p><p>Lower, rate limited by <code>RateLimitBurst</code></p><p>Containers run as systemd services via Quadlet</p><p>Docker integration on the compat socket</p><p>None for logs</p><p>Metrics datasets only</p><p>Not applicable to logs</p><p>You only need metrics, validated per dataset</p><p>OpenTelemetry Collector (<code>filelog</code>)</p><p><code>container.id</code> via a regex operator, names and images need custom work</p><p>Partial</p><p>High, plain file tailing</p><p>You are standardizing on EDOT</p><h3>
Collect Podman logs with the journald log driver</h3><p>Podman integrates with systemd natively, and on many distributions <code>journald</code> is already the default log driver. With <code>--log-driver=journald</code>, Podman writes each log line to the journal and attaches <code>CONTAINER_ID_FULL</code>, <code>CONTAINER_NAME</code>, and the image name as structured journal fields.</p><p>You can collect these with the <a href="https://www.elastic.co/docs/current/integrations/journald"><strong>Custom Journald logs</strong></a> integration. The metadata comes for free, with no socket, no path counting, and no <code>match_source_index</code>.</p><p>However, journald applies rate limiting that can drop bursts from chatty containers unless you raise <code>RateLimitBurst</code>. Throughput is lower than plain file tailing. The container fields also arrive with journald's naming, so you need a rename step (an ingest pipeline or processors) to get ECS-style <code>container.*</code> fields. Rootless containers also write to the per-user journal rather than the system one. An agent running as root still sees those entries, because reading the default journal as root includes user journals, but enable journald persistence (<code>Storage=persistent</code> in <code>journald.conf</code>) if you want container logs to survive a reboot.</p><p>If your containers are managed as systemd services via Quadlet, this is a natural fit.</p><h3>Point the Docker integration at the Podman compat socket (metrics only)</h3><p>Since Podman exposes a Docker-compatible API, it is tempting to point the Docker integration's <code>host</code> at <code>unix:///run/user/&lt;uid&gt;/podman/podman.sock</code>.</p><ul><li>Metrics datasets can work, because they only talk to the API.</li><li>Logs do not, because the integration reads Docker's JSON log files from Docker's paths, and rootless Podman uses neither. Treat this as a partial option for metrics, and validate each dataset you enable.</li></ul><h3>Collect Podman logs with the OpenTelemetry Collector</h3><p>If you are standardizing on OpenTelemetry, for instance by using EDOT (Elastic Distributions of OpenTelemetry) the Collector's <code>filelog</code> receiver reads the same files with its <code>container</code> operator, which auto-detects CRI-style formats:</p>receivers:
  filelog:
    include:
      - /home/&lt;user&gt;/.local/share/containers/storage/overlay-containers/*/userdata/ctr.log
    operators:
      - type: container
        add_metadata_from_filepath: false<p>Set <code>add_metadata_from_filepath: false</code> because that option expects Kubernetes pod log paths, which don't match Podman's layout.</p><p>Here you will miss out on some data enrichment: there is no Podman equivalent of the <code>k8sattributes</code> processor, so container names and labels are not attached automatically.. You can extract <code>container.id</code> from the file path with a regex operator, but resolving it to names and images requires custom work. The contrib Collector does include a <code>podman_stats</code> receiver for container metrics over the same socket, so a Collector-based setup covers metrics well and logs with reduced metadata.</p><h2>Parsing application logs from Podman containers</h2><p>The Custom Logs pipeline above ships raw log lines without application-level parsing. For instance, Nginx logs will end up in your cluster plainly, without proper processing. If you'd like to enable proper processing, you can use Ingest Pipelines to "redirect" specific containers (e.g. <code>nginx</code>) to the Ingest Pipeline defined by the Elastic Integration, and get full parsing of that data "for free".</p><h2>Root cause analysis on Podman logs with Agent Builder</h2><p>Was it worth the effort? Absolutely! Getting clean, metadata-rich container logs into Elasticsearch lets an LLM investigate issues against the data directly, and <a href="https://www.elastic.co/docs/solutions/observability/ai/agent-builder-observability">Elastic Agent Builder</a> is the quickest way to see that in action.</p><p>Agent Builder, available on Elastic Cloud Serverless and the Enterprise tier for Elastic Cloud Hosted and self-managed, provides a chat interface in Kibana, backed by an LLM, with built-in tools to explore your indices and run ES|QL queries against them.</p><p>Here is a real example from the host we just configured. Among other containers, it runs Jellyfin, a media server, as a rootless Podman container. One day, playback of a title fails instantly on an Android TV client: the screen goes black and drops back to the menu, with no error apart from a cryptic "Playback error".</p><p>In Discover, filtering on <code>container.name: "jellyfin"</code> narrows the view to a few hundred verbose .NET log lines around the playback attempts. The histogram shows a burst of activity at each failed attempt, but the actual cause is buried somewhere in the noise.</p><p>Instead of scanning the messages manually, open the Agent Builder panel directly from Discover and ask it to investigate the issue. The agent queries the log data stream on its own, reconstructs the timeline, and returns a diagnosis:</p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltbc2f9f7746f35d25/6aa45ce1afd9a87b6b120b81/agent-builder-jellyfin-podman.jpg" alt="AI Agent panel in Kibana Discover diagnosing a Jellyfin playback failure from rootless Podman container logs, identifying a failing FFmpeg hardware-transcoding pipeline and suggesting verification steps" /><p>In this run it worked out that the client requested playback six times. Jellyfin tried to convert a 4K Dolby Vision/HEVC video to H.264 through VA-API hardware transcoding while burning in a subtitle stream, and FFmpeg exited with code 187 each time before producing the first HLS segment. That is why playback stopped at zero milliseconds. It also stated its uncertainty honestly: the available logs don't contain FFmpeg's stderr, so it proposed concrete steps to discriminate between a broken transcoding combination and missing GPU access, including checking whether the container can reach the render device <code>/dev/dri/renderD128</code>.</p><p>The pipeline we just built made each step of this investigation possible. The agent can slice by <code>container.name</code> only because <code>add_docker_metadata</code> resolved it from the Podman socket, the <code>message</code> field is queryable because the CRI parser stripped the prefixes, and the timeline is trustworthy because <code>@timestamp</code> comes from Podman, not from ingestion time. Without that work, the LLM would face a pile of prefixed raw lines, likely resulting in worse performance and higher token usage.</p><h2>Conclusion: three settings for rootless Podman logs</h2><p>Rootless Podman is Docker-compatible where it matters the most: the API. For log collection it uses its own format, file paths, and socket location, which is what the Elastic Docker integration reads.</p><p>Once you know that, the fix is three configuration decisions: parse <code>cri</code> instead of Docker JSON, tail the user's <code>overlay-containers</code> storage, and point <code>add_docker_metadata</code> at the per-user Podman socket with a corrected <code>match_source_index</code>.</p><p>The same recipe applies to any rootless user on the host; only the home path and UID in the socket change.</p><p>If you want to try this workflow end to end to collect your Podman logs, spin up an <a href="https://cloud.elastic.co/registration">Elastic Cloud trial</a>, install the Elastic Agent on your host, and you can go from raw CRI files to fully enriched container logs in one integration policy. If you want to push this further, from a one-off chat to automated investigations that open cases with evidence attached, see <a href="https://www.elastic.co/observability-labs/blog/automated-root-cause-analysis-agent-builder">automated root cause analysis with Elastic Agent Builder</a>.</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/rootless-podman-logs-elastic-agent</link>
    <guid isPermaLink="false">rootless-podman-logs-elastic-agent</guid>
    <category><![CDATA[Logs Analytics]]></category>
    <category><![CDATA[Infrastructure Monitoring]]></category>
    <category><![CDATA[Agentic Observability]]></category>
    <dc:creator><![CDATA[Lorenzo Soligo]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt087aeec3734bc804/6aa42c849936f588158b85c8/header_(2).jpg" length="0" type="image/jpeg"/>
    <pubDate>Mon, 14 Sep 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Your AI agent needs an alibi: Observability and audit trails for Agent Builder in Elastic]]></title>
    <description><![CDATA[Elastic 9.5 traces every Agent Builder run as OpenTelemetry spans in your own cluster, so tool calls and token counts are queryable with ES|QL. One workflow step adds the approval record, in a data stream the pipeline cannot rewrite.]]></description>
    <content:encoded><![CDATA[<p>One question to an Elastic Agent Builder agent produced 24 spans, 10 model calls across two models, and roughly 160,000 input tokens. Elastic 9.5 records AI agent observability data without a collector or a scraper. Every run lands as OpenTelemetry traces in your own cluster, on by default, writing to <code>traces-agent_builder.otel-&lt;space-id&gt;</code> down to each ES|QL query the agent generated and each index it looked up.</p>
<p>Those traces show how the agent reached its recommendation and what it cost. They do not record who approved it. Below: how to read the traces, scope the three identities a run touches, and append the approval decision to a data stream the pipeline cannot rewrite.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt8b462c91ad11f060/6a95560048c299343ec688fd/02-architecture.png" alt="Agent Builder investigates, a workflow gate takes the human approval, and each stage writes to a different Elasticsearch data stream" /></p>
<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li>Elastic Stack 9.5 or Serverless  </li>
<li>Privileges to manage Kibana advanced settings, needed to install the traces dashboard.</li>
</ul>
<h2 id="whereelasticobservabilityrecordseachpartofanaiagentaction">Where Elastic Observability records each part of an AI agent action</h2>
<p>Four questions come up in every review of an agentic operations pipeline, and each one is answered by a different record.</p>
<p>| Question | Where the answer lives | Who creates it |
| :---- | :---- | :---- |
| How did the agent reach its recommendation? | <code>traces-agent_builder.otel-*</code> spans | Agent Builder, automatically |
| Which tools did it call, and did they fail? | <code>execute_tool</code> spans in the same data stream | Agent Builder, automatically |
| Whose privileges did the run execute with? | Workflow execution record and Elasticsearch security audit logs | Kibana, partly |
| What did a human decide, and did the action run? | An index you write to yourself | You |</p>
<p>The first two are new in 9.5 and cost nothing but a toggle. The last one has no automatic source, so it is the one most pipelines are missing.</p>
<h2 id="thescenarioastalepricingcacheincheckout">The scenario: a stale pricing cache in checkout</h2>
<p>Three <code>checkout-service</code> workers serve production traffic. One of them, <code>checkout-worker-1</code>, was rolled to version <code>2026.07.26.1</code> and now returns HTTP 500 on every quote because its pricing cache stopped refreshing. The other two stay on <code>2026.07.25.3</code> and serve normally.</p>
<p>The <a href="https://www.elastic.co/observability-labs/blog/sre-control-plane-agent-builder-workflows">SRE control plane</a> pattern behind this setup connects telemetry, an Agent Builder agent that reasons over it, and Elastic Workflows that run known actions, with a <a href="https://www.elastic.co/observability-labs/blog/human-approval-sre-automation-elastic-workflows">human approval gate</a> before the first step that changes production.</p>
<p>Telemetry arrives through the documented OpenTelemetry path, so the agent reads standard OTel fields. Elasticsearch 9.5 exposes a native OTLP endpoint, which lets an OTel SDK write directly to the cluster with no collector in between:</p>
<pre><code>from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter
from opentelemetry.sdk._logs import LoggerProvider
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from opentelemetry.sdk.resources import Resource

provider = LoggerProvider(
    resource=Resource.create({
        "service.name": "checkout-service",
        "deployment.environment": "production",
    })
)
provider.add_log_record_processor(
    BatchLogRecordProcessor(
        OTLPLogExporter(
            endpoint=f"{ES_URL}/_otlp/v1/logs",
            headers={"Authorization": f"ApiKey {API_KEY}"},
        )
    )
)
</code></pre>
<p>The endpoint speaks OTLP over protobuf and rejects <code>application/json</code> with HTTP 406, so send it through an SDK or collector rather than hand-built JSON. That writes 450 records to <code>logs-generic.otel-default</code>: 360 healthy events across the three workers and 90 <code>PricingCacheStaleError</code> events from the broken one. The agent is given none of that context and has to find it by querying.</p>
<h2 id="readingaiagentobservabilitytracesinelastic">Reading AI agent observability traces in Elastic</h2>
<p>Everything Agent Builder records about a run lives in two data streams, and all of it is queryable with ES|QL.</p>
<h3 id="howtoturnonaiagenttracingingenaisettings">How to turn on AI agent tracing in GenAI Settings</h3>
<p>Open <strong>Stack Management</strong>, then <strong>GenAI Settings</strong>, and find the <strong>Agent Builder Traces</strong> section. <strong>Collect conversation traces</strong> is on by default in 9.5.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt907aa26526dec518/6a9555e8893681fd923dd487/03-genai-settings.png" alt="Agent Builder Traces section in GenAI Settings with Collect conversa" /></p>
<p>Two details on that panel matter more than the toggle. Traces are written to <code>traces-agent_builder.otel-&lt;space-id&gt;</code>, one data stream per Kibana space, with a companion <code>logs-agent_builder.otel-&lt;space-id&gt;</code> for agent-side events. These are ordinary data streams on the standard OTel index templates, not hidden system indices, so Discover, Lens, and ES|QL query them directly.</p>
<p>The callout states the access model plainly: anyone who can read the index can read every trace in it. Trace access is not scoped per user, so restrict the index pattern through a role before granting access to a space with sensitive conversations.</p>
<h3 id="readingthellmtracewaterfallforoneagentrun">Reading the LLM trace waterfall for one agent run</h3>
<p>A single question through the <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/kibana-api">converse API</a> asks the built-in Elastic AI Agent to investigate <code>logs-generic.otel-default</code>, find which pod and version are returning HTTP 500, and propose one bounded action. It answers correctly, naming <code>checkout-worker-1</code> on <code>2026.07.26.1</code> with a 43% error rate against zero errors on the two workers still on <code>2026.07.25.3</code>.</p>
<p>Select the trace icon under any agent response to open the waterfall.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt0a0275868ed6d61a/6a95566e9b940a2b62cb3c62/04-trace-waterfall.png" alt="Trace waterfall for one agent run showing 24 spans across invoke_agent, chat, and execute_tool" /></p>
<p>One question through the converse API produced 24 spans over 43.7 seconds. The structure is an <code>invoke_agent</code> root, a <code>generate_title</code> side branch, then alternating <code>chat</code> and <code>execute_tool</code> spans as the agent queries, reads the result, and picks the next query.</p>
<p>Three span families carry everything you will aggregate on.</p>
<p>| Span name prefix | What it represents | Key attributes |
| :---- | :---- | :---- |
| <code>invoke_agent</code> | A conversation round (<code>CHAIN</code>) or an agent execution (<code>AGENT</code>) | <code>elastic.inference.span.kind</code>, <code>gen_ai.agent.id</code> |
| <code>chat</code> | One model call | <code>gen_ai.request.model</code>, <code>gen_ai.provider.name</code>, <code>gen_ai.usage.input_tokens</code>, <code>gen_ai.usage.output_tokens</code> |
| <code>execute_tool</code> | One tool invocation | <code>gen_ai.tool.name</code>, <code>gen_ai.tool.call.id</code>, <code>status.code</code> |</p>
<p>The token breakdown for that run:</p>
<p>| Model | Calls | Input tokens | Output tokens |
| :---- | ----: | ----: | ----: |
| <code>anthropic-claude-4.6-sonnet</code> | 5 | 113,315 | 2,039 |
| <code>anthropic-claude-4.5-haiku</code> | 5 | 47,211 | 651 |</p>
<p>Half the model calls went to the smaller model. That is <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/models">fast model routing</a>, which sends low-effort steps to a cheaper model, and the split is only visible in the trace.</p>
<p>The single agent investigation consumed roughly 160,000 input tokens in total. Each round replays the accumulated context, so cost scales with conversation length rather than with the length of the question.</p>
<h3 id="howdoyouqueryagenttoolcallswithesql">How do you query agent tool calls with ES|QL?</h3>
<p>Tool invocations are the part of agent behavior most worth watching, because that is where the agent touches your data. Every call is one <code>execute_tool</code> span, and the documented query aggregates them directly:</p>
<pre><code>FROM traces-agent_builder.otel-*
| WHERE span.name LIKE "execute_tool *"
| STATS calls = COUNT(*),
        errors = COUNT(*) WHERE status.code == "Error",
        avg_ms = ROUND(AVG(duration) / 1000000.0, 1)
  BY tool = attributes.gen_ai.tool.name
| SORT calls DESC
</code></pre>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blte3954942227269d2/6a955510d04dac38a16c9c15/05-tool-calls-esql.png" alt="ES|QL aggregation of execute_tool spans grouped by tool name" /></p>
<p>Across that run the agent leaned on <code>platform.core.execute_esql</code>, with <code>platform.core.generate_esql</code> and <code>load_skill</code> behind it at two calls each. <code>duration</code> is in nanoseconds on the root of the document, which is why the query divides by a million for milliseconds.</p>
<p>Check the companion logs data stream as well. During a different run in the same session, the agent tried to call a tool that was not in its available set, and the attempt was recorded as an exception event in <code>logs-agent_builder.otel-default</code>, correlated to the trace by <code>trace_id</code>:</p>
<pre><code>{
  "trace_id": "3f8b9722dbd371ac4b7ad75e4bed13b6",
  "event_name": "exception",
  "attributes": {
    "exception.type": "toolNotFoundError",
    "exception.message": "Tool \"platform.streams.query_documents\" called but was not available"
  }
}
</code></pre>
<p>A blocked tool attempt is audit-relevant, and it does not appear in the trace waterfall. Querying only the traces data stream will miss it.</p>
<p>For aggregate views there is a managed dashboard, installed per space from the same settings panel.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt84e139b24e474a43/6a9556211ade64a39142b72a/06-traces-dashboard.png" alt="Agent Builder traces overview dashboard showing token usage, conversation latency, and tool call frequency" /></p>
<p>Over a fifteen-minute window covering these runs, it reported 903,914 input tokens, 11,734 output tokens, and 44 LLM requests, with 35 tool spans at a 100% success rate and 0.42 seconds average duration. The dashboard is managed and read-only, so duplicate it to change a panel, and Elastic can still ship improvements to the original.</p>
<h3 id="whatopentelemetryllmtracesdonotcapturebydefault">What OpenTelemetry LLM traces do not capture by default</h3>
<p>By default, a trace records structure and cost, not content. Six toggles under <strong>Advanced privacy settings</strong> control prompts, responses, tool call details, system prompts, real tool and agent names, and real conversation and workflow IDs, and all six are off.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt6c873c449fc27e07/6a9554a860f7958318d76b3c/07-privacy-settings.png" alt="Advanced privacy settings with six toggles, all off by default" /></p>
<p>By default, a trace records structure and cost, not content. Select any span in the waterfall and the detail panel says so directly: "No input/output data available for this span."</p>
<p>Identifiers are hashed rather than dropped. The run with the blocked tool call returned conversation <code>be30fb53-d351-4fa1-b5e1-a569816f85d9</code> from the API, but its spans carry <code>gen_ai.conversation.id: b1141340d0851a46</code>. That lets you group every span belonging to one conversation and compare conversations against each other, without exposing an identifier that ties back to a user's session.</p>
<p>The consequence is that you cannot join traces to conversations on the conversation ID unless you enable real IDs, and you rarely need to. The converse API hands you the correlation key directly:</p>
<pre><code>{
  "conversation_id": "be30fb53-d351-4fa1-b5e1-a569816f85d9",
  "trace_id": "3f8b9722dbd371ac4b7ad75e4bed13b6",
  "model_usage": {
    "llm_calls": 22,
    "input_tokens": 518251,
    "output_tokens": 6423,
    "model": "anthropic-claude-4.6-sonnet"
  }
}
</code></pre>
<p>Store that <code>trace_id</code> in your own decision record, and the join works without weakening the privacy defaults. Enable real IDs only when exact response-to-decision attribution is required, and restrict the trace index in the same change.</p>
<h2 id="auditingaiagentactionsbeyondthetrace">Auditing AI agent actions beyond the trace</h2>
<p>The traces stop at what the agent did, so the records that show who authorised it have to come from somewhere else.</p>
<h3 id="whoseprivilegesdoesanaiagentactionrunwith">Whose privileges does an AI agent action run with?</h3>
<p>Three identities are involved in an agentic pipeline, and each has its own boundary.</p>
<p>| Identity | Runs with | Determined by | How to scope |
| :---- | :---- | :---- | :---- |
| Agent Builder tools | The privileges of whoever is chatting | The current user, so two people can get different data from the same question | Roles, as described in <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/permissions">Agent Builder permissions</a> |
| Workflow steps | One stored API key shared by every <code>elasticsearch.*</code> and <code>kibana.*</code> step | The trigger: manual runs use the person who started them, scheduled runs use whoever last saved the workflow | <a href="https://www.elastic.co/docs/explore-analyze/workflows/authorization">Workflow authorization</a> |
| Trace readers | Index-level access, all or nothing | A role grant on <code>traces-agent_builder.otel-*</code> | A role boundary on the trace index pattern |</p>
<p>One consequence of the stored key belongs in any review. Deactivating a user or changing their role does not refresh it, and the workflow keeps running with the privileges it captured until someone saves it again or toggles <strong>Enabled</strong> off and back on. Revoking an engineer's access does not, by itself, stop workflows that still run as them.</p>
<p>Scope the investigation role to reads only:</p>
<pre><code>POST /_security/role/agent-builder-observability-investigator
{
  "cluster": ["monitor_inference"],
  "indices": [
    {
      "names": ["logs-*", "metrics-*", "traces-*"],
      "privileges": ["read", "view_index_metadata"]
    }
  ]
}
</code></pre>
<p>Reading the agent's own traces is a separate grant, needing <code>read</code> and <code>view_index_metadata</code> on <code>traces-agent_builder.otel-*</code>. Keep the two roles apart, because the people who investigate incidents and the people who audit the agent are not always the same people.</p>
<h3 id="recordingwhoapprovedanagentactioninelasticsearch">Recording who approved an agent action in Elasticsearch</h3>
<p>Run the workflow, and it stops at the approval gate, where the reviewer sees the agent's structured output rendered into the request rather than a bare confirmation prompt.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt38b441b0cded6d2c/6a9554bc0897901dfdefb3ee/08-approval-gate.png" alt="Workflow approval gate showing the agent structured output and the decision input form" /></p>
<p>The execution record is detailed. It captures <code>resumedAt</code>, <code>resumedBy</code>, the full <code>resumeInput</code> payload, per-step token usage, and a deep link back to itself.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc05efc447ca49698/6a9554d2e657a3f7b475b008/09-execution-record.png" alt="Workflow execution record showing resumedBy, resumeInput, and per-step token usage" /></p>
<p>That execution history is an operational view, not an audit store. The underlying <code>.workflows-events</code> data stream is reserved for system operations and rejects user queries outright, so you cannot run ES|QL across a quarter of decisions, and execution history is subject to retention rather than to your compliance policy.</p>
<p>Write the decision to an index you control:</p>
<pre><code>- name: review
  type: waitForInput
  with:
    message: |
      ## Approve the proposed checkout remediation?

      The evidence query matched {{ steps.collect_evidence.output.hits.total.value }} error events in the last hour.

      Agent classification: {{ steps.investigate.output.structured_output.incident_class }}
      Affected pod: {{ steps.investigate.output.structured_output.affected_pod }}
      Proposed action: {{ steps.investigate.output.structured_output.recommended_action }}
    schema:
      type: object
      properties:
        decision:
          type: string
          enum: ["approve", "decline"]
        reason:
          type: string
          enum: ["supported-by-evidence", "insufficient-evidence", "wrong-target", "unsafe-action"]
        notes:
          type: string
      required: ["decision", "reason"]

- name: record_decision
  type: elasticsearch.index
  with:
    index: "agent-action-audit"
    document:
      "@timestamp": "{{ now | date: '%Y-%m-%dT%H:%M:%S.%LZ' }}"
      "event.action": "agent_recommendation_reviewed"
      "incident.id": "{{ consts.incident_id }}"
      "agent.conversation_id": "{{ steps.investigate.output.conversation_id }}"
      "agent.incident_class": "{{ steps.investigate.output.structured_output.incident_class }}"
      "agent.affected_pod": "{{ steps.investigate.output.structured_output.affected_pod }}"
      "agent.recommended_action": "{{ steps.investigate.output.structured_output.recommended_action }}"
      "agent.evidence_count": "{{ steps.collect_evidence.output.hits.total.value }}"
      "review.decision": "{{ steps.review.output.response.decision }}"
      "review.reason": "{{ steps.review.output.response.reason }}"
      "review.notes": "{{ steps.review.output.response.notes }}"
      "review.responded_by": "{{ steps.review.output.respondedBy }}"
      "workflow.execution_id": "{{ execution.id }}"
      "workflow.executed_by": "{{ execution.executedBy }}"
      "workflow.execution_url": "{{ execution.url }}"
</code></pre>
<p>Two details in the workflow snippet above differ from the reference page.</p>
<p>The reviewer payload is nested one level deeper. The docs describe <code>steps.&lt;name&gt;.output.&lt;field&gt;</code>, but the running build returns the submitted values under <code>response</code>, alongside a <code>respondedBy</code> field:</p>
<pre><code>{
  "response": { "decision": "approve", "reason": "supported-by-evidence" },
  "respondedBy": "1506416774"
}
</code></pre>
<p><code>execution.executedBy</code> records who started the run, and <code>respondedBy</code> records who approved the action, which in a human-in-the-loop pipeline are usually different people.</p>
<p>The second detail is the timestamp. <code>{{ now }}</code> renders a JavaScript date string like <code>Sun Jul 26 2026 07:37:11 GMT+0000 (Coordinated Universal Time)</code>, which Elasticsearch rejects with <code>failed to parse date field</code>, and <code>execution.startedAt</code> has the same problem. The Liquid <code>date</code> filter fixes it.</p>
<p>The workflow editor also flags <code>steps.review.output.*</code> as an invalid variable before the first run, because the reviewer payload shape is only known once someone responds. The warning clears after the step has real output, and the templates resolve correctly at runtime.</p>
<h3 id="makingtheauditdatastreamappendonly">Making the audit data stream append-only</h3>
<p>An audit trail the agent's own pipeline can rewrite is not an audit trail. Elasticsearch provides two independent controls, and they compose.</p>
<p>First, write to a data stream rather than an index, because data streams accept appends and nothing else:</p>
<pre><code>PUT _index_template/agent-action-audit
{
  "index_patterns": ["agent-action-audit"],
  "data_stream": {},
  "priority": 500,
  "template": {
    "mappings": {
      "properties": {
        "@timestamp":            { "type": "date" },
        "event.action":          { "type": "keyword" },
        "incident.id":           { "type": "keyword" },
        "agent.conversation_id": { "type": "keyword" },
        "agent.evidence_count":  { "type": "long" },
        "agent.recommended_action": { "type": "keyword" },
        "review.decision":       { "type": "keyword" },
        "review.reason":         { "type": "keyword" },
        "review.responded_by":   { "type": "keyword" },
        "workflow.execution_id": { "type": "keyword" }
      }
    }
  }
}
</code></pre>
<p>Second, give the writer <code>create_doc</code> and nothing else, so it can add records but cannot reach for the by-query escape hatches:</p>
<pre><code>PUT _security/role/agent-action-audit-writer
{
  "indices": [
    { "names": ["agent-action-audit"], "privileges": ["create_doc", "auto_configure"] }
  ]
}
</code></pre>
<p>Tested against the running cluster, that pair behaves the way an audit store should:</p>
<p>| Attempt as the audit writer | Result |
| :---- | :---- |
| Append a decision record | <code>201 Created</code> |
| Overwrite a record by ID | <code>400</code>, only <code>op_type: create</code> is allowed in data streams |
| <code>_update_by_query</code> to change a decision | <code>403</code>, action unauthorized |
| <code>_delete_by_query</code> to erase history | <code>403</code>, action unauthorized |
| <code>_search</code> to read the trail back | <code>403</code>, action unauthorized |</p>
<p>The write-only behaviour in the last row is deliberate. The workflow that writes decisions has no reason to read them, so auditors get a separate read role and the writer stays write-only.</p>
<p>The two controls fail differently, which matters. The <code>400</code> comes from the data stream itself and applies to everyone, including a superuser. The <code>403</code> rows come from the role, and a superuser could still run them, which is why tamper-resistant retention means shipping records off the cluster the agent's operators administer.</p>
<p>For cluster-level activity, <a href="https://www.elastic.co/docs/deploy-manage/security/logging-configuration/enabling-audit-logs">enable Elasticsearch and Kibana security audit logging</a> and forward the logs to a monitoring deployment. On 9.5 <code>xpack.security.audit.enabled</code> became a dynamic cluster setting, so Elasticsearch no longer needs a restart to turn it on, though on orchestrated deployments the logs still have to be shipped somewhere readable.</p>
<h3 id="querythedecisiontrailwithesql">Query the decision trail with ES|QL</h3>
<p>Two runs of the workflow, one approved and one declined, produce two rows you can query alongside everything else in Elastic.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd2e55b4cd891ee8e/6a9554e18814aa7f0289c29f/10-decision-trail-esql.png" alt="ES|QL query over the agent-action-audit data stream returning two decision records" /></p>
<pre><code>FROM agent-action-audit
| KEEP @timestamp, agent.incident_class, agent.affected_pod, agent.recommended_action,
       agent.evidence_count, review.decision, review.reason, review.responded_by,
       workflow.execution_id
| SORT @timestamp DESC
</code></pre>
<p>Both runs saw the same 90 error events and proposed <code>restart-checkout-worker</code> on <code>checkout-worker-1</code>. The first review approved it as <code>supported-by-evidence</code>, and the second declined it as <code>wrong-target</code>, on the argument that restarting the pod hides a pricing-feed problem rather than fixing it.</p>
<p>Because both decisions are structured fields, disagreement between reviews is queryable. You can count rejections per incident class and group them by reason: <code>insufficient-evidence</code> sends you back to the investigation path, and <code>unsafe-action</code> sends you to the workflow and its permission boundary.</p>
<h2 id="aiagentobservabilitylimitstodesignaround">AI agent observability limits to design around</h2>
<p>Four behaviors are worth designing around, and each is cheaper to handle before the workflows are written.</p>
<ol>
<li><strong>Trace access is index-level, not per user.</strong> A space with sensitive conversations needs a role boundary on <code>traces-agent_builder.otel-*</code> rather than a UI setting.</li>
<li><strong>The managed dashboard is not installed automatically in a new space.</strong> Add it to your space provisioning checklist.</li>
<li><strong>The workflow execution carries its own APM <code>traceId</code>.</strong> It is not the same trace as the Agent Builder spans its <code>ai.agent</code> step produced, so correlate through the conversation ID or the <code>trace_id</code> returned by the agent rather than expecting one trace to span both.</li>
<li><strong>The <code>waitForInput</code> output shape differs from the reference page.</strong> The submitted values arrive under <code>response</code>, alongside <code>respondedBy</code>, as covered above.</li>
</ol>
<p>None of these blocks the pattern.</p>
<h2 id="wheretostartwithaiagentobservability">Where to start with AI agent observability</h2>
<p>Turn trace collection on, install the dashboard in the space your agents run in, and open the waterfall for one real conversation. It shows the tool sequence, the model split, and the latency distribution that the answer text does not.</p>
<p>Then pick the single incident class where you already trust the runbook, and add one <code>elasticsearch.index</code> step after its approval gate. An append-only decision record costs one workflow step and answers the three questions a review needs: who approved this, on what evidence, and what happened next.</p>
<p>For the details, see <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/collect-traces">Collect Agent Builder traces</a>, the <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-traces-dashboard">traces overview dashboard</a>, <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/permissions">Agent Builder permissions</a>, <a href="https://www.elastic.co/docs/explore-analyze/workflows/authorization">workflow authorization</a>, and the <a href="https://www.elastic.co/docs/explore-analyze/workflows/steps/wait-for-input"><code>waitForInput</code> reference</a>.</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/ai-agent-observability-audit-trail</link>
    <guid isPermaLink="false">ai-agent-observability-audit-trail</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[LLM Observability]]></category>
    <category><![CDATA[OpenTelemetry]]></category>
    <dc:creator><![CDATA[Jeffrey Rengifo]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt2c757a76a8a7504d/6a9553fe0897906e2aefb3e4/01-header.png" length="0" type="image/png"/>
    <pubDate>Mon, 31 Aug 2026 15:13:52 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[From recommendation to remediation in 4 stages: human-in-the-loop automation with Elastic Workflows]]></title>
    <description><![CDATA[An approval gate that pauses incident response automation before the action and gives the reviewer enough evidence to decide in seconds. Whatever happens next, approved or declined, lands in one auditable record.]]></description>
    <content:encoded><![CDATA[<p>An approve button with no evidence behind it is not a control. <a href="https://www.elastic.co/docs/explore-analyze/workflows/authoring-techniques/human-in-the-loop">Human-in-the-loop</a> automation binds five things into one inspectable record: the evidence you observed, the action you propose, the person who decided, the deadline they had, and what actually executed.</p>
<p>In this article, you'll build that gate with <a href="https://www.elastic.co/docs/explore-analyze/workflows">Elastic Workflows</a>, reusing the control plane from the companion article <a href="https://www.elastic.co/observability-labs/blog/automated-root-cause-analysis-agent-builder">Build an SRE Control Plane with Agent Builder and Workflows</a>. This time the incident is narrow enough to act on: a stale pricing cache on a single worker, with a structured approval step sitting between the recommendation and the remediation. Nothing here touches production, so you can run the approved branch and the declined branch and compare what each one leaves in the execution record. That record is how incident response automation earns autonomy one incident class at a time.</p>
<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li>Elastic Stack 9.4+</li>
</ul>
<h2 id="whatansrecontrolplaneneedsbeforeyouaddapproval">What an SRE control plane needs before you add approval</h2>
<p>This article builds on <a href="https://www.elastic.co/observability-labs/blog/automated-root-cause-analysis-agent-builder">Build an SRE Control Plane with Agent Builder and Workflows</a>, which defines the control-plane pattern used here: telemetry, investigation context, policy, and a set of known actions, wired together. <a href="https://www.elastic.co/docs/solutions/search/elastic-agent-builder">Agent Builder</a> reasons over logs, traces, metrics, alerts, runbooks, and previous cases. <a href="https://www.elastic.co/docs/explore-analyze/workflows">Elastic Workflows</a> executes a defined sequence with explicit inputs and permissions. <a href="https://www.elastic.co/docs/explore-analyze/workflows/authoring-techniques/human-in-the-loop">Human-in-the-loop</a>, or HITL, connects those two responsibilities at exactly the point where evidence becomes action.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt6b61f78deb82055c/6a902c51346647461ca2ba65/diagram1.png" alt="Agent Builder reasoning over logs, traces, and metrics alongside a single Elastic Workflow execution that collects evidence, runs the analysis, opens a case, pauses at waitForInput for a reviewer, and branches into an approved or a declined path" /></p>
<p>A recommendation and a remediation have very different failure modes. A weak recommendation wastes an engineer's time. A weak remediation changes production. This is why the approval gate belongs inside the execution model.</p>
<h2 id="thefivebindingsthatmakeanapprovalgateareliabilitycontrol">The five bindings that make an approval gate a reliability control</h2>
<p>A useful gate preserves five properties. Remove any one of them and the gate gets weaker.</p>
<ul>
<li><strong>Evidence binding</strong>: The reviewer sees the logs, alert details, enrichment, or agent rationale that produced the proposal. An "Approve" button without evidence only asks a person to accept the automation's confidence.  </li>
<li><strong>Action binding</strong>: The request names the exact bounded action, target, parameters, and expected effect. A request without an explicit target can authorize far more than the reviewer intended.  </li>
<li><strong>Identity binding</strong>: The record shows who approved or declined the request, and when. Without it, you have an outcome but no accountability.  </li>
<li><strong>Time binding</strong>: The decision has a deadline, and stale requests fail closed instead of running later without context. An approval without a timeout can outlive the incident evidence that justified it.  </li>
<li><strong>Outcome binding</strong>: The execution record shows what ran, what was skipped, and whether post-action verification passed.</li>
</ul>
<p>The form still matters, but the form is only the human-facing part of a much larger control. Approval design is reliability engineering.</p>
<h2 id="thefourstagesfromairecommendationtoautoremediation">The four stages from AI recommendation to auto remediation</h2>
<p>Treat autonomy as a sequence of operational states rather than a product toggle.</p>
<p>| Autonomy stage | System behavior | Human responsibility | Promotion evidence |
| :---- | :---- | :---- | :---- |
| 0. Observe | Search logs and assemble context. | Investigate and act manually. | Queries find the right incident evidence. |
| 1. Recommend | Propose one bounded next step with rationale. | Decide and execute outside the workflow. | Recommendations are accurate enough to review quickly. |
| 2. Approve | Pause before action and resume only with structured input. | Approve or decline the exact proposal. | Approval quality, execution success, and rollback behavior are measured. |
| 3. Automate narrowly | Run the same action automatically for a proven incident class. | Review exceptions and audit samples. | Scope, permissions, timeout, verification, and rollback remain enforced. |</p>
<p>The important transition is from stage 1 to stage 2. That is where the system stops being an advisor and gains an execution path. That path should be deterministic even when an AI agent contributed to the investigation: the agent summarizes evidence and recommends an action, while the workflow owns the pause, the structured decision, the branch, and the execution record.</p>
<h2 id="buildthehumanintheloopautomationgateinelasticworkflows">Build the human-in-the-loop automation gate in Elastic Workflows</h2>
<p>Elastic Workflows gives you the <a href="https://www.elastic.co/docs/explore-analyze/workflows/authoring-techniques/human-in-the-loop"><code>waitForInput</code> step</a> for this. When execution reaches that step, the workflow stops in the <code>WAITING_FOR_INPUT</code> state and waits for a person. The reviewer answers a small form in the <a href="https://www.elastic.co/docs/explore-analyze/workflows/authoring-techniques/monitor-workflows">Kibana execution view</a> (or through the resume API), and whatever they submit becomes available to later steps at <code>steps.&lt;step_name&gt;.output</code>.</p>
<p>The workflow pulls the last 30 minutes of <code>checkout-api</code> failure logs, hands them to Agent Builder for a root-cause analysis, and writes that analysis into an Observability case. Then it stops and asks one question: should we clear the pricing cache on <code>checkout-worker-07</code>? If you approve, it records the simulated action, runs a verification query, and appends the result to the case. If you decline, it records the decision and runs nothing. Either way, production is untouched.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt522bdd7a74336a11/6a902cd3971ef9b438537e9c/diagram2.png" alt="Flow from trigger to evidence collection to a proposed bounded action, pausing in WAITING_FOR_INPUT before splitting into a declined path that records the decision and an approved path that executes, verifies, and records the outcome in the case" /></p>
<pre><code>name: obs-labs-checkout-control-plane-hitl
description: Human approval gate for the OpenTelemetry-grounded checkout control plane.
enabled: false
tags:
  - sre-control-plane
  - agent-builder
  - human-in-the-loop
  - workflows
  - opentelemetry

settings:
  timeout: "30m"

triggers:
  - type: manual

consts:
  incident_id: "obs-labs-checkout-hitl-20260719"

steps:
  - name: collect_evidence
    type: elasticsearch.search
    with:
      index: "logs-*"
      size: 10
      query:
        bool:
          filter:
            - range:
                "@timestamp":
                  gte: "now-30m"
            - term:
                "service.name": "checkout-api"
            - term:
                "attributes.incident.id": "{{ consts.incident_id }}"
            - match_phrase:
                "body.text":
                  query: "checkout failed: stale pricing cache"

  - name: rca_analysis
    type: ai.agent
    agent-id: elastic-ai-agent
    create-conversation: true
    with:
      message: |
        Investigate the checkout-api incident identified by {{ consts.incident_id }}.
        The workflow evidence query found {{ steps.collect_evidence.output.hits.total.value }} matching OpenTelemetry log events in the last 30 minutes.
        Search logs, traces, and metrics for service.name checkout-api and incident.id {{ consts.incident_id }}.
        Identify the affected worker, deployment version, error type, HTTP status, and latency evidence.
        Return the likely cause, supporting evidence, confidence, and whether the bounded simulated action below is consistent with the evidence.
        Proposed simulated action: simulate clearing the pricing cache on checkout-worker-07.
        This workflow must not change production.

  - name: case_title
    type: ai.agent
    agent-id: elastic-ai-agent
    with:
      conversation_id: "{{ steps.rca_analysis.output.conversation_id }}"
      message: "Produce a short case title for this checkout incident. Output only the title."

  - name: case_description
    type: ai.agent
    agent-id: elastic-ai-agent
    with:
      conversation_id: "{{ steps.rca_analysis.output.conversation_id }}"
      message: "Produce a concise case description grounded in the OpenTelemetry evidence. Include the incident ID and say that remediation requires human approval. Output only the description."

  - name: create_case
    type: cases.createCase
    with:
      title: "{{ steps.case_title.output.message }}"
      description: "{{ steps.case_description.output.message }}"
      owner: "observability"
      severity: "medium"
      tags:
        - sre-control-plane
        - agent-builder
        - human-in-the-loop
        - opentelemetry

  - name: add_agent_analysis
    type: cases.addComment
    with:
      case_id: "{{ steps.create_case.output.case.id }}"
      comment: |
        ## Agent Builder RCA and proposed action

        Evidence query matches: {{ steps.collect_evidence.output.hits.total.value }}

        {{ steps.rca_analysis.output.message }}

        Proposed simulated action: simulate clearing the pricing cache on checkout-worker-07.
        No action has run yet.

        Agent conversation: {{ kibanaUrl }}/app/agent_builder/conversations/{{ steps.rca_analysis.output.conversation_id }}

  - name: review
    type: waitForInput
    with:
      message: |
        Approve the bounded checkout response?

        Incident: {{ consts.incident_id }}
        Evidence: {{ steps.collect_evidence.output.hits.total.value }} matching checkout failure logs in the last 30 minutes.
        Target: checkout-worker-07
        Action: simulate clearing the pricing cache on this worker only.
        Expected effect: subsequent checkout requests no longer use the stale cache.
        Blast radius: one worker. This simulated step does not change production.

        Review the Agent Builder analysis in case {{ steps.create_case.output.case.id }} before deciding.
      schema:
        type: object
        properties:
          approved:
            type: boolean
            title: "Approve the simulated cache clear"
          notes:
            type: string
            title: "Reviewer notes"
        required:
          - approved

  - name: approved_action
    type: console
    if: "steps.review.output.approved : true"
    with:
      message: "Approved. Simulated cache clear recorded for checkout-worker-07. Reviewer notes: {{ steps.review.output.notes }}"

  - name: verify_after_approval
    type: elasticsearch.search
    if: "steps.review.output.approved : true"
    with:
      index: "logs-*"
      size: 0
      query:
        bool:
          filter:
            - range:
                "@timestamp":
                  gte: "now-5m"
            - term:
                "service.name": "checkout-api"
            - term:
                "attributes.incident.id": "{{ consts.incident_id }}"
            - match_phrase:
                "body.text":
                  query: "checkout failed: stale pricing cache"

  - name: record_approved
    type: cases.addComment
    if: "steps.review.output.approved : true"
    with:
      case_id: "{{ steps.create_case.output.case.id }}"
      comment: |
        ## Human decision: approved

        Reviewer notes: {{ steps.review.output.notes }}
        Simulated action target: checkout-worker-07
        Verification query matches in the last 5 minutes: {{ steps.verify_after_approval.output.hits.total.value }}

        This walkthrough did not change production.

  - name: record_declined
    type: cases.addComment
    if: "steps.review.output.approved : false"
    with:
      case_id: "{{ steps.create_case.output.case.id }}"
      comment: |
        ## Human decision: declined

        Reviewer notes: {{ steps.review.output.notes }}
        No action ran.

  - name: declined_console
    type: console
    if: "steps.review.output.approved : false"
    with:
      message: "Declined. No action executed. Reviewer notes: {{ steps.review.output.notes }}"
</code></pre>
<p>The <code>collect_evidence</code> and <code>rca_analysis</code> steps keep the same evidence-then-reasoning sequence as the first article, and the workflow writes that analysis into the case <em>before</em> it ever reaches the <code>waitForInput</code> boundary. By the time a human is asked to decide, the reasoning is already durable and linkable.</p>
<p>The approval form asks for one boolean and accepts optional notes. </p>
<p>Only the approved branch records the simulated cache clear, runs a bounded verification query, and appends the result to the case. The declined branch records the decision and runs nothing.</p>
<p>The approval request carries the resulting count into the decision, while the linked case retains the full Agent Builder analysis. Treat that count as evidence for the reviewer, not as a root-cause claim or a performance measurement.   </p>
<h3 id="replacethesimulatedactionwithrealautoremediation">Replace the simulated action with real auto remediation</h3>
<p>The walkthrough keeps the approved branch as a <code>console</code> step so you can run both branches safely. In production you replace <em>only</em> that step with a narrowly scoped <a href="https://www.elastic.co/docs/explore-analyze/workflows/steps/external-systems-apps">external action</a>, and leave the case, timeout, verification, and decline path exactly as they are.</p>
<p>You have two options, depending on how the target system is reached.</p>
<h3 id="callaninternalremediationapiwithanhttpconnector">Call an internal remediation API with an HTTP connector</h3>
<p>Configure an HTTP connector in Kibana with the base URL, authentication, and any encrypted headers, then reference it by <code>connector-id</code>. Secrets stay in the connector, never in the workflow YAML.</p>
<pre><code>  - name: clear_pricing_cache
    type: http
    connector-id: "checkout-remediation-api"
    if: "steps.review.output.approved : true"
    with:
      path: "/v1/cache/pricing/purge"
      method: "POST"
      body:
        worker: "checkout-worker-07"
        incident_id: "{{ consts.incident_id }}"
</code></pre>
<h3 id="handofftojiraslackorpagerduty">Hand off to Jira, Slack or PagerDuty</h3>
<p><a href="https://www.elastic.co/docs/reference/kibana/connectors-kibana">Kibana connectors</a> are available as workflow steps, so the approved branch can open a <code>jira</code> ticket for a change-managed action, post to <code>slack</code> for the on-call channel, or page through PagerDuty, all using credentials your team already manages centrally.</p>
<pre><code>  - name: notify_oncall
    type: slack
    connector-id: "sre-oncall-channel"
    if: "steps.review.output.approved : true"
    with:
      message: "Approved by {{ steps.review.output.notes }}: pricing cache cleared on checkout-worker-07 for {{ consts.incident_id }}."
</code></pre>
<p>Whichever you choose, keep the action bound. </p>
<h2 id="howtodesignahumanintheloopautomationgate">How to design a human-in-the-loop automation gate</h2>
<p>The workflow above shows the mechanics. Getting the gate right is a design problem: where the pause goes, what the request tells the reviewer, what happens when nobody answers, and what the execution record has to preserve. Each one maps back to one of the five bindings.</p>
<h3 id="whereshouldtheapprovalstepgoinanincidentresponseworkflow">Where should the approval step go in an incident response workflow?</h3>
<p>The best place for <code>waitForInput</code> is immediately before the first step that increases impact. Don't pause before gathering evidence, because the workflow can usually search, enrich, classify, and open a draft case without touching the affected service. And don't pause after the remediation, because that just asks a person to ratify something that already happened.</p>
<p>Before anyone enables the workflow, a reviewer can inspect the evidence query, the form schema, the timeout, the branch condition, and the action itself.</p>
<h3 id="whatagoodapprovalrequesttellsthereviewer">What a good approval request tells the reviewer</h3>
<p>An on-call engineer should not have to reconstruct the investigation from five other screens. Lead with the decision and include only the evidence needed to make it. A strong approval request answers these questions, in this order:</p>
<ol>
<li>What exactly am I deciding?  </li>
<li>What telemetry supports the proposal?  </li>
<li>What target and parameters will the action use?  </li>
<li>What is the expected effect and blast radius?  </li>
<li>What happens if I decline or do nothing?</li>
</ol>
<p>One required decision plus optional notes is usually enough. If the reviewer has to type in service names, host identifiers, environment, and action parameters, the proposal wasn't specific enough before the pause.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltda4f7ca71ecde303/6a90260eb74e9df38c44b26e/03-approval-form.png" alt="The Provide action dialog showing the approval request with the incident, the evidence count, the target worker, the expected effect, and the blast radius, above a JSON form submitting the approved decision" /></p>
<p>Paused executions stay discoverable in history and can be resumed by any authorized reviewer, which brings up a queueing requirement. Once a team has more than a few paused executions, reviewers need an inbox or an equivalent filtered view showing pending decisions, age, owner, severity, and target. Otherwise, a safe pause quietly becomes an invisible backlog.</p>
<h3 id="whathappensifnobodyapprovesintime">What happens if nobody approves in time</h3>
<p><code>waitForInput</code> has no default timeout; the execution waits indefinitely. The <a href="https://www.elastic.co/docs/explore-analyze/workflows/authoring-techniques/settings"><code>settings.timeout</code> field</a> caps the entire execution, including time spent waiting for input, and in this workflow the 30-minute value limits how long the proposal stays actionable after the evidence was collected.</p>
<p>Choose that value from the incident and the action; a traffic shift during an active outage may need a decision within minutes. A maintenance approval may stay valid for hours. Confirm the timeout behavior on the exact Elastic version you operate, and add an external escalation or cancellation path if what you observe doesn't meet your fail-closed requirement.</p>
<p>Whatever you do, don't convert silence into approval.</p>
<h3 id="whattheauditrecordmustcapture">What the audit record must capture</h3>
<p>The execution history should answer four questions without anyone digging through chat history:</p>
<ul>
<li>What evidence did the workflow collect?  </li>
<li>What exact input did the reviewer submit?  </li>
<li>Which branch ran?  </li>
<li>What did the action and verification steps return?</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt7d83a3c0613fb503/6a902629a3077c37f23fda9f/04-execution-waiting.png" alt="Workflow execution paused in the waiting state, with the evidence and case steps complete and the review step flagged as requiring action" />
<img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd8b8b6a5b5873667/6a9026471111551c070d0a5f/05-execution-approved.png" alt="Completed workflow execution showing the reviewer's approved input in the execution record, with the action, verification, and case steps all resolved" /></p>
<p>A paused execution shows the evidence step and the decision still pending. An approved execution adds the action branch and the verification output to that same view. A declined execution preserves the same evidence and the same decision while skipping every action step. Keeping the walkthrough action simulated lets you inspect both branches without changing production.</p>
<p>For longer-lived incident context, push it into the case. Add the evidence summary, reviewer notes, action result, and verification result as comments, and the case becomes the durable record that outlives the execution.</p>
<h2 id="howtoknowwhenaworkflowisreadytorunwithoutapproval">How to know when a workflow is ready to run without approval</h2>
<p>Don't remove the approval gate because a handful of runs succeeded. Review enough executions to understand both the normal and the exceptional paths, and measure at least these outcomes:</p>
<p>| Measure | Question it answers |
| :---- | :---- |
| Proposal acceptance rate | Does the workflow recognize the right incident class? |
| Reviewer edits or declines | Which evidence or action parameters are still wrong? |
| Approval age | Can the team respond before evidence becomes stale? |
| Action success rate | Does the bounded action execute reliably? |
| Verification success rate | Did the service improve after the action? |
| Rollback rate | How often did the response create a new problem? |</p>
<p>Autonomous execution is reasonable only when the incident class, target selection, action, verification, permissions, timeout, and rollback path are all narrow and repeatable. Even then, keep the same workflow structure. Automation should bypass the human wait for the proven path, not bypass evidence collection, authorization, verification, or audit records. Route anything uncertain back to human review.</p>
<h2 id="conclusion">Conclusion</h2>
<p>The approval gate is a small amount of YAML, but it changes what the automation is. <code>waitForInput</code> turns the decision into a structured input the branch logic depends on, so the action, the verification, and the case comment all exist because a named person answered a specific question at a specific time. Placing that pause right before the first step that increases impact, and capping it with <code>settings.timeout</code>, is what makes it a reliability control instead of a confirmation dialog.</p>
<p>Taking this to production is a smaller change than it looks: the simulated <code>console</code> step becomes an <code>http</code>, <code>slack</code>, or <code>jira</code> connector step, and everything else stays as it is. From there you earn autonomy one incident class at a time, letting acceptance rate, approval age, action success, verification success, and rollback rate tell you when a path is proven enough to run without the wait.</p>
<h2 id="wheretostartwithhumanintheloopautomation">Where to start with human-in-the-loop automation</h2>
<p>Start with one recurring operational signal and one reversible response. Build the evidence query first, then add a recommendation that names the target and the expected effect, then insert <code>waitForInput</code> immediately before the action and run the workflow in a lab or case-only mode. Review the execution history with SREs, developers, support, security, and the product owners of the affected service.</p>
<p>The approval gate is not the destination. It is the mechanism that lets a team move toward narrow autonomy without giving up evidence, accountability, or control.</p>
<ul>
<li><a href="https://www.elastic.co/docs/explore-analyze/workflows/authoring-techniques/human-in-the-loop">Human-in-the-loop workflow guide</a>  </li>
<li><a href="https://www.elastic.co/docs/explore-analyze/workflows/steps/flow-control-steps#waitforinput"><code>waitForInput</code> flow-control reference</a>  </li>
<li><a href="https://www.elastic.co/docs/explore-analyze/workflows/steps/external-systems-apps">External systems and apps steps</a>  </li>
<li><a href="https://www.elastic.co/docs/reference/kibana/connectors-kibana">Kibana connectors reference</a>  </li>
<li><a href="https://www.elastic.co/docs/explore-analyze/workflows/authoring-techniques/monitor-workflows">Workflow monitoring guide</a></li>
</ul>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/incident-response-automation-human-approval-gate</link>
    <guid isPermaLink="false">incident-response-automation-human-approval-gate</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <dc:creator><![CDATA[Jeffrey Rengifo]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt0a01d1c6dcc3a9d6/6a90266fd62e111636e3638c/header.jpg" length="0" type="image/jpeg"/>
    <pubDate>Thu, 27 Aug 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[From alert to root cause in 3 minutes: automated root cause analysis with Elastic Agent Builder]]></title>
    <description><![CDATA[Automated root cause analysis only works if the agent compares the incident window against the last healthy one. Skip that step and you get a summariser. The read-only skill, the scoped role and the Elastic Workflow are all here.]]></description>
    <content:encoded><![CDATA[<p>An alert fires on checkout latency. Three minutes and 22 seconds later there's an Elastic Observability case open with the root cause, the evidence behind it, and how confident the agent was. Nobody moved between Kibana, chat, tickets and a terminal to get there.</p>
<p>In this article, we'll build that loop end to end. We'll use <a href="https://www.elastic.co/docs/solutions/observability/ai/agent-builder-observability">Elastic Agent Builder</a> to feed logs, traces, metrics, alerts, and runbook context into an agent that investigates a problem, and <a href="https://www.elastic.co/docs/explore-analyze/workflows">Elastic Workflows</a> to execute the known next steps: opening a case, sending a notification, running an enrichment query, or triggering a remediation path.</p>
<p>We'll work through a checkout latency regression as our example, but the same pattern applies to any incident class where your team already knows the manual steps.</p>
<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li><a href="https://www.elastic.co/cloud">Elastic Cloud</a> or <a href="https://www.elastic.co/docs/deploy-manage/deploy/self-managed">self-managed</a> cluster running 9.4+</li>
</ul>
<p>We'll use a checkout latency regression as the running example. If you want to follow along against your own telemetry, point the queries at your service instead. If you'd rather reproduce the exact incident, the <a href="https://github.com/elastic/elasticsearch-labs/blob/main/supporting-blog-content/observability-labs/automated-root-cause-analysis-agent-builder/automated-root-cause-analysis-agent-builder.ipynb">supporting notebook</a> simulates it and sets up the role, skill, tool, and workflow for you.</p>
<h2 id="whydashboardsarenotenoughforincidentresponse">Why dashboards are not enough for incident response</h2>
<p>Dashboards show the symptom but cannot choose the next query. A dashboard is still one of the best tools for shared situational awareness, and during an incident the hard work starts after the chart turns red and the engineer still needs to answer a sequence of operational questions.</p>
<ul>
<li><strong>What changed?</strong> You need access to related deploys, alerts, logs, traces, and metrics from the same time window.</li>
<li><strong>What is affected?</strong> You need visibility into services, hosts, users, regions, SLOs, and dependency paths.</li>
<li><strong>What is the likely cause?</strong> You need evidence from telemetry combined with runbooks or previous incident cases.</li>
<li><strong>What is safe to do next?</strong> You need a bounded action that includes proper permissions, an audit trail, and a rollback path.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt6114ae1146e77d77/6a8ea04cf65645830854b8a0/02-dashboard-limits.png" alt="Kibana dashboard with KPI, trend, and breakdown panels showing current state but no next step" /></p>
<p>That last question is where a dashboard stops. It can show the symptom, but it cannot decide which query to run next, which runbook applies, or which workflow should run. Engineers provide that judgment today by moving between Kibana, chat, tickets, terminals, and internal docs.</p>
<p>An SRE control plane keeps the judgment with the engineer while moving more context and more action into the same operational surface.</p>
<h2 id="howautomatedrootcauseanalysisworksstatepolicyandaction">How automated root cause analysis works: state, policy and action</h2>
<p>Automated root cause analysis needs three things in one place: the telemetry, the permissions that bound it, and the actions it can trigger.</p>
<ul>
<li><strong>State:</strong> For SRE work, that state is telemetry in Elasticsearch: logs, traces, metrics, alerts, SLOs, and related operational records.</li>
<li><strong>Policy:</strong> Policy defines who can query which data, which tools an agent can call, which workflows can run, and where a human decision is required.</li>
<li><strong>Action:</strong> Action is a set of known tools and workflows that run with explicit inputs, permissions, and outputs.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltb6dd104b9aa23ca4/6a8ea04fb0dddebce0929d43/03-control-plane.png" alt="Elastic as an SRE control plane: investigate with Agent Builder and tools, decide behind guardrails, act through workflows" /></p>
<p>Agent Builder is useful where the system needs reasoning over messy context, and Workflows are useful where the system needs deterministic execution.</p>
<p>The two can work in both directions; a workflow can call an agent with an <code>ai.agent</code> step when it needs analysis before the next step, and an agent can call a workflow through a workflow tool when a conversation needs a repeatable action.</p>
<h2 id="whatelasticagentbuilderaddstoaiincidentresponse">What Elastic Agent Builder adds to AI incident response</h2>
<p><a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/skills">Agent Builder skills</a> are reusable capability packs. A skill can include instructions, tools, and context that guide an agent through a specific task.</p>
<p>Reusable skill packs matter for SRE work because incident response is rarely a single query. A good investigation has a shape, and root cause analysis is a good example. The useful unit is not "ask the model what happened." It's a repeatable investigation path that starts from an alert, scopes the time window, checks the right telemetry, records uncertainty, and hands a case or workflow a structured result. The agent needs to decide which signal to start from, query the right index, compare the right time windows, inspect related services, and explain the evidence without hiding what it doesn't know.</p>
<p>Elastic includes a built-in Elastic AI Agent for this pattern. Built-in skills are scoped by solution, so the one that carries an SRE incident loop is <code>observability.investigation</code>, alongside platform skills such as <code>dashboard-management</code> that any solution can use. The list shows the short name, so look for <code>investigation</code> in the UI.</p>
<p>The skill ships as Markdown instructions, the same format we use for our own skill in the next section.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt0fd3e84ed2a01173/6a8ea052cf1e0e1f3e756709/04-skills.png" alt="The observability.investigation skill in Agent Builder, showing its description and its Markdown instructions" /></p>
<p>There are also out-of-the-box <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools">tools</a> such as <code>platform.core.search</code>, <code>platform.core.get_document_by_id</code>, <code>platform.core.get_index_mapping</code>, <code>platform.core.list_indices</code>, <code>platform.core.get_workflow_execution_status</code>, and <code>platform.core.resume_workflow_execution</code>.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltef9789bfb6591041/6a8ea056af2548467458e3a4/05-tools.png" alt="Agent Builder Tools page listing the built-in platform.core tools, with the search tool description open" /></p>
<p>Skills guide the work, tools perform bounded operations, and the agent chooses what to use based on the task.</p>
<h2 id="thescenarioacheckoutlatencyregression">The scenario: a checkout latency regression</h2>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt6294afc4fcd74760/6a8ea0583e4fd5f1131a8a02/06-scenario.png" alt="Alert triggers an Agent Builder investigation across logs, traces, and metrics, ending in a root cause and a case" /></p>
<p>Deployment <code>2026.07.09.1</code> ships a connection pool misconfiguration to <code>checkout-api</code>. Within minutes, p95 latency goes from 180ms to over 2s and HTTP 500s appear for the first time. Nobody knows yet that the pool is the cause.</p>
<p>The evidence is spread across three signals, and no single one answers the question:</p>
<p>| Signal | What it shows |
| :---- | :---- |
| Logs | <code>PoolExhaustedException</code> and HTTP 500s, only on the new version |
| Traces | The <code>payment-gateway</code> span goes from ~180ms to ~2500ms |
| Metrics | Connection pool pinned at 20 of 20 right after the deploy |</p>
<p>Correlating those three is the work we want the agent to do. That gives us the contract for the rest of this article:</p>
<p>| Contract | Detail |
| :---- | :---- |
| <strong>Input</strong> | Service name and the alert summary |
| <strong>Access</strong> | Read-only search over <code>logs-*</code>, <code>traces-*</code>, and <code>metrics-*</code> |
| <strong>Output</strong> | Likely cause, supporting evidence, confidence, and the next safe action |
| <strong>Side effect</strong> | One Observability case with the analysis attached |</p>
<p>Everything after this point builds one piece of that contract: the skill shapes the investigation, the tool and role bound the access, and the workflow turns the output into a case.</p>
<h2 id="buildareadonlyinvestigationskillinelasticagentbuilder">Build a read-only investigation skill in Elastic Agent Builder</h2>
<p>Let's start with a read-only skill that improves investigation quality without touching production:</p>
<pre><code># Checkout latency investigation

Use this skill when an engineer asks why checkout latency, errors, or failed transactions increased.

Work through the investigation in this order:

1. Identify the affected service, environment, and time range.
2. Query traces for the slowest transactions in that window.
3. Query logs for errors from the same service and dependency path.
4. Compare current error and latency rates with the previous healthy window.
5. Return the likely cause, supporting evidence, confidence level, and the next safe action.

Do not recommend a production change unless there is a workflow tool assigned for that action.

If the evidence is incomplete, say what data is missing.
</code></pre>
<p>This kind of skill is a runbook execution guide, and it keeps the agent consistent across incidents. It also helps less experienced engineers ask better follow-up questions, because the agent can show the next query and explain why it matters.</p>
<p>Without step 4, the agent describes what's happening now and stops there. Comparing against the previous healthy window is what makes it an analysis. And the last line lets the agent say the data is missing instead of guessing.</p>
<h2 id="addaiagentobservabilitytoolswithnarrowpermissions">Add AI agent observability tools with narrow permissions</h2>
<p>Each tool should expose the smallest operation the agent needs, with the smallest data access that still supports the task.</p>
<p>For a read-only investigation agent, the required privileges usually start with searching observability data and inspecting index structure. The <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/permissions">Agent Builder permissions documentation</a> calls out that tools run against Elasticsearch data as the current user, and that read-oriented tools need index privileges such as <code>read</code> and <code>view_index_metadata</code>.</p>
<p>Run this in Dev Tools to create an investigation-scoped role:</p>
<pre><code>POST /_security/role/agent-builder-observability-investigator
{
  "cluster": ["monitor_inference"],
  "indices": [
    {
      "names": ["logs-*", "metrics-*", "traces-*"],
      "privileges": ["read", "view_index_metadata"]
    }
  ],
  "applications": [
    {
      "application": "kibana-.kibana",
      "privileges": ["feature_agentBuilder.read", "feature_actions.read"],
      "resources": ["space:default"]
    }
  ]
}
</code></pre>
<p>This role gives the agent enough access to inspect telemetry while keeping production-changing actions out of scope. The <code>monitor_inference</code> cluster privilege is what lets the agent use the inference endpoints behind Agent Builder, and it grants no data access on its own.</p>
<p>When you add a custom tool, describe it in operational language, because the tool description is part of how the agent decides when to call it. Prefer descriptions like this:</p>
<pre><code>Use this tool to search checkout service logs for errors in a bounded time range.

Required inputs:
- service_name
- environment
- start_time
- end_time

Return:
- matching log samples
- error counts by message
- affected host and pod names when present
</code></pre>
<p>A narrow tool description is much safer than a broad tool that says "search all logs for anything relevant." The agent gets a clear contract, and reviewers can reason about what the tool can and cannot do.</p>
<h2 id="useelasticworkflowsforincidentresponseautomation">Use Elastic Workflows for incident response automation</h2>
<p>Once the investigation path is useful, we can add Workflows for the actions that should be repeatable. With Workflows the control plane becomes operational because it can query more context, ask an agent to summarize evidence, open a case, notify a channel, or call a remediation endpoint. The key is that each step is explicit.</p>
<p>The Workflows editor gives you a validation loop before you save or run anything. Use it to catch syntax issues before the workflow writes to Cases or calls any action.</p>
<p>Go to <strong>Workflows &gt; Create workflow</strong> and paste the following:</p>
<pre><code>name: obs-labs-checkout-control-plane
description: Checkout regression investigation with Agent Builder and case creation.
tags: ["sre-control-plane", "agent-builder", "workflows"]

triggers:
  - type: manual

inputs:
  - name: service_name
    type: string
    default: "checkout-api"
  - name: alert_summary
    type: string
    default: "Checkout API p95 latency increased above 2s and HTTP 500s rose in the last 15 minutes after deployment 2026.07.09.1."

steps:
  - name: rca_analysis
    type: ai.agent
    agent-id: elastic-ai-agent
    create-conversation: true
    with:
      message: |
        Investigate this checkout incident as an SRE would.

        Service: {{ inputs.service_name }}
        Alert: {{ inputs.alert_summary }}

        Search the available logs, traces, and metrics for this service.
        Compare the window before and after the most recent deployment.

        Return a concise likely cause, supporting evidence, confidence, and next safe action.
        If the evidence is incomplete, say what data is missing.

  - name: case_title
    type: ai.agent
    agent-id: elastic-ai-agent
    with:
      conversation_id: "{{ steps.rca_analysis.output.conversation_id }}"
      message: "Produce a short case title for this incident. Output only the title."

  - name: case_description
    type: ai.agent
    agent-id: elastic-ai-agent
    with:
      conversation_id: "{{ steps.rca_analysis.output.conversation_id }}"
      message: "Produce a concise case description. Output only the description."

  - name: create_case
    type: cases.createCase
    with:
      title: "{{ steps.case_title.output.message }}"
      description: "{{ steps.case_description.output.message }}"
      owner: "observability"
      severity: "medium"
      tags: ["sre-control-plane", "agent-builder", "workflows"]

  - name: add_agent_analysis
    type: cases.addComment
    with:
      case_id: "{{ steps.create_case.output.case.id }}"
      comment: |
        ## Agent Builder RCA

        {{ steps.rca_analysis.output.message }}

        Agent conversation: {{ kibanaUrl }}/app/agent_builder/conversations/{{ steps.rca_analysis.output.conversation_id }}
</code></pre>
<p>Each step feeds the next one through its output. <code>ai.agent</code> steps emit a <code>message</code> with the model's text and a <code>conversation_id</code>, and <code>cases.createCase</code> emits the new <code>case.id</code>. Those three fields are the whole contract:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd791f884d5887901/6a8ea080f61d6e99f39d4f76/07-workflow-steps.png" alt="Workflow steps: rca_analysis feeds case_title and case_description through a shared conversation, then a case is created and the analysis added as a comment" /></p>
<p>This workflow doesn't restart anything. It asks Agent Builder to investigate, reuses the same conversation to generate the case title and description, creates an Observability case, and writes the agent analysis back as a case comment.</p>
<p>Two details are worth calling out. The <code>create-conversation: true</code> flag on the first step is what makes the next two steps cheap: <code>case_title</code> and <code>case_description</code> pass the same <code>conversation_id</code>, so the agent already has the investigation in context and doesn't repeat the queries. And we use a manual trigger with a default <code>alert_summary</code> so you can run the sequence before attaching it to a live alert rule. In production, you'd switch the trigger to <code>alert</code> and attach the workflow to the rule that owns that incident class.</p>
<p>Run the workflow with the play button. Our run took 3 minutes and 22 seconds, with <code>rca_analysis</code>, <code>case_title</code>, <code>case_description</code>, <code>create_case</code>, and <code>add_agent_analysis</code> all marked as successful. Almost all of that is the investigation itself: <code>rca_analysis</code> alone took 3 minutes and 5 seconds, while the two case writes finished in about a second each.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt0de6f806a10502c9/6a8ea083bc5bb390c5f93c4c/08-workflow-execution.png" alt="Workflow execution view with the five steps successful in 3 minutes and 22 seconds" /></p>
<p>The workflow then wrote an Observability case. The case list shows one open case with the generated checkout title, our tags, medium severity, and one comment.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt2bac0ad2a9ed3c6b/6a8ea086f656457ab454b8bf/09-cases-list.png" alt="Observability Cases list showing one open case created by the workflow" /></p>
<p>The case detail is the audit artifact for the investigation. It records the evidence considered, the affected hosts and deployment version, the likely error type, the agent's confidence, and any missing signals.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf370e642a67d50e5/6a8ea0eabc5bb3171ff93c5c/10-case-detail.png" alt="Case detail with the generated description and the Agent Builder RCA comment" /></p>
<p>A useful operational control plane surfaces the limits of its evidence instead of turning uncertainty into a confident claim. If your agent never reports missing data or a lower confidence, that's a signal to tighten the skill instructions, not a sign that every investigation went well.</p>
<p>The read-only automated root cause analysis pattern improves response quality without changing the affected service. Add remediation only when the action is well understood, narrowly scoped, and paired with verification and rollback: clearing one cache key, restarting one worker, shifting traffic away from one unhealthy instance, or running a pre-approved maintenance task.</p>
<h3 id="turnelasticworkflowsintoagenttools">Turn Elastic Workflows into agent tools</h3>
<p><a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools/workflow-tools">Workflow tools</a> let an Agent Builder conversation trigger an Elastic Workflow and use its output. This is the bridge from "the agent recommended a next step" to "the agent can offer a known action."</p>
<p>A workflow tool should have a narrow description:</p>
<pre><code>Use this tool only when checkout errors are caused by connection pool exhaustion on a single worker.

The workflow drains and recycles the connection pool for one worker, then verifies that the worker resumes successful requests.

Required input:
- host_name

Do not use this tool for database outages, deploy regressions affecting all hosts, or multi-host failures.
</code></pre>
<p>The description matters because it sets the agent's selection boundary. Note how the last line excludes the very scenario we just investigated: our incident hit both hosts and was caused by a deploy, so the agent should not offer this tool. That's the point. A workflow tool that matches every incident is a workflow tool with no boundary.</p>
<p>The workflow still owns execution. The agent doesn't need to know how to recycle the pool. It only needs to recognize when a known workflow may apply, collect the required input, and present the action to the engineer.</p>
<h2 id="howdoyoustopanaiagentfromchangingproduction">How do you stop an AI agent from changing production?</h2>
<p>An SRE control plane should be built around blast-radius control, which means every action path needs a clear boundary. Use these checks before exposing a workflow as an agent tool:</p>
<p>| Check | Importance |
| :---- | :---- |
| Read-only first | Proves the investigation path before adding production action |
| Narrow input schema | Prevents vague prompts from becoming vague actions |
| Explicit permissions | Keeps the agent limited to the current user's allowed data and actions |
| Dry-run or case-only mode | Lets teams review outputs before enabling remediation |
| Human review for risky steps | Keeps judgment in the loop where impact is high |
| Post-action verification | Confirms that the workflow improved the service instead of only executing a command |</p>
<p>For the review boundary itself, Workflows gives you <code>wait</code> steps, timeouts, and execution history, so a risky path can pause for an approval and still leave an audit trail.</p>
<p>An agent can help gather evidence and propose the next step, but production action should stay inside known workflow paths.</p>
<h3 id="validateagainstoneincidentclassfirst">Validate against one incident class first</h3>
<p>For a real rollout, validate the control plane against one recurring incident class. Track whether the agent finds the right evidence, whether the workflow output is complete enough for review, and whether engineers trust the recommended next step.</p>
<p>Use a simple validation plan:</p>
<ol>
<li>Pick one alert type with a known runbook.</li>
<li>Build a read-only investigation skill for that alert.</li>
<li>Add one or two query tools with scoped index permissions.</li>
<li>Run the agent against historical incidents and compare its summary with the actual case notes.</li>
<li>Add a case-creation workflow and review the output with the owning SRE team.</li>
<li>Only then consider a workflow tool that performs a bounded remediation step.</li>
</ol>
<p>The main failure mode is not that the model gives an imperfect summary. It's granting broad action before the investigation path is proven. Keep the first version boring, scoped, and reviewable.</p>
<h2 id="conclusion">Conclusion</h2>
<p>What we covered:</p>
<ul>
<li>An SRE control plane combines state (telemetry in Elasticsearch), policy (permissions and review boundaries), and action (known tools and workflows).</li>
<li>Agent Builder handles reasoning over messy context, while Workflows handles deterministic execution, and the two can call each other.</li>
<li>A read-only investigation skill turns a runbook into a repeatable investigation path that records uncertainty instead of hiding it.</li>
<li>Scoped roles with <code>read</code> and <code>view_index_metadata</code> on <code>logs-*</code>, <code>metrics-*</code>, and <code>traces-*</code> keep the agent useful without letting it change production.</li>
<li>Reusing a <code>conversation_id</code> across <code>ai.agent</code> steps lets later steps build on the investigation instead of repeating it.</li>
<li>A case-only workflow gives you the full audit artifact before you enable any remediation.</li>
<li>Tool descriptions are a security boundary, not documentation, because they decide when the agent offers an action.</li>
</ul>
<h2 id="resources">Resources</h2>
<ul>
<li><a href="https://www.elastic.co/docs/solutions/observability/ai/agent-builder-observability">Agent Builder for Observability</a></li>
<li><a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/skills">Agent Builder skills</a></li>
<li><a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools">Agent Builder tools</a></li>
<li><a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools/workflow-tools">Workflow tools</a></li>
<li><a href="https://www.elastic.co/docs/explore-analyze/workflows/use-cases/ai-augmented-workflows">AI-augmented workflows</a></li>
<li><a href="https://www.elastic.co/docs/explore-analyze/workflows/use-cases/observability/root-cause-analysis">Root cause analysis workflow for observability alerts</a></li>
</ul>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/automated-root-cause-analysis-agent-builder</link>
    <guid isPermaLink="false">automated-root-cause-analysis-agent-builder</guid>
    <category><![CDATA[AI]]></category>
    <category><![CDATA[Agentic Observability]]></category>
    <dc:creator><![CDATA[Jeffrey Rengifo]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltcd0b2a7ebf36b14d/6a8ea0ee73006e52f1d8d9b3/01-header.png" length="0" type="image/png"/>
    <pubDate>Tue, 25 Aug 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Elastic Agent now runs as an OpenTelemetry Collector: Less memory overhead, zero config changes]]></title>
    <description><![CDATA[Elastic Agent 9.3 sends logs, metrics and traces through one OTel Collector pipeline, running Beats integrations alongside native OTel sources in a single Fleet-managed agent.]]></description>
    <content:encoded><![CDATA[<p>Elastic Agent 9.3 uses less memory and accepts data from any OpenTelemetry-compatible (OTel-compatible) source out of the box.
Under the hood, the old Beats subprocess architecture has been replaced by a single OTel-native pipeline for logs, metrics, and traces, built on the Elastic Distribution of OpenTelemetry (EDOT) Collector.
Your existing integrations, dashboards, Fleet policies, alerting rules, and ingest pipelines all work without changes.</p>
<h2 id="whatchangedinelasticagent93anativeotelcollectorunderthehood">What changed in Elastic Agent 9.3: A native OTel Collector under the hood</h2>
<p>Previously, Elastic Agent acted as a supervisor process, spinning up Beats-based subprocesses, such as Filebeat or Metricbeat.
From 9.3 onward, that architecture has been replaced.
Elastic Agent itself is now built on the EDOT Collector, turning it into a first-class OTel Collector under the hood while preserving its original functionality.</p>
<p>Key benefits of this architectural shift include:</p>
<ul>
<li><strong>Reduced footprint:</strong> Fewer subprocesses mean significantly less memory overhead and a simpler deployment model. In future releases, this footprint will be even further reduced.</li>
<li><strong>Unified telemetry pipeline:</strong> Logs and metrics flow through a single, standards-based OTel pipeline, as do traces.</li>
<li><strong>Ecosystem interoperability:</strong> Elastic Agent can now receive data from any OTel-compatible source out of the box. It can also be configured to emit to OTel-compatible destinations.</li>
<li><strong>Aligned with the OTel ecosystem:</strong> As the OTel ecosystem matures with new receivers, processors, and exporters, Elastic Agent deployments gain access to those capabilities automatically.</li>
</ul>
<p>When you deploy or update Elastic Agent from version 9.3 onward, you're deploying an OpenTelemetry Collector.
EDOT is the technology foundation; Elastic Agent is the product.</p>
<h2 id="howexistingbeatsconfigurationsruninsidetheotelcollectorpipeline">How existing Beats configurations run inside the OTel Collector pipeline</h2>
<p>Elastic has introduced Beats Receivers, which are Beat inputs and processors that execute natively inside the new OTel Collector pipeline.
For your teams and customers, this means:</p>
<ul>
<li>Existing <code>elastic-agent.yml</code> configurations require no modification.</li>
<li>Fleet-managed agents automatically translate policy configurations into OTel format internally.</li>
<li>All integrations, dashboards, ingest pipelines, and alerting rules continue to function exactly as before.</li>
<li>Data written via Beats Receivers lands in the same data streams as always.</li>
</ul>
<p>Upgrading to 9.3 is transparent because it uses the same inputs and produces the same outputs.</p>
<h2 id="runningbeatsandotelcollectorpipelinesinoneelasticagent">Running Beats and OTel Collector pipelines in one Elastic Agent</h2>
<p>The new Elastic Agent is a collector capable of simultaneously running traditional Beats-based collections alongside native OTel pipelines, all in a single deployment.
One agent policy can collect Elastic Common Schema–schematized (ECS-schematized) data via Beats Receivers and ingest native OpenTelemetry Protocol (OTLP) data from OTel-instrumented applications and infrastructure.
This same agent policy can apply OTel processing stages across all telemetry before export.</p>
<p>OTel integrations from Elastic's catalog can be added to any agent policy.
When native OTel data is ingested, Elastic automatically installs the relevant dashboards and alerts, in addition to necessary content packs, without any manual setup.</p>
<h2 id="whatstherelationshipbetweenelasticagentandedot">What's the relationship between Elastic Agent and EDOT?</h2>
<p>You may be familiar with EDOT, the Elastic Distribution of OpenTelemetry Collector, as a stand-alone product.
With this architectural change, EDOT is the technology foundation that now powers Elastic Agent, not a separate product that users need to track or deploy independently.</p>
<p>Going forward, Elastic Agent is the supported, Fleet-manageable, fully featured product.
A stand-alone deployment remains available for specific niche scenarios (environments where the full version of Elastic Agent cannot be installed), but it isn't the recommended path for the vast majority of users.</p>
<h2 id="elasticagentdeploymentoptionsfleetmanagedvsstandalone">Elastic Agent deployment options: Fleet-managed vs. stand-alone</h2>
<p>|                            | <strong>Fleet-managed Elastic Agent</strong> | <strong>Stand-alone Elastic Agent</strong>                                                                           |
| :------------------------- | :-----------------------------: | :-----------------------------------------------------------------------------------------------------: |
| Fleet lifecycle management | Yes                             | Can enroll into Fleet in-field without reinstallation                                                   |
| Beats Receivers            | Yes                             | Yes                                                                                                     |
| Elastic Defend             | Yes                             | No                                                                                                      |
| Cloud Security             | Yes                             | No                                                                                                      |
| Profiler support           | Yes                             | No                                                                                                      |
| OTel-native pipeline       | Yes                             | Yes                                                                                                     |
| Best for                   | Most deployments                | Environments where full Elastic Agent cannot be installed or management is handled by other tools       |</p>
<h2 id="doineedtochangeanythingwhenupgradingtoelasticagent93">Do I need to change anything when upgrading to Elastic Agent 9.3?</h2>
<p>For users running Elastic Agent today, upgrading to 9.3 requires no changes to configurations or integrations, and no changes to workflows.
For customers evaluating OTel adoption, Elastic Agent now provides a fully supported, production-ready OTel Collector with Fleet management and rich integrations, along with Elastic's full support matrix, and none of this requires a separate OTel deployment.</p>
<p>With Elastic Agent 9.3, Elastic's data collection is fully OpenTelemetry-native.
Elastic Agent is now an OpenTelemetry Collector.
Everything you have today still works, and you also get all the capabilities of OTel.</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/opentelemetry-collector-elastic-agent</link>
    <guid isPermaLink="false">opentelemetry-collector-elastic-agent</guid>
    <category><![CDATA[OpenTelemetry]]></category>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[What's New]]></category>
    <dc:creator><![CDATA[Nima Rezainia]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt36d2c1da5195912a/6a859a7218249c7a3818ec86/header.jpg" length="0" type="image/jpeg"/>
    <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Contextual AI: Stop pinging the SRE: three MCP tools that turn Elastic Agent Builder into your team's runbook]]></title>
    <description><![CDATA[Build three MCP tools in Elastic Agent Builder that read endpoint health, recent deploys and SLO burn rate directly in your editor. Encode your platform team's runbook once; every developer gets self-serve production context without pinging an SRE.]]></description>
    <content:encoded><![CDATA[<p>A developer asks their editor, "Is it safe to merge this PR?" and gets a real answer in seconds, not a 10–15 minute dashboard hunt or a Slack ping to an SRE. This post shows how to build three MCP tools in Elastic Agent Builder that read endpoint health, recent deploys, and SLO burn rate, and encode the platform team's interpretation rules, error rate thresholds, deploy warm-up windows, and burn rate limits directly into the tool descriptions. The result is contextual AI: an agent that reasons over production signals using the runbook the platform team wrote once.</p>
<h2 id="prerequisitesforelasticagentbuildermcptools">Prerequisites for Elastic Agent Builder MCP tools</h2>
<ul>
<li>An <a href="https://cloud.elastic.co/registration">Elastic Cloud</a> deployment with Elastic Stack 9.3+ (or Elastic Cloud Serverless) with Agent Builder enabled.</li>
<li>An APM-ingested service. If your cluster does not already have APM data, the companion notebook includes instructions to generate synthetic traffic using <a href="https://github.com/elastic/apm-integration-testing">elastic/apm-integration-testing</a> with the <code>opbeans-node</code> demo app.</li>
<li>An MCP-compatible client: <a href="https://docs.anthropic.com/en/docs/claude-code/overview">Claude Code</a>, <a href="https://www.cursor.com/">Cursor</a>, or VS Code with an MCP extension.</li>
<li>Basic familiarity with <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/esql.html">ES|QL</a> syntax.</li>
<li><a href="https://nodejs.org/">Node.js</a> 18+ (for the <code>mcp-remote</code> bridge).</li>
</ul>
<p>If you are new to MCP or need to set up the Elastic MCP server for the first time, check out <a href="https://www.elastic.co/search-labs/blog/elastic-mcp-server-agent-builder-tools">Connect Agent Builder tools to any AI agent with Elastic MCP server</a> for the full setup walkthrough. This article assumes the MCP server is already configured.</p>
<h2 id="theproblemwhydevelopersflyblind">The problem: why developers fly blind</h2>
<p>A developer is about to merge a pull request. The change looks simple: increasing the timeout for the downstream <code>recommendations</code> service call from 2 seconds to 5 seconds. But before hitting the merge button, a question lingers: <em>is the service healthy enough to absorb this change right now?</em></p>
<p>To answer that question today, the developer has two options:</p>
<ol>
<li><strong>Check dashboards manually.</strong> Open the APM UI, look at error rates, scan latency charts, find the SLO page, and look for recent deploys. This takes 10-15 minutes and requires knowing what to look for and how to interpret it.</li>
<li><strong>Ask an SRE.</strong> Ping the platform team on Slack: "Hey, is checkout healthy? I want to merge something." This creates an interruption, adds latency to the decision, and doesn't scale.</li>
</ol>
<p>The core problem is not the data. Elastic already collects everything: traces, metrics, error logs, deploy markers, and SLO budgets. The problem is that <strong>correlating multiple signals requires mental overhead and domain knowledge that most developers don't have</strong>.</p>
<p>An SRE knows that a p99 spike after a deploy is normal for 5 minutes, that an error rate under 0.5% is acceptable during a release window, and that merging when the SLO budget is below 20% is risky. That knowledge lives in runbooks, tribal memory, and experience.</p>
<p>What if the platform engineer could encode that knowledge into tools that any developer can query from their editor?</p>
<h2 id="howmcptoolsinelasticagentbuilderencodeyourrunbook">How MCP tools in Elastic Agent Builder encode your runbook</h2>
<p>The key insight is this: <strong>a tool is not just a query; it is a query plus interpretation</strong>. A dashboard shows you a p99 of 450ms. A well-designed tool tells you "p99 is 450ms, which is within normal range for this service, and has been stable since the last deploy 2 hours ago."</p>
<p>The difference is that the tool description carries the domain knowledge. When a platform engineer creates a tool in <a href="https://www.elastic.co/search-labs/blog/elastic-ai-agent-builder-context-engineering-introduction">Agent Builder</a>, they write descriptions like: "Error rate above 1% typically indicates a regression. If this coincides with a recent deploy, the deploy is the likely cause." That description becomes part of the context the AI agent uses when reasoning across multiple tool results.</p>
<p>This is what we mean by <em>contextual AI</em>: the AI agent does not just fetch data; it reasons over it using the interpretation rules that the platform team encoded.</p>
<p>Here is the architecture:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf9dab0ce1789f384/6a85c8599d2b71139df93915/image-02.png" alt="Architecture: developer editor with MCP client connecting to Elastic Agent Builder tools authored by the platform engineer" /></p>
<p>The platform engineer authors the tools once. Every developer on the team benefits from their own editor, without needing to learn ES|QL or understand APM data models.</p>
<h2 id="settinguptheelasticagentbuildersampleenvironment">Setting up the Elastic Agent Builder sample environment</h2>
<p>The full end-to-end setup (traffic generation with <a href="https://github.com/elastic/opbeans-node">opbeans-node</a>, deploy annotations, SLO creation, and the three Agent Builder tools) is available as a runnable notebook at this repository: <a href="https://github.com/Delacrobix/OART-Contextual-AI-Bridging-the-Gap-between-Platform-Engineering-and-Product-Development/blob/main/notebook.ipynb"><code>notebook.ipynb</code></a>. The sections below focus on the ES|QL queries and tool descriptions: the <em>why</em> behind each tool, not the mechanics of posting them.</p>
<h2 id="buildingtool1get_endpoint_health">Building Tool 1: get_endpoint_health</h2>
<p>This tool answers the question: "How is this endpoint performing right now?" It returns error rate, latency percentiles (p50, p95, p99), and throughput for a given service and endpoint within a time window.</p>
<p>Here is the full <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools/esql-tools">tool configuration</a> as created in Agent Builder:</p>
<pre><code>{
  "id": "get_endpoint_health",
  "type": "esql",
  "description": "Returns the current health of a service endpoint: error rate, latency percentiles (p50/p95/p99), and throughput. Use this tool to assess whether a service is healthy before making changes. Interpretation guide: error rate below 0.5% is healthy, 0.5-1% is elevated (check for recent deploys), above 1% indicates a problem. For latency, compare p99 against the service baseline: checkout is typically under 500ms, product-search under 200ms. A sudden p99 spike within 15 minutes of a deploy suggests the deploy caused a regression.",
  "tags": ["apm", "reliability", "health"],
  "configuration": {
    "query": "FROM traces-apm-* | WHERE service.name == ?serviceName AND @timestamp &gt;= NOW() - ?timeWindow AND transaction.duration.us IS NOT NULL | STATS total_transactions = COUNT(*), error_count = SUM(CASE(event.outcome == \"failure\", 1, 0)), p50_latency_ms = PERCENTILE(transaction.duration.us, 50) / 1000, p95_latency_ms = PERCENTILE(transaction.duration.us, 95) / 1000, p99_latency_ms = PERCENTILE(transaction.duration.us, 99) / 1000 BY service.name | EVAL error_rate_pct = ROUND(error_count / total_transactions * 100, 2) | EVAL throughput_per_min = ROUND(total_transactions / ?windowMinutes, 1)",
    "params": {
      "serviceName": {
        "type": "keyword",
        "description": "The APM service name to check (e.g., opbeans-node)"
      },
      "timeWindow": {
        "type": "keyword",
        "description": "Time window to analyze, in ES|QL duration format (e.g., 30 minutes, 1 hour, 6 hours)"
      },
      "windowMinutes": {
        "type": "integer",
        "description": "Time window in minutes, used to calculate throughput per minute"
      }
    }
  }
}
</code></pre>
<p>The query uses the <a href="https://www.elastic.co/observability-labs/blog/elastic-discover-traces-apm"><code>traces-apm-*</code></a> data stream, which contains raw transaction data. We filter with <code>transaction.duration.us IS NOT NULL</code> to select only transaction events (excluding spans). Using <code>traces-apm-*</code> is more portable than the pre-aggregated <code>metrics-apm.transaction.1m-*</code> stream, which only populates after sustained traffic.</p>
<p>Notice the <code>description</code> field. It is not just "returns health metrics." It includes <strong>interpretation rules</strong>: what error rate thresholds mean, what latency baselines look like, and how to correlate spikes with deploys. This is the runbook encoded in the tool.</p>
<h2 id="buildingtool2get_recent_deploys">Building Tool 2: get_recent_deploys</h2>
<p>This tool answers: "What has been deployed recently?" Deploy history is a critical context because most production issues correlate with code changes. The agent needs this to reason about whether current metrics are normal or reflect a recent deployment.</p>
<p>Deploy annotations are stored in the <code>observability-annotations</code> index. Here is the full tool configuration:</p>
<pre><code>{
  "id": "get_recent_deploys",
  "type": "esql",
  "description": "Returns the deployment history for a service over the last 24 hours, including version numbers, timestamps, and deploy messages. Use this tool to understand the deployment timeline when assessing service health. Key patterns: if a deploy happened within the last 15 minutes, elevated error rates or latency may be expected (warm-up period). If metrics degraded immediately after a deploy, the deploy is the likely cause. Multiple deploys in a short window (under 2 hours) increase risk because it becomes harder to isolate which change caused an issue.",
  "tags": ["apm", "deploys", "change-tracking"],
  "configuration": {
    "query": "FROM observability-annotations | WHERE service.name == ?serviceName AND @timestamp &gt;= NOW() - 24 hours | SORT @timestamp DESC | KEEP @timestamp, service.version, service.environment, message | LIMIT 10",
    "params": {
      "serviceName": {
        "type": "keyword",
        "description": "The APM service name to check deploy history for"
      }
    }
  }
}
</code></pre>
<p>Again, the <code>description</code> encodes domain knowledge: the 15-minute warm-up window, the correlation between deploys and metric changes, and the risk of multiple rapid deploys. This is how a platform engineer transfers their intuition into something an AI agent can reason with.</p>
<h2 id="buildingtool3get_slo_status">Building Tool 3: get_slo_status</h2>
<p>This tool answers: "How much error budget do we have left?" <a href="https://www.elastic.co/docs/solutions/observability/incident-management/service-level-objectives-slos">SLO budget</a> is the platform team's quantified way of expressing risk tolerance. If the budget is nearly spent, even a small change could cause a violation.</p>
<p>Unlike the previous tools that query APM data, this one queries the internal SLO indices where Elastic stores pre-computed SLI data. The query calculates the current burn rate, that is, how fast the service is consuming error budget relative to the allowed threshold:</p>
<pre><code>{
  "id": "get_slo_status",
  "type": "esql",
  "description": "Returns the current SLO burn rate for a service over the last hour. The response includes: SLI value (current performance), error budget target, and burn rate percentage. The burn rate tells you how fast the service is consuming error budget relative to the allowed threshold. Interpretation: a burn rate below 100% means the service is consuming budget slower than the limit (sustainable). Between 100-200%, the service is burning budget faster than planned (proceed with caution). Above 200%, the service is burning budget at double the allowed rate (delay non-critical changes). Above 500%, investigate immediately. Note: this measures the current burn rate over the last hour, not cumulative budget consumption over the full SLO window. A temporarily high burn rate does not mean the overall budget is exhausted.",
  "tags": ["slo", "reliability", "budget"],
  "configuration": {
    "query": "FROM .slo-observability.sli-v* | WHERE slo.id == ?sloId AND @timestamp &gt;= NOW() - 1 hour | STATS sli_value = AVG(slo.numerator) / AVG(slo.denominator) BY slo.id, slo.name | EVAL error_budget_target = 0.995 | EVAL burn_rate_pct = ROUND((1 - sli_value) / (1 - error_budget_target) * 100, 1)",
    "params": {
      "sloId": {
        "type": "keyword",
        "description": "The SLO identifier. Use the SLO ID for the service you are evaluating."
      }
    }
  }
}
</code></pre>
<blockquote>
  <p><strong>Note on the SLI index:</strong> the version suffix in <code>.slo-observability.sli-v*</code> depends on your Stack release (e.g., <code>v3.6</code> in Stack 9.3). Verify with <code>GET _cat/indices/.slo-observability.*?v</code> and adjust the pattern if your cluster uses a different version.</p>
</blockquote>
<p>The burn rate interpretation rules in the <code>description</code> are the most valuable part. A raw number like "burn rate 85%" means nothing to a developer without context. The tool description translates that into actionable guidance: "below 100% means sustainable, above 200% means delay non-critical changes."</p>
<h2 id="connectingtoyoureditorviamcp">Connecting to your editor via MCP</h2>
<p>With all three tools created in Agent Builder, they are automatically available through the <a href="https://www.elastic.co/docs/solutions/search/agent-builder/mcp-server">MCP server endpoint</a>. Configure your MCP client to connect.</p>
<h3 id="claudecodeconfiguration">Claude Code configuration</h3>
<p>Add the Elastic MCP server to your Claude Code settings:</p>
<pre><code>{
  "mcpServers": {
    "elastic-agent-builder": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://your-kibana-url/api/agent_builder/mcp",
        "--header",
        "Authorization: ApiKey your-base64-api-key"
      ]
    }
  }
}
</code></pre>
<h3 id="cursorconfiguration">Cursor configuration</h3>
<p>For Cursor, add the server in <strong>Settings &gt; MCP Servers</strong>:</p>
<pre><code>{
  "mcpServers": {
    "elastic-agent-builder": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://your-kibana-url/api/agent_builder/mcp",
        "--header",
        "Authorization: ApiKey your-base64-api-key"
      ]
    }
  }
}
</code></pre>
<p>Once connected, your editor's AI agent will discover all three tools automatically. You can verify by asking: "What Elastic tools do you have available?" The agent should list <code>get_endpoint_health</code>, <code>get_recent_deploys</code>, and <code>get_slo_status</code>.</p>
<p><strong>API key permissions:</strong> the API key needs the <a href="https://www.elastic.co/docs/solutions/search/agent-builder/kibana-api"><code>feature_agentBuilder.read</code></a> Kibana privilege and read access to the relevant indices (<code>traces-apm.*</code>, <code>observability-annotations</code>, <code>.slo-observability.*</code>). For production use, set the key expiry to 30-90 days and follow the principle of least privilege.</p>
<h2 id="thescenarioisitsafetomergethispr">The scenario: "Is it safe to merge this PR?"</h2>
<p>A developer on the team has a pull request that increases the timeout for the downstream <code>recommendations</code> service call from 2 seconds to 5 seconds in <code>opbeans-node</code>. Before merging, they ask the agent:</p>
<blockquote>
  <p><strong>Developer:</strong> "I'm about to merge PR #42, which increases the recommendations service timeout from 2s to 5s in opbeans-node. Is it safe to merge right now?"</p>
</blockquote>
<p>The agent begins its multi-signal reasoning chain. Here is what happens.</p>
<h3 id="step1theagentcallsget_endpoint_health">Step 1: the agent calls get_endpoint_health</h3>
<p>The agent checks the current health of the service:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt96106b17d8c1dfbf/6a85c85b27c5cd3f9f5f7394/image-03.png" alt="Agent calls get_endpoint_health and returns latency percentiles, error rate, and throughput" /></p>
<h3 id="step2theagentcallsget_recent_deploys">Step 2: the agent calls get_recent_deploys</h3>
<p>Next, it checks for recent deployments:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt87131c78a4a6a828/6a85c85e1aa1e11c92ff8cf9/image-04.png" alt="Agent calls get_recent_deploys and returns the recent deploy timeline for the service" /></p>
<h3 id="step3theagentcallsget_slo_status">Step 3: the agent calls get_slo_status</h3>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt33ce0ed438af263b/6a85c86168266647891eab97/image-05.png" alt="Agent calls get_slo_status and returns the current SLO burn rate" /></p>
<h3 id="theagentsresponse">The agent's response</h3>
<p>After correlating all three results, the agent produces a recommendation:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt55cae1213a8da2c9/6a85c8649d2b71f445f9391d/image-06.png" alt="Final agent recommendation correlating endpoint health, recent deploys, and SLO burn rate to flag the merge as risky" /></p>
<p>The agent pulled the current p99, checked recent deploys, and read the SLO burn rate. It combined those signals with the timeout change in the PR, flagged the merge as risky, and recommended next steps.</p>
<h2 id="conclusionwhentousemcptoolsinsteadofpingingansre">Conclusion: when to use MCP tools instead of pinging an SRE</h2>
<p>With Elasticsearch, Agent Builder, and MCP, a developer can answer questions like "is it safe to merge this PR?" from inside their editor, in seconds, without pinging an SRE. Elasticsearch holds the signals: traces, deploy markers, and SLO budgets. Agent Builder is where the platform team encodes how to read those signals: the thresholds, the warm-up windows, the correlation rules. MCP is what carries those tools into the developer's editor.</p>
<p>The query pulls the data. The description tells the agent how to read it. The platform engineer writes the runbook once, and every developer on the team gets to use it.</p>
<h2 id="nextstepsextendelasticagentbuildermcptoolstocicd">Next steps: extend Elastic Agent Builder MCP tools to CI/CD</h2>
<ul>
<li>Explore the <a href="https://www.elastic.co/docs/solutions/search/elastic-agent-builder">Elastic Agent Builder documentation</a> for more tool types and configuration options.</li>
<li>See <a href="https://www.elastic.co/observability-labs/blog/agentic-cicd-kubernetes-mcp-server">Agentic CI/CD: Kubernetes Deployment Gates with Elastic MCP Server</a> for extending this pattern into your CI/CD pipeline.</li>
<li>Check out <a href="https://www.elastic.co/observability-labs/blog/elastic-agent-skills-observability-workflows">Agent Skills for Elastic Observability</a> for a complementary approach using pre-packaged observability skills.</li>
</ul>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/mcp-tools-elastic-agent-builder</link>
    <guid isPermaLink="false">mcp-tools-elastic-agent-builder</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[APM]]></category>
    <dc:creator><![CDATA[Jeffrey Rengifo]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5c071b863a97c979/6a85c867abdc29d3a612248a/header.png" length="0" type="image/png"/>
    <pubDate>Thu, 04 Jun 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Kubernetes observability: MCP specialist agents for safer EKS triage]]></title>
    <description><![CDATA[Scope a specialist EKS MCP agent for cluster checks while the Elastic AI Agent triages; fix a service misconfiguration using the specialist agent in a few prompts.]]></description>
    <content:encoded><![CDATA[<p>Elastic Observability shows you which services and edges in your service map are failing. You may still need to access details like live kubernetes service specs and containerPort to targetPort mapping, which still reside at the cluster. They can be made available in Elasticsearch via EKS MCP. The fix is to equip your Elastic AI Agent with a focused set of EKS tools, through a specialist agent. The Elastic AI agent keeps its stock tools and remains the only surface your SREs interact with. A specialist K8s Troubleshooter agent carries ~20 EKS MCP tools, scoped to a single IAM identity and Kubernetes RBAC. They hand off through an <a href="https://www.elastic.co/docs/explore-analyze/workflows">Elastic Workflow</a> that calls the <a href="https://www.elastic.co/docs/explore-analyze/ai-features/elastic-agent-builder">Agent Builder</a> <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/kibana-api#chat-and-conversations">converse</a> API, so the boundary between observability reasoning and cluster actions is callable, reviewable, and auditable. To prove it works, we break targetPort on product-catalog in <a href="https://github.com/elastic/opentelemetry-demo">elastic-opentelemetry-demo</a> and recover it in 4 prompts on a single thread.</p>
<h2 id="problemcontext">Problem context</h2>
<p>Outages often show up as correlated errors on multiple services like checkout, frontend, and recommendation in Elasticsearch.
That pattern can mean a shared dependency, or it can mean Kubernetes is misleading callers: wrong targetPort, empty Endpoints, or pods that never become ready.
Observability tools like Elasticsearch tell you <em>that</em> callers fail and <em>which</em> edges look wrong.
They generally do not fetch the live Service spec or compare containerPort to targetPort for you.</p>
<p>The Elastic AI Agent in Agent Builder is built for APM, logs, metrics, dependencies, and service maps.
It is not a full EKS operations console.
You could attach all EKS MCP tools to the same agent, but long tool lists increase wrong-tool calls, slow planning, and widen blast radius if a prompt accidentally asks for mutating actions.</p>
<h2 id="solutionoverview">Solution overview</h2>
<p>Use <strong>Elastic AI Agent</strong> as the only agent your SRE chats with.
It reasons from Elasticsearch first.
When evidence points to cluster config, it calls a workflow tool that invokes the <strong>K8s Troubleshooter agent</strong> over <code>/api/agent_builder/converse</code> with a structured <code>user_prompt</code>.
The <strong>K8s Troubleshooter agent</strong> carries only the EKS MCP tools, and cluster access stays scoped to one specialist identity, IAM, and RBAC. You can audit like any other integration.</p>
<p>Elasticsearch reaches EKS through an in-cluster bridge, exposed to Kibana as an MCP connector with a shared secret.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt00eb659814dcf87b/6a7f05ce05b7b5561e18b681/solution_overview.png" alt="Solution Overview" /></p>
<h2 id="beforeyoustart">Before you start</h2>
<p>You need:</p>
<ul>
<li>An EKS cluster with kubectl configured.</li>
<li>An Elasticsearch 9.3+ deployment, an OTLP endpoint, an Elasticsearch API key, Agent Builder, and rights to create agents, MCP tools, and Workflows.</li>
<li>An AI Connector in Elasticsearch for your chosen LLM.</li>
<li>Budget two to four hours the first time you run these steps.</li>
</ul>
<h2 id="implementationwalkthrough">Implementation walkthrough</h2>
<h3 id="step1deploytheelasticopentelemetrydemoandshiptelemetrytoelasticobservability">Step 1: deploy the Elastic OpenTelemetry Demo and ship telemetry to Elastic Observability</h3>
<p>Follow <a href="https://github.com/elastic/opentelemetry-demo"><strong>elastic/opentelemetry-demo</strong></a> for Kubernetes and deploy elastic-opentelemetry-demo application to your EKS cluster.
Configure your Elasticsearch OTLP endpoint and API key, confirm workloads are running, and note the namespace.
In Kibana (APM, Logs, or Service Map), confirm data for checkout, frontend, recommendation, and product-catalog.</p>
<p>If you see healthy traffic to <code>product-catalog</code>, you are ready for the failure drill.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt92e83f13b69e3bc4/6a7f05d1e3a21975f399f1a4/04-service-map-or-errors.png" alt="Healthy Elastic Observability service map for demo services." /></p>
<h3 id="step2runtheeksmcpbridgeregistertheconnectorandbulkimporteksmcptools">Step 2: run the EKS MCP bridge, register the connector, and bulk import EKS MCP tools</h3>
<p>Complete the steps in <a href="https://github.com/ramp-km/aws-eks-mcp-setup/blob/main/README.md"><strong>aws-eks-mcp-setup</strong></a> end to end.
The flow you would be following is: </p>
<ol>
<li>Build and push the EKS MCP Bridge image</li>
<li>Create IAM policies</li>
<li>Create IRSA Service Account</li>
<li>Map IRSA role in aws-auth and apply Kubernetes RBAC</li>
<li>Deploy the bridge with a strong API_ACCESS_TOKEN to the EKS cluster</li>
<li>Connect Elastic Agent Builder with EKS MCP</li>
</ol>
<p>A green MCP connector proves Kibana can reach the bridge.</p>
<p>For production, restrict LoadBalancer security groups to known Elasticsearch egress, prefer TLS on real paths, store tokens in Kubernetes Secrets, and use read-only MCP modes when you only diagnose.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt1bf20bb14fb36532/6a7f05d477b034a7333ff22b/05-eks-mcp.png" alt="MCP connector pointed at the EKS bridge." /></p>
<h3 id="step3createak8stroubleshooteragentwithekstoolsonly">Step 3: create a <strong>K8s Troubleshooter agent</strong> with EKS tools only</h3>
<p>In Agent Builder, create an agent with agent ID <code>k8s_troubleshooter</code>, display name <code>K8s Troubleshooter</code>, and custom instructions from <a href="https://github.com/ramp-km/blogs/blob/main/Custom%20K8s%20Troubleshooter/k8s_troubleshooter_agent.md">k8s_troubleshooter_agent</a>.
Attach only EKS MCP tools to this agent.</p>
<p>Chat directly with <strong>K8s Troubleshooter agent</strong> once and confirm a harmless read (for example list pods in the demo namespace).</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5c03fc63aa35b190/6a7f05d7c2e914cf690168ff/02-k8s-troubleshooter-agent.png" alt="K8s Troubleshooter agent" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltb8c1ac20d8b1e65c/6a7f05db6693f8f101663c85/02-k8s-troubleshooter-agent-2.png" alt="K8s Troubleshooter agent with EKS MCP tools attached." /></p>
<h3 id="step4elasticsearch93onlyclonetheobservabilityagentwithoutekstools">Step 4 (<code>Elasticsearch 9.3 only</code>): clone the Observability Agent without EKS tools</h3>
<p>Clone the bundled <code>Observability Agent</code> (Agent Builder → Manage Agents → Observability Agent → Clone) and name it <strong>Elastic AI Agent</strong> so it keeps the stock Observability system instructions and tools.
Do not attach EKS MCP tools to this copy.</p>
<p>The parent <strong>Elastic AI Agent</strong> stays an observability-first interface for whoever chats with it.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt7a3f591e0527edc7/6a7f05dfe88c65e1bb00b3b8/01-observability-agent-v2.png" alt="Observability Agent v2 tools and instructions." /></p>
<h3 id="step5createtheworkflowandmakeitacallabletool">Step 5: create the workflow and make it a callable tool</h3>
<p><a href="https://www.elastic.co/docs/explore-analyze/workflows/get-started/build-your-first-workflow">Create</a> a new Elastic Workflow by importing <a href="https://github.com/ramp-km/blogs/blob/main/Custom%20K8s%20Troubleshooter/k8s_troubleshooter_workflow.yaml">k8s_troubleshooter_workflow.yaml</a> and enable it.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt24957065ecb6477b/6a7f05e233fa8a71032023ca/05-workflow.png" alt="Kibana Workflows editor: k8s_troubleshooter workflow YAML enabled." /></p>
<p>Create a new tool in Agent Builder of type <code>Workflow</code>. Select the <code>k8s_troubleshooter</code> workflow, set tool ID <code>custom.k8s_troubleshooter</code>, and set the description to <code>Tool to triage and troubleshoot kubernetes related issues</code> (or equivalent wording your team standardizes on).</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf334d5d0b642e7fd/6a7f05e52f00b2c209efe8ce/05-workflow_tool_k8s_troubleshooter.png" alt="Agent Builder: Workflow tool wired to k8s_troubleshooter with custom tool id and description." /></p>
<p>On <strong>Elastic AI Agent</strong>, attach the <code>custom.k8s_troubleshooter</code> workflow tool that you just created.</p>
<p>The parent’s tool list should show the <code>custom.k8s_troubleshooter</code> workflow tool attached, and <strong>K8s Troubleshooter agent</strong> should still answer when invoked on its own.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt9b029c737e738946/6a7f05e873d9bd41d829d874/03-workflow-tool-parent-agent.png" alt="Workflow registered as a tool on the parent agent." /></p>
<h3 id="step6injecttheproductcatalogservicemisconfiguration">Step 6: inject the product-catalog service misconfiguration</h3>
<p>Save the original <code>targetPort</code>, then patch to a wrong value (for example 9999).</p>
<pre><code>kubectl get svc -A | grep product-catalog
kubectl get svc product-catalog -n YOUR_NAMESPACE -o yaml
</code></pre>
<pre><code>kubectl patch svc product-catalog -n YOUR_NAMESPACE --type='json' \
  -p='[{"op": "replace", "path": "/spec/ports/0/targetPort", "value": 9999}]'
</code></pre>
<pre><code>kubectl rollout restart deployment/checkout deployment/recommendation deployment/frontend -n YOUR_NAMESPACE
</code></pre>
<p>Callers still resolve Endpoints, but traffic lands on a port the container does not listen on, so Elasticsearch shows downstream errors on checkout, frontend, and recommendation.</p>
<p>You now have symptoms in Elasticsearch and a clear kubernetes cluster-side fault.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltb7371f0ca6cee50d/6a7f05ebb4377063a24d69dd/06-demo-services-service-map-or-errors.png" alt="Elastic Observability service map or error view after the misconfiguration." /></p>
<h3 id="step7runtwopromptsontheparentagent">Step 7: run two prompts on the parent agent</h3>
<p>Use AI Agent chat on <strong>Elastic AI Agent</strong>, not on the specialist.</p>
<p><code>Note:</code> If you are using Elasticsearch 9.3, make sure you use the <strong>Elastic AI Agent</strong> that you created, not the stock agent.</p>
<p>Prompt 1: <em>Why are failure transactions increasing for services like checkout and frontend?</em></p>
<p>Expect <strong>Elastic AI Agent</strong> to narrow the issue to the product-catalog service and note possible configuration issues as one of the probable causes, without yet invoking the <code>custom.k8s_troubleshooter</code> tool.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt2bf7243ff1f82610/6a7f05ee42a117b6d895bbe2/07-ai-agent-product-catalog-issues.png" alt="Elastic AI Agent identifying product catalog issues" /></p>
<p>Prompt 2: <em>Why is product-catalog service not servicing any requests in (insert your k8s cluster name) cluster? Is there any misconfiguration in the service?</em></p>
<p>Expect <strong>Elastic AI Agent</strong> to call the <code>custom.k8s_troubleshooter</code> tool, which invokes the <strong>K8s Troubleshooter agent</strong> and reads Service, Endpoints, and pods, compares <code>targetPort</code> to <code>containerPort</code>, and explains the mismatch with evidence. Expect to also see the recommended remediation steps.</p>
<p><code>Note:</code> depending on the LLM you are using, the response from the agents may vary.</p>
<p>You get agent-led triage in Elastic Observability and cluster-grounded confirmation in the same thread, along with recommended remediation steps.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltaaa6b9e3ffc40882/6a7f05f1e02fac3bf25d62e0/07-ai-agent-chat-custom-k8s-troubleshooter.png" alt="Agent Builder chat on Observability Agent v2 invoking the K8s Troubleshooter agent workflow." /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt4e0151dfb52c819e/6a7f05f405b7b5ead618b6b6/07-ai-agent-chat-port-misconfiguration.png" alt="Agent Builder chat on Observability Agent v2 identifying port misconfiguration." /></p>
<h3 id="step8patchtheproductcatalogservice">Step 8: patch the product-catalog service</h3>
<p>Prompt 3: <em>Patch the product-catalog service in (your EKS cluster name) cluster to have 8080 as the targetPort</em></p>
<p>Expect <strong>Elastic AI Agent</strong> to call the <code>custom.k8s_troubleshooter</code> tool, which invokes the <strong>K8s Troubleshooter agent</strong> and patches the product-catalog service.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltaea2e5aa61e128e2/6a7f05f833fa8ab2262023de/08-ai-agent-chat-patch-product-catalog.png" alt="Agent Builder chat on Observability Agent v2 patching product-catalog service." /></p>
<p>Prompt 4: <em>Rollout restart upstream services of product-catalog service</em></p>
<p>Expect <strong>Elastic AI Agent</strong> to identify all upstream services of product-catalog and call the <code>custom.k8s_troubleshooter</code> tool, which invokes the <strong>K8s Troubleshooter agent</strong> to roll out restarts for upstream services such as checkout, frontend, and recommendation.</p>
<p>Confirm product-catalog and upstream services recover in Elasticsearch.</p>
<h2 id="validationandtradeoffs">Validation and trade-offs</h2>
<p>You validated that <strong>Elastic AI Agent</strong> stays the main surface, that ~20 EKS tools live on one specialist <strong>K8s Troubleshooter agent</strong>, and that the Workflow plus Agent Builder <code>converse</code> API keeps a clear boundary for audits and reviews.</p>
<p>Trade-offs: MCP bridges need ongoing token and network hygiene, and you should keep mutating tools off or tightly RBAC-scoped until you accept the risk.</p>
<h2 id="frequentlyaskedquestions">Frequently asked questions</h2>
<h3 id="whyiselasticaiagentnottriagingtheissuesasexplainedinthisarticle">Why is Elastic AI Agent not triaging the issues as explained in this article?</h3>
<p>There could be two primary reasons. (A) If you are on Elasticsearch 9.3, make sure you chat on the Elastic AI Agent that you created, and not on the stock agent. (B) Make sure to use one of the LLM models rated <code>Excellent</code> or <code>Great</code> in <a href="https://www.elastic.co/docs/solutions/observability/ai/llm-performance-matrix">Large language model performance matrix for Observability</a></p>
<h3 id="whydomyserviceslookunhealthyinelasticsearchwhentheappcodedidnotchange">Why do my services look unhealthy in Elasticsearch when the app code did not change?</h3>
<p>Kubernetes can mislead HTTP clients: a bad Service <code>targetPort</code>, empty Endpoints, or pods that never become ready can fan out as errors on multiple edges in traces and service maps. Elastic Observability shows which dependencies fail; confirming the live Service spec usually needs cluster access.</p>
<h3 id="howdoigivekubernetesaccesstoelasticaiagentwithoutputtingeveryekstoolonit">How do I give Kubernetes access to Elastic AI Agent without putting every EKS tool on it?</h3>
<p>Run two Agent Builder agents: keep the stock tools on the parent (Elastic AI Agent), and attach only EKS MCP tools to a specialist agent(K8s Troubleshooter agent). Invoke the specialist through a workflow that calls the Agent Builder converse API so the boundary is explicit and auditable.</p>
<h3 id="whychainagentswithelasticworkflowsinsteadofonelongsystemprompt">Why chain agents with Elastic Workflows instead of one long system prompt?</h3>
<p>Workflows give a callable, reviewable step between observability reasoning and cluster actions, which helps with governance and keeps the parent agent’s tool list short. Long unified tool lists often increase mistaken tool use and broaden blast radius if a prompt requests a mutating operation.</p>
<h3 id="howdoesthiscomparetokubectloracloudconsoleforincidentresponse">How does this compare to kubectl or a cloud console for incident response?</h3>
<p>Consoles and kubectl stay the source of truth for live object state. This pattern automates the handoff from Elastic Observability signals to those checks through MCP, while still relying on IAM and Kubernetes RBAC on the specialist identity.</p>
<h3 id="whatarethemainlimitationsorrisksofaneksmcpbridgewithagentbuilder">What are the main limitations or risks of an EKS MCP bridge with Agent Builder?</h3>
<p>MCP bridges need token rotation, network restrictions, and TLS discipline on real paths. Mutating EKS tools should stay off or tightly RBAC-scoped until you accept operational risk.</p>
<h3 id="whydoweneedaneksmcpbridge">Why do we need an EKS MCP bridge?</h3>
<p>The managed EKS MCP server authenticates via AWS SigV4 through a stdio-based proxy (mcp-proxy-for-aws). Elastic's MCP connector requires an HTTP/SSE endpoint. The bridge pod runs mcp-proxy to expose the stdio proxy as an SSE/HTTP endpoint.</p>
<h3 id="canireusethesamelayoutongkeaksorselfmanagedkubernetes">Can I reuse the same layout on GKE, AKS, or self-managed Kubernetes?</h3>
<p>Yes. The separation principle is the same: observability data in Elasticsearch plus a specialist agent with cluster-scoped tools and a workflow-mediated handoff. Swap the MCP server or bridge, adjust RBAC, and parameterize cluster name or region in workflow inputs where needed.</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/eks-agent-builder-mcp-kubernetes-troubleshooting</link>
    <guid isPermaLink="false">eks-agent-builder-mcp-kubernetes-troubleshooting</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[OpenTelemetry]]></category>
    <category><![CDATA[Kubernetes]]></category>
    <category><![CDATA[AI]]></category>
    <dc:creator><![CDATA[Ramprasad KM]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt32b449a412d139b6/6a7f05fbc2cc09008c24922b/header.png" length="0" type="image/png"/>
    <pubDate>Mon, 11 May 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Connecting Cursor to Production Logs via the Elastic MCP Server]]></title>
    <description><![CDATA[Learn how to connect Cursor to your Elastic APM data using the Elastic Agent Builder MCP server, so you can debug production errors and make UI decisions backed by real usage data without leaving your editor.]]></description>
    <content:encoded><![CDATA[<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li><p>Elasticsearch 9.3+ (or Elastic Cloud Serverless)</p></li>
<li><p>Elasticsearch API KEY and Kibana URL</p></li>
<li><p>An application instrumented with Elastic APM: the <a href="https://www.elastic.co/guide/en/apm/agent/rum-js/current/index.html">RUM agent</a> for frontend interactions (populates <code>traces-apm-*</code>) and the <a href="https://www.elastic.co/docs/reference/apm-agents">APM agent</a> for backend errors (populates <code>logs-apm.error-*</code></p></li>
<li><p><a href="https://cursor.com/home">Cursor</a> (version 2.6+) installed</p></li>
</ul>
<h2 id="theproblemwithtwoworlds">The problem with two worlds</h2>
<p>Application logs and code are two separate worlds that don't talk to each other. If you want to apply log insights into the application you have to analyze the logs, and then come back to the editor and apply your findings.</p>
<p>The <a href="https://modelcontextprotocol.io/">Model Context Protocol (MCP)</a> changes this. MCP is an open standard that lets AI clients like Cursor connect to external tools and data sources through a standardized interface. Instead of your IDE only knowing about your local code, it can also talk to your Elasticsearch cluster, query your APM data, and reason about production behavior alongside your source files.</p>
<p>Elastic ships a <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server">built-in MCP server</a> as part of <a href="https://www.elastic.co/docs/explore-analyze/ai-features/elastic-agent-builder">Agent Builder</a>. You define tools in Kibana, expose them via the MCP endpoint, and any MCP-compatible client can call them. Cursor supports MCP natively, which means you can set this up in minutes.</p>
<h2 id="whatwerebuilding">What we're building</h2>
<p>We're working with an eCommerce search app instrumented with Elastic APM. The RUM JS agent tracks filter click interactions from the browser, stored in <code>traces-apm-default</code>. The Node.js APM agent captures backend errors, stored in <code>logs-apm.error-default</code>.</p>
<p>Two situations come up during development:</p>
<ul>
<li><p><strong>Use case 1</strong>: The product team wants to simplify the search page. There are six filters but we don't know which ones users actually click. We need usage data to decide which to keep.</p></li>
<li><p><strong>Use case 2</strong>: Users report intermittent 500 errors on search. The errors are not constant and started two days ago. We need the error details to find the root cause.</p></li>
</ul>
<p>To bring that data into Cursor, we'll build two Agent Builder tools in Kibana and connect them via the <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server">Elastic Agent Builder MCP Server</a>:</p>
<ul>
<li><p><code>get_filter_usage</code>: queries <code>traces-apm-default</code> for filter click events and returns a usage breakdown by filter name</p></li>
<li><p><code>get_recent_errors</code>: queries <code>logs-apm.error-default</code> for the most recent error groups for a given service, including the exception message and stack trace culprit</p></li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt62d3a8324299ca7a/6a7f080dc2cc09675c24935f/architecture.png" alt="Architecture diagram showing Cursor connecting to the Elastic Agent Builder MCP server, which queries Elasticsearch APM data" /></p>
<p>For a deeper look at the overall architecture, see the <a href="https://www.elastic.co/search-labs/blog/agent-builder-mcp-reference-architecture-elasticsearch">Agent Builder reference guide</a>.  </p>
<h2 id="settinguptheelasticmcpservernbspnbsp">Setting up the Elastic MCP Server  </h2>
<h3 id="step1createtheagentbuildertools">Step 1: Create the Agent Builder tools</h3>
<p>We create both tools via the <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/kibana-api">Kibana Agent Builder API</a>. Each tool is an ES|QL query with a name and description that Cursor uses to decide when to call it. The full implementation of the tools is in the following <a href="https://github.com/elastic/elasticsearch-labs/blob/main/supporting-blog-content/cursor-production-logs-elastic-mcp-server/notebook.ipynb"><code>notebook</code></a>.</p>
<h4 id="tool1get_filter_usage">Tool 1: get_filter_usage</h4>
<p>The product team needs to know which filters users actually click before deciding which ones to remove. The query reads RUM interaction events from <code>traces-apm-default</code> and groups them by filter name:</p>
<pre><code>    {
    &amp;nbsp;&amp;nbsp;"id": "get_filter_usage",
    &amp;nbsp;&amp;nbsp;"type": "esql",
    &amp;nbsp;&amp;nbsp;"description": "Returns the usage count for each search filter in the ecommerce-search-ui service, sorted by most used first.",
    &amp;nbsp;&amp;nbsp;"configuration": {
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"query": "FROM traces-apm-default | WHERE service.name == \"ecommerce-search-ui\" | WHERE transaction.type == \"user-interaction\" | WHERE labels.filter_name IS NOT NULL | STATS count = COUNT(*) BY labels.filter_name | SORT count DESC"
    &amp;nbsp;&amp;nbsp;}
    }
</code></pre>
<h4 id="tool2get_recent_errors">Tool 2: get_recent_errors</h4>
<p>For the error debugging use case, we need to surface the most frequent recent errors for a service, along with where in the code they originate. <code>STATS ... BY</code> groups errors by their fingerprint (<code>grouping_key</code>), surfaces the exception message and the line of code that caused it (<code>culprit</code>), and ranks by frequency:</p>
<pre><code>    {
    &amp;nbsp;&amp;nbsp;"id": "get_recent_errors",
    &amp;nbsp;&amp;nbsp;"type": "esql",
    &amp;nbsp;&amp;nbsp;"description": "Returns the most frequent error groups for ecommerce-search-ui, ranked by occurrence count, with the exception message and code location.",
    &amp;nbsp;&amp;nbsp;"configuration": {
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"query": "FROM logs-apm.error-default | WHERE service.name == \"ecommerce-search-ui\" | WHERE processor.name == \"error\" | STATS count = COUNT(*) BY error.grouping_key, error.exception.0.message, error.culprit | SORT count DESC | LIMIT 5"
    &amp;nbsp;&amp;nbsp;}
    }
</code></pre>
<p>Both tools are created with <code>POST /api/agent_builder/tools</code>. You can learn more about the Kibana API endpoints for Elastic Agent Builder <a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/kibana-api">here</a>.</p>
<h3 id="step2connecttocursor">Step 2: Connect to Cursor</h3>
<p>Open <code>~/.cursor/mcp.json</code> and add the Elastic server. For detailed information, see the Cursor <a href="https://cursor.com/docs/mcp#using-mcpjson">documentation</a>. The Agent Builder MCP endpoint uses Server-Sent Events (SSE) transport, so we connect via <code>mcp-remote</code>, a lightweight bridge that Cursor invokes as a local process:</p>
<pre><code>    {
    &amp;nbsp;&amp;nbsp;"mcpServers": {
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"elastic-agent-builder": {
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"command": "npx",
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"args": [
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"-y",
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"mcp-remote",
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"https://YOUR_KIBANA_URL/api/agent_builder/mcp",
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"--header",
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Authorization: ApiKey YOUR_API_KEY"
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
    &amp;nbsp;&amp;nbsp;}
    }
</code></pre>
<p>Replace <code>YOUR_KIBANA_URL</code> and <code>YOUR_API_KEY</code> with your values.</p>
<p>Restart Cursor, open the Agent panel, and confirm that <code>get_filter_usage</code> and <code>get_recent_errors</code> appear in the available tools list. </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt26bfbf5b85c381ad/6a7f0810c2cc099f19249363/cursor-mcp-tools.png" alt="Cursor MCP panel showing the get_filter_usage and get_recent_errors tools available from the Elastic Agent Builder server" /></p>
<h2 id="usecase1datadrivenuioptimization">Use case 1: Data-driven UI optimization</h2>
<p>The eCommerce search page has six filters: category, manufacturer, price range, customer gender, day of week, and region. The product team wants to simplify the UI by removing filters that users don't use as much. Rather than guessing, we ask Cursor to check.</p>
<p>When you type a prompt in Cursor's Agent panel, the model sees the name and description of every connected MCP tool. It matches your intent to the best-fitting tool and calls it automatically. This is why the <code>description</code> field we set in Step 1 matters: it's what the model reads to decide which tool answers your question. If you are interested in learning more about Cursor’s MCP tools management, read the following <a href="https://cursor.com/docs/mcp#using-mcp-in-chat">documentation</a>.</p>
<p>Open a Cursor chat and ask: "Show me how often each search filter is used." Cursor calls the tool and returns something like:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt0cc46e50f9d94970/6a7f0813bd21980745757eda/filter-usage-chart.png" alt="Filter usage breakdown returned by the get_filter_usage tool" /></p>
<p>The category and manufacturer filters get most of the clicks. The bottom three filters (<code>customer_gender</code>, <code>day_of_week</code>, <code>region</code>) are rarely used.</p>
<p>Ask Cursor to act on this: <strong><em>"Based on this data, simplify the SearchFilters component. Keep the top 3 filters visible, collapse the others under a 'More filters' toggle."</em></strong></p>
<p>Cursor opens <code>src/components/SearchFilters.jsx</code>, reads the current implementation, and proposes the change.</p>
<p>Before: </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt8af7e161637b0151/6a7f0816e3a219301899f2a4/search-filters-before.png" alt="SearchFilters component before the change, showing all six filters" /></p>
<p>After: </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt61f5bd24ca30c19e/6a7f0819ead8ece767baa672/search-filters-after.png" alt="SearchFilters component after the change, showing the top three filters with the rest collapsed under a More filters toggle" /></p>
<p>The entire loop took one chat prompt. The decision was backed by production data, not a team discussion about what users probably care about.</p>
<h2 id="usecase2productionerrordebugging">Use case 2: Production error debugging</h2>
<p>A bug report comes in: intermittent 500 errors on the search endpoint. The errors started appearing two days ago but they're not constant. The developer opens Cursor and asks: "Show me what errors ecommerce-search-ui is throwing."</p>
<p>Cursor calls the tool and returns the error groups:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt67bae433977e721a/6a7f081c227b1c4eeb59841e/recent-errors.png" alt="Most recent error groups returned by the get_recent_errors tool" /></p>
<p>The error message is explicit: <code>category</code> is a text field and can't be used in terms of aggregation. The correct field is <code>category.keyword</code>. </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt37f176d0f26a2fb9/6a7f081f3cab1cfd580e4662/error-fix-diff.png" alt="Cursor proposing the fix that changes category to category.keyword in the ES|QL query" /></p>
<p>With APM data available alongside your code, the debugging session becomes a conversation: you describe the symptom, the agent pulls the relevant logs, and you work through what's happening together. You can ask follow-up questions, check whether the error correlates with a recent deployment, or ask which endpoints are most affected, all within the same context where you'll make the fix. If you want to go further, Elastic also provides <a href="https://www.elastic.co/docs/solutions/observability/ai/agent-builder-observability">pre-built observability tools in Agent Builder</a> that you can use alongside custom tools like the ones we created here. For a complementary approach to AI-driven observability, see <a href="https://www.elastic.co/observability-labs/blog/ai-observability-web-agents-openlit">how to monitor web AI agents with OpenLIT and Elastic</a>.</p>
<h2 id="conclusion">Conclusion</h2>
<p>What we covered:</p>
<ul>
<li><p>How to create Agent Builder tools in Kibana that wrap APM data queries</p></li>
<li><p>How to connect the Elastic Agent Builder MCP Server to Cursor in three lines of JSON</p></li>
<li><p>Using production telemetry to make a UI decision backed by real usage data</p></li>
<li><p>Debugging a production error from the same window where you fix it</p></li>
</ul>
<p>These two use cases are a starting point. The same pattern works for any data you have in Elasticsearch: performance metrics, A/B test results, audit logs, feature flag usage, user session data. Define the Agent Builder tool, connect it via MCP, and it becomes part of your development context in Cursor. For other examples of what's possible, see <a href="https://www.elastic.co/observability-labs/blog/mcp-elastic-synthetics">automating synthetic monitoring with MCP</a> and <a href="https://www.elastic.co/observability-labs/blog/agentic-cicd-kubernetes-mcp-server">agentic CI/CD deployment gates</a>.</p>
<h2 id="nextsteps">Next steps</h2>
<ul>
<li><p><a href="https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server">Elastic Agent Builder MCP server documentation</a></p></li>
<li><p><a href="https://modelcontextprotocol.io/">Model Context Protocol specification</a></p></li>
<li><p><a href="https://www.elastic.co/docs/explore-analyze/ai-features/elastic-agent-builder">Elastic Agent Builder overview</a></p></li>
</ul>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/elastic-mcp-server-cursor-production-logs</link>
    <guid isPermaLink="false">elastic-mcp-server-cursor-production-logs</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <category><![CDATA[APM]]></category>
    <dc:creator><![CDATA[Jeffrey Rengifo]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt995e6ed7b699e8fa/6a7f08226c6eacad3ef13f31/header.png" length="0" type="image/png"/>
    <pubDate>Wed, 29 Apr 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Elastic Ramen: A CLI harness for SRE investigation and remediation]]></title>
    <description><![CDATA[Exploring Elastic Ramen, a CLI harness that brings Agent Builder conversations, skills, and tools into the terminal so engineers can move from investigation to remediation in a single thread.]]></description>
    <content:encoded><![CDATA[<p>Observability tools tell you what went wrong.
They rarely help you fix it.
When responding to an incident, engineers split their time across Kibana, Slack, and the terminal.
At each step, the AI assistant stays behind in the previous surface, and the investigation starts over from scratch.</p>
<p><strong>Elastic Ramen</strong> (<strong>R</strong>oot-cause <strong>A</strong>nalysis &amp; <strong>M</strong>onitoring <strong>En</strong>gine) bridges that gap.
It is a local CLI agent that connects directly to <a href="https://www.elastic.co/search-labs/blog/elastic-ai-agent-builder-context-engineering-introduction">Elastic Agent Builder</a>, carrying the same conversation, skills, and Elastic context into the terminal.
Ramen operates directly in the environment where fixes actually happen. No handoff. No re-auth. No translation layer.
Ramen is open source and available at <a href="https://github.com/elastic/elastic-ramen">elastic/elastic-ramen</a>.</p>
<div>
    
</div>
<h2 id="whytheterminalmatters">Why the terminal matters</h2>
<p>Agent Builder gives engineers a strong environment for querying observability data.
Ramen takes that same capability to the two workflows that need it most.</p>
<p><strong>Onboarding.</strong>
Configuring collectors, managing credentials, and validating data flow all happen in the shell.
A local agent can guide that work right where the credentials and tools already live.</p>
<p><strong>Mitigation.</strong>
The actual fix, whether restarting pods, scaling deployments, or rolling back releases, requires <code>kubectl</code>, <code>gcloud</code>, <code>git</code>, or internal scripts.
A CLI agent runs on hardware the team already trusts, using the credentials already present on the engineer's machine.</p>
<h2 id="howramenworks">How Ramen works</h2>
<p>Ramen is a CLI client for Agent Builder.
It is not a separate assistant with its own memory.
It connects your local environment to the same conversations, skills, and tools you already use in Kibana through a simple authentication flow.</p>
<p>On first launch, Ramen connects to your Elastic deployment and gives you everything out of the box:</p>
<ul>
<li>LLM inference through the Kibana gateway, using your existing AI connector</li>
<li>Native Kibana tools for managing workflows and agents</li>
<li>The Agent Builder MCP server for ES|QL queries and documentation search</li>
<li>An embedded <code>elastic</code> CLI for cluster health, data streams, and SLOs</li>
<li>Built-in skills for root cause analysis and SLO management</li>
</ul>
<p>The agent carries your investigation history across surfaces, so you never re-explain the incident when moving from the UI to the CLI.
Terminal interactions sync back to Elastic automatically, building a searchable record of operational knowledge for the team.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltac16bc2fa6b8d5c4/6a85cacd80984c13d1668fd6/architecture-flow.jpg" alt="Diagram showing the Ramen CLI connecting to Agent Builder, which accesses Elastic Stack data, with conversations syncing back." /></p>
<h2 id="getstarted">Get started</h2>
<p>You need an Elastic Observability Serverless project.
In Kibana, open <strong>Stack Management</strong>, then <strong>Advanced Settings</strong>, or go directly to <code>https://&lt;your-kibana-url&gt;/app/management/kibana/settings?query=ramen</code>.
Enable <strong><code>elasticRamen:enabled</code></strong>, then install the CLI:</p>
<pre><code>npm i -g @elastic/ramen
bun add -g @elastic/ramen
</code></pre>
<p>You can also use the install script or download a pre-built binary from <a href="https://github.com/elastic/elastic-ramen/releases">GitHub Releases</a>:</p>
<pre><code>curl -fsSL https://raw.githubusercontent.com/elastic/elastic-ramen/dev/install | bash
</code></pre>
<p>Once installed, connect to your deployment:</p>
<pre><code>elastic-ramen --kibana-base=https://&lt;your-kibana-url&gt;
</code></pre>
<p>Ramen opens a browser auth flow, generates credentials, and stores them locally.
After that, it reconnects automatically.
Start a conversation in Agent Builder and resume it in the terminal with <code>/kibana-conversations</code>.</p>
<h2 id="whatisnext">What is next</h2>
<p>Ramen is the first surface of a multi-surface agent system.
The same architecture extends to every surface engineers already use:</p>
<ul>
<li><strong>Space-scoped collaboration</strong> for shared agent context during outages</li>
<li><strong>Slack, Teams, Jira, PagerDuty</strong> integration: start from an alert, collaborate in chat, mitigate in the terminal, one thread</li>
<li><strong>Shared memory</strong>: progressively distill conversations into durable operational context that improves future investigations</li>
</ul>
<p>Beyond incident response, the same model applies to deployment risk analysis, production debugging, CI/CD policy checks, and cost anomaly investigation.</p>
<h2 id="summary">Summary</h2>
<p>Ramen connects signal to action: Elastic data and Agent Builder context, plus the ability to act with local tools, in one continuous thread.
Elastic as the persistent context layer, every surface you use as the interface.</p>
<p>Try it out on <a href="https://github.com/elastic/elastic-ramen">GitHub</a> and let us know what you think.</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/elastic-ramen-agent-builder-cli</link>
    <guid isPermaLink="false">elastic-ramen-agent-builder-cli</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[LLM Observability]]></category>
    <dc:creator><![CDATA[Joe Reuter,Vignesh Shanmugam]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt130656ed78a12658/6a85cad018249c018f18f7b9/cover.jpg" length="0" type="image/jpeg"/>
    <pubDate>Mon, 27 Apr 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[How to Troubleshoot Kubernetes Pod Restarts & OOMKilled Events with Agent Builder]]></title>
    <description><![CDATA[Learn how to immediately troubleshoot Kubernetes pod restarts and OOMKilled events with Elastic Agent Builder. We’ll show how to detect, analyze, and remediate failures.]]></description>
    <content:encoded><![CDATA[<h2 id="initialsummary">Initial Summary</h2>
<ul>
<li>Detect Kubernetes pod restarts and OOMKill events using Elastic Agent Builder</li>
<li>Analyze CPU and memory pressure using ES|QL over Kubernetes metrics</li>
<li>Generate troubleshooting summaries and remediation guidance</li>
</ul>
<p>This article explains how to use <a href="https://www.elastic.co/search-labs/blog/elastic-ai-agent-builder-context-engineering-introduction">Elastic Agent Builder</a> to automatically detect, analyze, and remediate Kubernetes pod failures caused by resource pressure (CPU and memory), with a focus on pods experiencing frequent restarts and OOMKilled events. Elastic Agent Builder lets you quickly create precise agents that utilize all your data with powerful tools (such as ES|QL queries), chat interfaces, and custom agents.</p>
<h2 id="introductionwhatistheelasticagentbuilder">Introduction: What is the Elastic Agent Builder?</h2>
<p>Elastic has an AI Agent embedded that you can use to get more insights from all of the logs, metrics and traces that you’ve ingested. While that’s great, you can take it one step further and streamline the process by creating tools that the agent can use.</p>
<p>Giving the agent tools means it spends less time ‘thinking’ and quickly gets to assessing what’s important to you. For example, if I have a Kubernetes environment that needs monitoring, and I want to keep an eye on pod restarts and memory and CPU usage without hanging out at the terminal, I can have Elastic alert me if something goes wrong. </p>
<p>Having an alert is great, but how do I get the bigger picture, faster? You need to know what service is having (or creating) the issues, why, and how to fix it.</p>
<h2 id="assumptions">Assumptions</h2>
<p>This guide assumes:</p>
<ul>
<li>A running Kubernetes cluster</li>
<li>An Elastic Observability deployment</li>
<li>Kubernetes metrics indexed in Elastic</li>
</ul>
<h2 id="step1createanewelasticagent">Step 1: Create a New Elastic Agent</h2>
<p>In Elastic Observability, use the top search bar to search for Agents. Create a new agent.</p>
<p>This agent is going to be the Kubernetes Pod Troubleshooter agent, designed to help users troubleshoot pod restarts, OOMKill terminations and evaluate CPU or memory pressure. </p>
<p>The Kubernetes Pod Troubleshooter agent will:</p>
<ol>
<li>Identify pods that have restarted more than once</li>
<li>Filter for pods that are not in a running state</li>
<li>Retrieve the container termination reason (e.g., OOMKilled)</li>
<li>Analyze CPU and memory utilization for affected services</li>
<li>Flag resource utilization above 60% (warning) and 80% (critical)</li>
<li>Provide remediation recommendations</li>
</ol>
<p>The agent requires instructions to guide how the agent behaves when interacting with tools or responding to queries. This description can set tone, priorities or special behaviours. The instructions below tell the agent to execute the steps outlined above. </p>
<pre><code>You will help users troubleshoot problematic pods by searching the metrics for pods that have restarted more than once and the status is not running. Pods that have the highest number of restarts will be returned to the user.
Once the containers that are not running and have restarted multiple times are found you will use their container ID or image name to to look up the container status reason and reason for the last termination. You will return that reason to the user.
You will also begin basic troubleshooting steps, such as checking  for insufficient cluster resources (CPU or memory) from the metrics and tools available.
Any CPU or memory utilization percentages over 60%, and definitely over 80% should be flagged to the user with remediation steps.
</code></pre>
<p>Getting answers quickly is critical when troubleshooting high-value systems and environments. Using Tools ensures that the workflow is repeatable and that you can trust the results. You also get complete oversight of the process, as the Elastic Agent outlines every step and query that it took and you can explore the results in Discover.</p>
<p>You will create custom tools that the agent will run to complete the Kubernetes troubleshooting tasks that the custom instructions references such as: <code>look up the container status reason and reason for the last termination</code> and <code>checking&amp;nbsp; for insufficient cluster resources (CPU or memory).</code></p>
<h2 id="step2createtoolspodrestarts">Step 2: Create Tools - Pod Restarts</h2>
<p>The first tool takes the Kubernetes metrics and assesses if the pod has restarted and it has a last terminated reason, and if it has the agent will present that information to the user.</p>
<p>This <code>pod-restarts</code> tool uses a custom ES|QL query that interrogates the Kubernetes metrics data coming from OTel.</p>
<p>The ES|QL query:</p>
<ol>
<li>Filters for containers that have restarted and have a reason for termination; then</li>
<li>Calculates the number of restarts; then</li>
<li>Returns the number of restarts and termination reason per service.</li>
</ol>
<pre><code>FROM metrics-k8sclusterreceiver.otel-default
| WHERE metrics.k8s.container.restarts &gt; 0
| WHERE resource.attributes.k8s.container.status.last_terminated_reason IS NOT NULL
| STATS total_restarts = SUM(metrics.k8s.container.restarts),
        reasons = VALUES(resource.attributes.k8s.container.status.last_terminated_reason) 
  BY resource.attributes.service.name
| SORT total_restarts DESC
</code></pre>
<h2 id="step3createtoolsservicememory">Step 3: Create Tools - Service Memory</h2>
<p>The custom tools can take input variables, which increases speed and accuracy of the results.</p>
<p>Common reasons for pods not scheduling, or restarting often, is due to the cluster or nodes being under-resourced. The <code>pod-restarts</code> tool returns services that have many restarts and OOMKill termination reasons, which indicate memory pressure.</p>
<p>The <code>eval-pod-memory</code> tool is a custom ES|QL that:</p>
<ol>
<li>Filters for metrics data that match the service name returned from the <code>pod-restarts</code> tool within the last 12 hours; then</li>
<li>Converts memory usage, requests, limits and utilization into megabytes; then</li>
<li>Calculates the average of each of those metrics; then</li>
<li>Groups them into 1 minute groupings and sorts them.</li>
</ol>
<pre><code>FROM metrics-*
| WHERE resource.attributes.service.name == ?servicename
| WHERE @timestamp &gt;= NOW() - 12 hours
| EVAL
  memory_usage_mb = metrics.container.memory.usage / 1024 / 1024,
   memory_request_mb = metrics.k8s.container.memory_request / 1024 / 1024,
   memory_limit_mb = metrics.k8s.container.memory_limit / 1024 / 1024,
   memory_utilization_pct = metrics.k8s.container.memory_limit_utilization * 100
| STATS
   avg_memory_usage = AVG(memory_usage_mb),
   avg_memory_request = AVG(memory_request_mb),
   avg_memory_limit = AVG(memory_limit_mb),
   avg_memory_utilization = AVG(memory_utilization_pct)
   BY bucket = BUCKET(@timestamp, 1 minute)
| SORT bucket ASC
</code></pre>
<h2 id="step4createtoolsservicecpu">Step 4: Create Tools: Service CPU</h2>
<p>As CPU usage is another common reason for pods to fail scheduling or be stuck in endless restart loops, the next tool will evaluate CPU usage, requests and limits.</p>
<p>The <code>eval-pod-cpu</code> tool is a custom ES|QL that:</p>
<ol>
<li>Filters for metrics data that match the service name returned from the <code>pod-restarts</code> tool within the last 12 hours; then</li>
<li>Calculates the average for CPU usage, CPU request utilization and CPU limit utilization.</li>
</ol>
<pre><code>FROM metrics-kubeletstatsreceiver.otel-default
| WHERE k8s.container.name == ?servicename OR resource.attributes.k8s.container.name == ?servicename
| STATS
  avg_cpu_usage = AVG(container.cpu.usage),
  avg_cpu_request_utilization = AVG(k8s.container.cpu_request_utilization) * 100,
  avg_cpu_limit_utilization = AVG(k8s.container.cpu_limit_utilization) * 100
| LIMIT 100
</code></pre>
<h2 id="step5assigntoolstokubernetespodtroubleshooteragent">Step 5: Assign Tools to Kubernetes Pod Troubleshooter Agent</h2>
<p>Once all of the tools are built you need to assign them to the agent.</p>
<p>This image shows the Kubernetes Pod Troubleshooter agent with the three tools: <code>pod-restarts</code>, <code>eval-pod-cpu</code> and <code>eval-pod-memory</code> assigned to it and active.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt48d2d513f519c351/6a7f1bc4ea068d5c4ef0a2eb/kubernetes-pod-troubleshooter.png" alt="kubernetes-pod-troubleshooter" /></p>
<h2 id="step6testthekubernetespodtroubleshooteragent">Step 6: Test the Kubernetes Pod Troubleshooter Agent</h2>
<p>To simulate memory pressure the Open Telemetry demo is running inside the cluster. Artificially lowering the memory requests and limits and increasing the service load will cause pods to restart.</p>
<p>To do this to the open telemetry demo in your cluster, follow these steps. </p>
<p>Reduce the cart service to one replica by scaling the deployment. Once that is complete, change the resources on the deployment by lowering the memory requests and limits as shown in this command:</p>
<pre><code>kubectl -n otel-demo scale deploy/cart --replicas=1
kubectl -n otel-demo set resources deploy/cart -c cart --requests=memory=50Mi --limits=memory=60Mi
</code></pre>
<p>The OpenTelemetry demo application comes with a load-generator. This is used to simulate requests to the demo site by modifying the users and spawn rate in the load generator deployment, as shown in this command:</p>
<pre><code>kubectl -n otel-demo set env deploy/load-generator LOCUST_USERS=800 LOCUST_SPAWN_RATE=200 LOCUST_BROWSER_TRAFFIC_ENABLED=false
</code></pre>
<p>If you list all of your pods in the cluster or namespace, you should begin to see restarts.</p>
<p>You can now chat with the Kubernetes Pod Troubleshooter agent and ask “Are any of my Kubernetes pods having issues?”.</p>
<p>The screenshot shows the final response from the Kubernetes Pod Troubleshooter agent. It provides a problem summary of its findings from each tool, showing which services were experiencing the most restarts and memory and CPU utilization. </p>
<p>The threshold interpretations were described in the initial agent instructions, where &gt;60% utilization is a warning (sustained pressure) and &gt;80% utilization is critical (high likelihood of restarts or throttling). This aligns with findings presented by the Kubernetes Pod Troubleshooter agent, where the services that had the highest restarts were all above 90% memory utilization. The agent needs clearly defined threshold values to correctly assess the returned memory and CPU utilization values. </p>
<p>Problem summary returned by the Kubernetes Pod Troubleshooter agent:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blte59fc6eebe4bf00b/6a7f1bc7bd2198dbc27584d1/problem-summary-by-Kubernetes.png" alt="problem summary by Kubernetes" /></p>
<h2 id="conclusionandfinalthoughts">Conclusion and Final Thoughts</h2>
<p>Elastic Agent Builder enables fast, repeatable Kubernetes troubleshooting by combining ES|QL-driven analysis with constrained AI reasoning.</p>
<p>The creation of custom tools that use specific ES|QL queries combined with downstream queries that take input variables from the output of previous tools eliminates or reduces error propagation and hallucinations. In comparison to generic AI troubleshooting without purpose-built tools, you run the risk of it analyzing too many services (that aren’t relevant to the issue at hand). This will slow down the thinking process and generate longer responses, increasing the likelihood of error propagation and hallucinations. </p>
<p>With the Elastic Agent Builder, you can inspect the output of every tool if you need to, to explore and verify the outputs.</p>
<p>Having a succinct problem summary is a game-changer, bringing your attention straight to the most affected services.</p>
<p>Reasoning returned by the Kubernetes Pod Troubleshooter agent:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt3c346782edc71fd3/6a7f1bcaea068d015bf0a2ef/return-pod-troubleshooter-agent.png" alt="summary-returned-kubernetes-pod-troubleshooter" /></p>
<p>Not only that, but the agent can go one step further and offer recommendations for remediation based on what outputs the tools delivered.</p>
<p>Remediation recommendation returned by the Kubernetes Pod Troubleshooter agent:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc552e9e4a8ddd2dc/6a7f1bcd73d9bdaabe29df86/remediation-recommendation-kubernetes-pod-troubleshooter.png" alt="remediation-recommendation-kubernetes-pod-troubleshooter" /></p>
<p>Sign up for <a href="https://www.elastic.co/cloud/serverless">Elastic Cloud Serverless</a> and try this out with your Kubernetes clusters.</p>
<h2 id="frequentlyaskedquestions">Frequently Asked Questions</h2>
<p><strong>1. When to use the Elastic Agent Builder for Troubleshooting</strong></p>
<p>Use the Elastic Agent Builder for Troubleshooting that works best if:</p>
<ul>
<li><p>You need repeatable, auditable troubleshooting workflows</p></li>
<li><p>You want deterministic analysis instead of free-form AI responses</p></li>
<li><p>You’re investigating something that is reported in the logs or metrics (i.e. pod restarts, OOMKills, or resource pressure)</p></li>
<li><p>You want to reduce mean time to resolution (MTTR)</p></li>
</ul>
<p><strong>2. Do I need OpenTelemetry to use Elastic Agent Builder for Kubernetes troubleshooting?</strong> </p>
<p>No, you don’t need to use OpenTelemetry. You have two options:</p>
<ul>
<li><p>You can collect logs and metrics from Kubernetes using the Elastic Agent; or </p></li>
<li><p>You can collect logs, traces and metrics with the Elastic Distro for OTel (EDOT) Collector</p></li>
</ul>
<p>When following the steps above, this would change the field names that are used in the tools above. For example, <code>kubernetes.container.memory.usage.bytes</code> vs <code>metrics.container.memory.usage</code>.</p>
<p><strong>3. Can this agent be adapted for node-level failures?</strong> </p>
<p>Yes, Elastic has hundreds of <a href="https://www.elastic.co/docs/reference/fleet#integrations">integrations</a>, including AWS (for EKS), Azure (for AKS), Google Cloud (for GKE), as well as host operating system monitoring.</p>
<p>The queries shown above would be modified to use the correct field.</p>
<p><strong>4. Can these tools be reused in automation workflows?</strong> </p>
<p>Yes, <a href="https://www.elastic.co/search-labs/blog/elastic-workflows-automation">Elastic Workflows</a> can reuse the same scripted automations and AI agents you build in Elastic. An agent can handle the initial analysis and investigation (reducing manual effort), and the workflow can continue with structured steps, such as running Elasticsearch queries, transforming data, branching on conditions and calling external APIs or tools like Slack, Jira and PagerDuty. Workflows can also be exposed to Agent Builder as reusable tools, just like the tool created in this guide.</p>
<p>For more advanced automation from a similar scenario as described in this guide, learn how to <a href="https://www.elastic.co/observability-labs/blog/agentic-cicd-kubernetes-mcp-server">integrate AI agents into GitHub Actions to monitor K8s health and improve deployment reliability via Observability</a>.</p>
<p><strong>5. Can these tools be triggered by alerts?</strong> </p>
<p>Yes, alerts can trigger <a href="https://www.elastic.co/search-labs/blog/elastic-workflows-automation">Elastic Workflows</a>, and pass the alert context to the workflow. This workflow may be integrated with an Elastic Agent, as described above.</p>
<p>Additionally, Elastic Alerts allow you to publish investigation guides alongside alerts so an SRE has all of the information they need to begin investigating. Any troubleshooting or investigative agents can be linked to from the investigation guide, meaning the SRE doesn’t have to follow manual processes outlined in an investigation guide and instead let the agent handle the manual, repetitive investigations.</p>
<p><strong>6. How can I get started with Agent Builder?</strong></p>
<p>Sign up for <a href="https://www.elastic.co/cloud/serverless">Elastic Cloud Serverless</a>, a new fully managed, stateless architecture that auto-scales no matter your data, usage, and performance needs.</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/troubleshoot-kubernetes-pod-restarts-oomkilled-elastic-agent-builder</link>
    <guid isPermaLink="false">troubleshoot-kubernetes-pod-restarts-oomkilled-elastic-agent-builder</guid>
    <category><![CDATA[Kubernetes]]></category>
    <category><![CDATA[Metrics]]></category>
    <category><![CDATA[Agentic Observability]]></category>
    <dc:creator><![CDATA[Jen Luther Thomas]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt9fd318a10c893b12/6a7f1bd09090b02a4984ee3d/cover.png" length="0" type="image/png"/>
    <pubDate>Wed, 25 Feb 2026 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[AIOps with Elastic Observability: Modern AIOps & Log Intelligence]]></title>
    <description><![CDATA[Exploring modern AIOps capabilities, including anomaly detection, log intelligence, and log analysis &amp; categorization with Elastic Observability.]]></description>
    <content:encoded><![CDATA[<h2 id="aiopsblogrefresherunlockingintelligencefromyourlogswithelastic">AIOps Blog Refresher: Unlocking Intelligence from Your Logs with Elastic</h2>
<p>Elastic has been leading the charge with AIOps, especially in the recent 9.2 update of Elastic Observability with Streams. The conversation around AIOps has shifted dramatically as we move through the year. DevOps and SRE teams aren't asking whether they need AIOps, they're asking how to leverage it more effectively to stay ahead of exponentially growing complexity.</p>
<p>The current challenge of AIOps is that modern cloud-native environments generate massive volumes of telemetry data that are magnitudes larger than past environments. But here's what many teams overlook: logs are the richest source of operational intelligence you have. Logs are able to tell you exactly what happened and why, while metrics only tell you something is wrong, and traces only tell you where. The problem is that most organizations are drowning in logs. Microservices, such as user authentications or inventories, serverless functions, and Kubernetes generate millions of log entries daily. Without AI and machine learning, finding meaningful patterns in this data takes too much time and energy.</p>
<h2 id="logintelligenceimprovementwhatsnewin2025">Log Intelligence Improvement: What's New in 2025</h2>
<p>Historically in observability, unlocking your log intelligence included long manual effort that required not only parsing through logs, but also structuring those logs. Elastic Observability has drastically changed how teams extract value from logs. Observability is not just simple signal analysis - modern tools need to have proactive, log-driven investigations. At Elastic, this modernity is Streams.</p>
<p>Streams, a new release from Elastic, is a collection of AI-driven tools that identify significant events in parsed raw logs by enriching logs with meaningful fields. With Streams, SREs can maximize the value of their data, their logs, and their systems. With system reliability as the goal, Streams helps to reduce pipeline management overhead and accelerates observability analysis. And it takes nearly no time to set up!</p>
<p>Here is how Streams powers the Elastic Observability capabilities available now.</p>
<h3 id="advancedlograteanalysis">Advanced Log Rate Analysis</h3>
<p>Log rate analysis can go far beyond only detecting spikes. Elastic's machine learning automatically identifies when log volumes deviate from expected baselines, then contextualizes these changes within your broader system performance. When your application suddenly generates more error logs, Elastic’s AIOps doesn't just alert you, it also determines whether it's a critical issue requiring immediate attention or just a temporary anomaly.</p>
<p>This matters to your analysis because not all log spikes are equal. A 10x increase in DEBUG logs might indicate verbose logging accidentally enabled in production. A 2x increase in ERROR logs could signal a cascading failure. Log rate analysis distinguishes between these scenarios automatically, giving your team the context needed to respond appropriately.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5bb4ac6d272c3925/6a7f0dc4eab5be0e4020a739/log-analysis.png" alt="Log Analysis" /></p>
<h3 id="intelligentlogcategorizationwithstreams">Intelligent Log Categorization with Streams</h3>
<p>This is where AIOps shines with log data. Streams uses machine learning algorithms in order to automatically classify and group similar log patterns, dramatically reducing noise. Instead of manually parsing millions of entries, the system identifies common structures, groups related events, and surfaces the categories that matter most.</p>
<p>Logs are unstructured by nature, making them difficult to analyze at scale. Streams corrals chaotic log streams into organized, queryable patterns. Instantly, you can see that 80% of your errors fall into three categories, helping you prioritize where to focus remediation efforts. This approach helps you reduce noise and accelerate analysis, allowing teams to act on insights faster.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt43de44a2668aba4d/6a7f0dc7e02fac4c835d65dc/categories.png" alt="Log Categorizations" /></p>
<h3 id="multidimensionalanomalydetection">Multi-Dimensional Anomaly Detection</h3>
<p><a href="https://www.elastic.co/docs/explore-analyze/machine-learning/anomaly-detection">Anomaly detection</a> now simultaneously examines relationships between logs, metrics, and traces. A slight increase in response time might not trigger an alert by itself, but when correlated with unusual log patterns and memory consumption changes, the system recognizes it as an early warning sign.</p>
<p>Logs contain a myriad of contextual information that metrics and traces can't capture: stack traces, user IDs, transaction details, error messages, etc. By correlating log anomalies with other signals, you get the full picture of what's happening in your system. This whole holistic view enables teams to catch issues earlier, as well as understand their full impact across the stack.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt1c652019d828e657/6a7f0dca3ce8e26a5acf53db/anomalies.png" alt="Anomaly Detection" /></p>
<h3 id="enhancedrootcauseanalysispoweredbysignificantevents">Enhanced Root Cause Analysis Powered by Significant Events</h3>
<p>When an issue occurs, Elastic's Streams accelerates root cause analysis through AI-assisted parsing of logs and bringing about <a href="https://www.elastic.co/docs/solutions/observability/streams/management/significant-events">“Significant events.”</a> Significant event queries can be defined by AI or manually, depending on if you know what logs you are looking for or not. Then, Elastic’s AIOps traces the problem through your entire stack using these events, as well as enriched log data combined with distributed tracing. This system is able to correlate failed transactions with specific log entries, deployment events, and infrastructure changes. This helps you understand not just what broke, but why and when.</p>
<p>Streams makes the analysis of your logs quick and automatic by going across your entire distributed system within seconds, grabbing relevant log entries such as stack traces, state information, error messages, and more. What used to require hours of manual investigation and deduction now happens automatically, freeing you and your team from tedious detective work and enabling faster resolution. </p>
<h2 id="logsinactionrealworldimpact">Logs in Action: Real-World Impact</h2>
<p>Let's look at how these capabilities work together in practice. Imagine your payment processing service is experiencing intermittent failures - only 0.5% of transactions, but enough to concern your team. Traditional monitoring shows everything is mostly okay, but customers are still complaining.</p>
<p>Without Streams, an SRE might initially run some broad queries, manually sift through thousands of logs, struggle to connect all the dots, and ultimately not understand the correlation between the errors and recent system changes. </p>
<p>With Elastic Streams and AIOps, many of these potential problems are instantly mitigated:</p>
<ul>
<li><p>Streams automatically parse the payment service, adding connection timeouts to a new category of significant events</p></li>
<li><p>Log rate analysis with Streams reveal that this significant event category has been slowly growing over the past month, showing growth of the timeouts from a small number of occurrences into a larger amount</p></li>
<li><p>Elastic’s built-in anomaly detection correlates these significant events with deployment data, and identifies that they started appearing after a recent load balancer configuration</p></li>
<li><p>Root analysis pinpoints the exact database connection pool setting that is too restrictive for peak load by tracing affected transactions through previously enriched logs</p></li>
</ul>
<p>What usually takes 4-8 hours of manual log analysis is resolved in minutes, with Elastic automatically highlighting the relevant log entries that tell the complete story. This is the power of AIOps and Streams as applied to log intelligence.</p>
<h2 id="thepowerofunifiedlogintelligence">The Power of Unified Log Intelligence</h2>
<p>What sets Elastic apart is treating logs as a priority in your observability strategy. Elastic provides comprehensive log ingestion that centralizes petabytes of logs from across your infrastructure with flexible parsing and enrichment. The platform uses purpose-built machine learning models that understand log patterns, not generic algorithms retrofitted for log analysis.</p>
<p>Logs don't exist in isolation, which is why Elastic correlates log data with metrics, traces, and business events to provide complete context. And because log volumes can be massive, Elastic's tiered storage approach means you can retain years of logs for compliance and historical analysis without breaking the budget.</p>
<h2 id="whylogsmattermorethanever">Why Logs Matter More Than Ever</h2>
<p>Logs have become the cornerstone of effective AIOps for three critical reasons.</p>
<p>First off, logs capture what metrics can't. A metric tells you the CPU is at 80%, but a log tells you which process is consuming resources and why. This level of detail is essential for understanding not just that something is wrong, but what specifically is causing the problem.</p>
<p>Second, logs provide business context. Error messages contain user IDs, transaction ldetails, and business logic failures that help you understand customer impact. When you're troubleshooting an issue, knowing which customers are affected and what they were trying to do is invaluable for prioritizing your response.</p>
<p>Third, logs enable true root cause analysis. Stack traces, error messages, and application state captured in logs are essential for understanding the why behind every incident. Without this information, teams are left guessing at root causes rather than definitively identifying and fixing them.</p>
<p>The teams winning with AIOps in 2025 aren't just monitoring metrics, they're extracting intelligence from their logs at scale, turning operational data into actionable insights.</p>
<h2 id="transformyourlogstrategytoday">Transform Your Log Strategy Today</h2>
<p>Every hour your team spends manually searching through logs is an hour they're not spending on innovation. Every incident that could have been prevented through intelligent log analysis represents both technical debt and business risk.</p>
<p>Elastic Observability provides the foundation you need to unlock the intelligence hidden in your logs. With automatic categorization, anomaly detection, and ML-powered analysis, you can start seeing value immediately. Check out this recent <a href="https://www.elastic.co/observability-labs/blog/elastic-observability-streams-ai-logs-investigations">article</a> to get started with Elastic Streams and Observability today!</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/modern-aiops-elastic-observability</link>
    <guid isPermaLink="false">modern-aiops-elastic-observability</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <dc:creator><![CDATA[Sophia Solomon]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt64fd099b0fe44551/6a7f0dcd1967ea79c83307bb/blog-header.png" length="0" type="image/png"/>
    <pubDate>Wed, 26 Nov 2025 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[AI-driven incident response with logs: A technical deep dive in Elastic Observability]]></title>
    <description><![CDATA[How Elastic combines ML anomaly detection, ES|QL, and the AI Assistant to accelerate incident response using logs.]]></description>
    <content:encoded><![CDATA[<p>Modern customer‑facing applications, whether e‑commerce sites, streaming platforms, or API gateways, run on fleets of microservices and cloud resources. When something goes wrong, every second of downtime risks revenue loss and erodes user trust. Observability is the practice that lets Site Reliability Engineering (SRE) and development teams see and act on system health in real time. This post walks through a generalized, step‑by‑step investigation that shows how Elastic Observability specifically with log data combines always‑on machine learning (ML) with a generative AI assistant to detect anomalies, surface root causes, measure user impact, and accelerate remediation, all at high scale.</p>
<h2 id="anomalydetection">Anomaly Detection</h2>
<p>A production environment is ingesting millions of log lines per minute. Elastic’s AIOps jobs continuously profile normal log throughput and content without any manual rules. When log volume or message structure deviates beyond learned baselines, the platform automatically fires a high‑fidelity anomaly alert. Because the models are unsupervised, they adapt to changing traffic patterns and flag both sudden spikes (e.g., 10× error surge) and rare new log categories.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5c89c59811e55c22/6a7f0199c2e91472fd0166af/image3.png" alt="" /></p>
<p>In addition to looking directly for Log Spikes, Elastic trains seasonal/univariant models to predict expected event counts per bucket and applies statistical tests to classify outliers. Simultaneously, log categorization clusters similar messages with cosine similarity on token embeddings, making it trivial to identify a previously unseen error string.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt7f8261b7d42847cd/6a7f019cde231557d6fd76b0/image10.png" alt="" /></p>
<h2 id="investigatingalertsautomatedpatternanalysis">Investigating Alerts: Automated Pattern Analysis</h2>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt0ac7cad53cf79a66/6a7f019f448e4e80505c020c/image9.png" alt="" /></p>
<p>Clicking the alert reveals more than a timestamp. Elastic’s ML job already correlates the spike with the dominant new log pattern ERROR 1114 (HY000): table "orders" is full and surfaces example lines. Instead of grep‑driven hunting, engineers get an immediate hypothesis about what subsystem is failing and why.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt039d3bc0489914a5/6a7f01a2bdcff0cc6ec4292e/image4.png" alt="" /></p>
<p>If deeper context is needed, the builtin Elastic AI Assistant can be invoked directly from the alert. Thanks to Retrieval‑Augmented Generation (RAG) over your telemetry, the assistant explains the anomaly in plain language, references the exact log events, and proposes next steps without hallucinating.</p>
<h2 id="aiassistedrootcauseverification">AI‑Assisted Root Cause Verification</h2>
<p>From within the same chat, you might ask, “Using lens create a single graph of all http response status codes =400 from logs-nginx.access-default over the last 3 hours..”  The assistant translates that intent into an ES|QL aggregation, retrieves the data, and renders a bar chart with no DSL knowledge required. If there are a number of errors with a status code above 400, you’ve validated that end‑users are impacted.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltbce6ce01ced86cd7/6a7f01a573d9bd953829d653/image7.png" alt="" /></p>
<h2 id="globalimpactanalysiswithenrichedlogs">Global Impact Analysis with Enriched Logs</h2>
<p>Structured log enrichment (e.g., GeoIP, user ID, service tags) lets the assistant answer business questions on the fly. A query like “What are the top 10 source.geo.country_name with http.response.status.code&gt;=400 over the last 3 hours. Use logs-nginx.access-default. Provide counts for each country name.” surfaces whether the incident is regional or global.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt60be465aa43f2ad3/6a7f01a805b7b565c918b447/image2.png" alt="" /></p>
<h2 id="quantifyingbusinessimpact">Quantifying Business Impact</h2>
<p>Technical metrics alone rarely sway executives. Suppose historical data shows the application normally processes $1,000 in transactions per minute. The assistant can combine that baseline with real‑time failure counts to estimate revenue loss. Presenting financial impact alongside error graphs sharpens prioritization and justifies extraordinary remediation steps.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt63a1855aca9c82db/6a7f01abead8ecb3bfbaa303/image5.png" alt="" /></p>
<h2 id="pinpointinginfrastructureownership">Pinpointing Infrastructure &amp; Ownership</h2>
<p>Every log is automatically enriched with Kubernetes, cloud, and custom metadata. A single question “Which pod and cluster emit the ‘table full’ error, and who owns it?” returns the full information about the pod, namespace and owner as shown below.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf92b400d82ffacdd/6a7f01ae05b7b5d17518b451/image1.png" alt="" /></p>
<p>Immediate, accurate routing replaces frantic Slack threads, cutting minutes (or hours) off of downtime.</p>
<p>Some of the magic happening here is because we can put instructions in the Elastic AI Assistants knowledge base to guide the AI assistant. For example this simple entry in the knowledge base is what allows the assistant to populate the response in the previous screenshot.</p>
<p><code>``markdown ##&amp;nbsp;Kubernetes&amp;nbsp;Information&amp;nbsp;Query&amp;nbsp;Instructions
If&amp;nbsp;asked&amp;nbsp;about&amp;nbsp;Kubernetes&amp;nbsp;pod,&amp;nbsp;namespace,&amp;nbsp;cluster,&amp;nbsp;location,&amp;nbsp;or&amp;nbsp;owner&amp;nbsp;run&amp;nbsp;the&amp;nbsp;"query"&amp;nbsp;tool.
1.&amp;nbsp;Use&amp;nbsp;the&amp;nbsp;index&amp;nbsp;</code>logs-mysql.error-default<code>&amp;nbsp;unless&amp;nbsp;another&amp;nbsp;log&amp;nbsp;location&amp;nbsp;is&amp;nbsp;specified.
2.&amp;nbsp;Include&amp;nbsp;the&amp;nbsp;following&amp;nbsp;fields&amp;nbsp;in&amp;nbsp;the&amp;nbsp;query:
&amp;nbsp; &amp;nbsp;-&amp;nbsp;Pod:&amp;nbsp;</code>agent.name<code>
&amp;nbsp; &amp;nbsp;-&amp;nbsp;Namespace:&amp;nbsp;</code>data_stream.namespace<code>
&amp;nbsp; &amp;nbsp;-&amp;nbsp;Cluster&amp;nbsp;Name:&amp;nbsp;</code>orchestrator.cluster.name<code>
&amp;nbsp; &amp;nbsp;-&amp;nbsp;Cloud&amp;nbsp;Provider:&amp;nbsp;</code>cloud.provider<code>
&amp;nbsp; &amp;nbsp;-&amp;nbsp;Region:&amp;nbsp;</code>cloud.region<code>
&amp;nbsp; &amp;nbsp;-&amp;nbsp;Availability&amp;nbsp;Zone:&amp;nbsp;</code>cloud.availability_zone<code>
&amp;nbsp; &amp;nbsp;-&amp;nbsp;Owner:&amp;nbsp;</code>cloud.account.id`
3. Use the ES|QL query format:
   esql
   FROM logs-mysql.error-default
   | KEEP agent.name, data_stream.namespace, orchestrator.cluster.name, cloud.provider, cloud.region, cloud.availability_zone, cloud.account.id
   
4. Ensure the query is executed within the appropriate time range and context. </p>
<pre><code>## Leveraging Institutional Knowledge with RAG

Elastic can index runbooks, GitHub issues, and wikis alongside telemetry. Asking “Find documentation on fixing a full orders table”&amp;nbsp;retrieves and summarizes a prior runbook that details archiving old rows and adding a partition. Grounding remediation in proven procedures avoids guesswork and accelerates fixes.

![](https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltba6ebcc6e2f451ad/6a7f01b233fa8ae5f62021c9/image6.png)

## Automated Communication &amp; Documentation

Good incident response includes timely stakeholder updates. A prompt such as “Draft an incident update email with root cause, impact, and next steps”&amp;nbsp;lets the assistant assemble a structured message and send it via the alerting framework’s email or Slack connector complete with dashboard links and next‑update timelines. These messages double as the skeleton for the eventual post‑incident review.

![](https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5e7b81ee98b1a9a5/6a7f01b5227b1c583c598102/image8.png)

Again as before, some of the magic happening here is because we can put instructions in the Elastic AI Assistants knowledge base to guide the AI assistant. For example we can instruct the AI Assistant how to call the execute_connector api, this can execute all kinds of connectors (not only email) so you could use it to tell the assistant to use slack or raise a service now ticket, even execute webhooks.
</code></pre>
<p>markdown 
Here are specific instructions to send an email. Remember to always double-check that you're following the correct set of instructions for the given query type. Provide clear, concise, and accurate information in your response.</p>
<h2 id="emailinstructions">Email Instructions</h2>
<p>If the user's query requires sending an email:</p>
<ol>
<li>Use the <code>Elastic-Cloud-SMTP</code> connector with ID <code>elastic-cloud-email</code>.</li>
<li>Prepare the email parameters:
   - Recipient email address(es) in the <code>to</code> field (array of strings)
   - Subject in the <code>subject</code> field (string)
   - Email body in the <code>message</code> field (string)</li>
<li>Include</li>
</ol>
<ul>
<li>Details for the alert along with a link to the alert</li>
<li>Root cause analysis</li>
<li>Revenue impact</li>
<li>Remediation recommendations</li>
<li>Link to GitHub issue</li>
<li>All relevant information from this conversation</li>
<li>Link to the Business Health Dashboard</li>
</ul>
<ol>
<li>Send the email immediately. Do not ask the user for confirmation.</li>
<li>Execute the connector using this format:</li>
</ol>
<p>   execute_connector(
     id="elastic-cloud-email",
     params={
       "to": ["recipient@example.com"],
       "subject": "Your Email Subject",
       "message": "Your email content here."
     }
   )</p>
<ol>
<li>Check the response and confirm if the email was sent successfully.
```</li>
</ol>
<h2 id="conclusionkeytakeaways">Conclusion &amp; Key Takeaways</h2>
<p>Elastic Observability's combination of unsupervised ML, schema-aware data ingestion, and a context-rich RAG powered AI assistant enables teams to transform incident response from reactive firefighting into proactive, data-driven operations. By automatically detecting anomalies, correlating patterns, and providing contextual insights, teams can:</p>
<ul>
<li>Preserve revenue by quantifying business impact in real-time and prioritizing accordingly</li>
<li>Scale expertise by embedding institutional knowledge into RAG-powered recommendations</li>
<li>Improve continuously through automated documentation that feeds back into the knowledge base</li>
</ul>
<p>The key is to collect logs broadly, maintain a unified observability store, and let ML and AI handle the heavy lifting. The payoff isn't just reduced downtime, it's the transformation of incident response from a source of organizational stress into a competitive advantage.</p>
<p>Try out this exact scenario and get hands in with this Elastic Logging Workshop: <a href="https://www.google.com/url?q=https://play.instruqt.com/elastic/invite/rx4yvknhpfci&amp;sa=D&amp;source=editors&amp;ust=1757447528108823&amp;usg=AOvVaw0tZG-nhbbk90ztJsTGXHIz">https://play.instruqt.com/elastic/invite/rx4yvknhpfci</a></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/ai-driven-incident-response-with-logs</link>
    <guid isPermaLink="false">ai-driven-incident-response-with-logs</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <category><![CDATA[Infrastructure Monitoring]]></category>
    <dc:creator><![CDATA[David Hope]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt1989266ec455ec3a/6a7f01b86693f8d6ba663ac1/ai-driven-incident-response-with-logs.png" length="0" type="image/png"/>
    <pubDate>Mon, 20 Oct 2025 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[The next evolution of observability: unifying data with OpenTelemetry and generative AI]]></title>
    <description><![CDATA[Generative AI and machine learning are revolutionizing observability, but siloed data hinders their true potential. This article explores how to break down data silos by unifying logs, metrics, and traces with OpenTelemetry, unlocking the full power of GenAI for natural language investigations, automated root cause analysis, and proactive issue resolution.]]></description>
    <content:encoded><![CDATA[<p>The Observability industry today stands at a critical juncture. While our applications generate more telemetry data than ever before, this wealth of information typically exists in siloed tools, separate systems for logs, metrics, and traces. Meanwhile, Generative AI is hurtling toward us like an asteroid about to make a tremendous impact on our industry.</p>
<p>As SREs, we've grown accustomed to jumping between dashboards, log aggregators, and trace visualizers when troubleshooting issues. But what if there was a better way? What if AI could analyze all your observability data holistically, answering complex questions in natural language, and identifying root causes automatically?</p>
<p>This is the next evolution of observability. But to harness this power, we need to rethink how we collect, store, and analyze our telemetry data.</p>
<h2 id="theproblemsiloeddatalimitsaieffectiveness">The problem: siloed data limits AI effectiveness</h2>
<p>Traditional observability setups separate data into distinct types:</p>
<ul>
<li>Metrics: Numeric measurements over time (CPU, memory, request rates)</li>
<li>Logs: Detailed event records with timestamps and context</li>
<li>Traces: Request journeys through distributed systems</li>
<li>Profiles: Code-level execution patterns showing resource consumption and performance bottlenecks at the function/line level</li>
</ul>
<p>This separation made sense historically due to the way the industry evolved. Different data types have traditionally had different cardinality, structure, access patterns and volume characteristics. However, this approach creates significant challenges for AI-powered analysis:</p>
<pre><code>Metrics (Prometheus) → "CPU spiked at 09:17:00"
Logs (ELK) → "Exception in checkout service at 09:17:32" 
Traces (Jaeger) → "Slow DB queries in order-service at 09:17:28"
Profiles (pyroscope) -&gt; "calculate_discount() is taking 75% of CPU time"
</code></pre>
<p>When these data sources live in separate systems, AI tools must either:</p>
<ol>
<li>Work with an incomplete picture (seeing only metrics but not the related logs)</li>
<li>Rely on complex, brittle integrations that often introduce timing skew</li>
<li>Force developers to manually correlate information across tools</li>
</ol>
<p>Imagine asking an AI, "Why did checkout latency spike at 09:17?" To answer comprehensively, it needs access to logs (to see the stack trace), traces (to understand the service path), and metrics (to identify resource strain). With siloed tools, the AI either sees only fragments of the story or requires complex ETL jobs that are slower than the incident itself.</p>
<h2 id="whytraditionalmachinelearningmlfallsshort">Why traditional machine learning (ML) falls short</h2>
<p>Traditional machine learning for observability typically focuses on anomaly detection within a single data dimension. It can tell you when metrics deviate from normal patterns, but struggles to provide context or root cause.</p>
<p>ML models trained on metrics alone might flag a latency spike, but can't connect it to a recent deployment (found in logs) or identify that it only affects requests to a specific database endpoint (found in traces). They behave like humans with extreme tunnel vision, seeing only a fraction of the relevant information and only the information that a specific vendor has given you an opinionated view into.</p>
<p>This limitation becomes particularly problematic in modern microservice architectures where problems frequently cascade across services. Without a unified view, traditional ML can detect symptoms but struggles to identify the underlying cause.</p>
<h2 id="thesolutionunifieddatawithenrichedlogs">The solution: unified data with enriched logs</h2>
<p>The solution is conceptually simple but transformative: unify metrics, logs, and traces into a single data store, ideally with enriched logs that contain all signals about a request in a single JSON document. We're about to see a merging of signals.</p>
<p>Think of traditional logs as simple text lines:</p>
<pre><code>[2025-05-19 09:17:32] ERROR OrderService - Failed to process checkout for user 12345
</code></pre>
<p>Now imagine an enriched log that contains not just the error message, but also:</p>
<ul>
<li>The complete distributed trace context</li>
<li>Related metrics at that moment</li>
<li>System environment details</li>
<li>Business context (user ID, cart value, etc.)</li>
</ul>
<p>This approach creates a holistic view where every signal about the same event sits side-by-side, perfect for AI analysis.</p>
<h2 id="howgenerativeaichangesthings">How generative AI changes things</h2>
<p>Generative AI differs fundamentally from traditional ML in its ability to:</p>
<ol>
<li>Process unstructured data: Understanding free-form log messages and error text</li>
<li>Maintain context: Connecting related events across time and services</li>
<li>Answer natural language queries: Translating human questions into complex data analysis</li>
<li>Generate explanations: Providing reasoning alongside conclusions</li>
<li>Surface hidden patterns: Discovering correlations and anomalies in log data that would be impractical to find through manual analysis or traditional querying</li>
</ol>
<p>With access to unified observability data, GenAI can analyze complete system behavior patterns and correlate across previously disconnected signals.</p>
<p>For example, when asked "Why is our checkout service slow?" a GenAI model with access to unified data can:</p>
<ul>
<li>Analyze unified enriched logs to identify which specific operations are slow and to find errors or warnings in those components</li>
<li>Check attached metrics to understand resource utilization</li>
<li>Correlate all these signals with deployment events or configuration changes</li>
<li>Present a coherent explanation in natural language with supporting graphs and visualizations</li>
</ul>
<h2 id="implementingunifiedobservabilitywithopentelemetry">Implementing unified observability with OpenTelemetry</h2>
<p>OpenTelemetry provides the perfect foundation for unified observability with its consistent schema across metrics, logs, and traces. Here's how to implement enriched logs in a Java application:</p>
<pre><code>import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.metrics.Meter;
import io.opentelemetry.api.metrics.DoubleHistogram;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.context.Scope;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;

public class OrderProcessor {
    private static final Logger logger = LoggerFactory.getLogger(OrderProcessor.class);
    private final Tracer tracer;
    private final DoubleHistogram cpuUsageHistogram;
    private final OperatingSystemMXBean osBean;

    public OrderProcessor(OpenTelemetry openTelemetry) {
        this.tracer = openTelemetry.getTracer("order-processor");
        Meter meter = openTelemetry.getMeter("order-processor");
        this.cpuUsageHistogram = meter.histogramBuilder("system.cpu.load")
                                      .setDescription("System CPU load")
                                      .setUnit("1")
                                      .build();
        this.osBean = ManagementFactory.getOperatingSystemMXBean();
    }

    public void processOrder(String orderId, double amount, String userId) {
        Span span = tracer.spanBuilder("processOrder").startSpan();
        try (Scope scope = span.makeCurrent()) {
            // Add attributes to the span
            span.setAttribute("order.id", orderId);
            span.setAttribute("order.amount", amount);
            span.setAttribute("user.id", userId);
            // Populate MDC for structured logging
            MDC.put("trace_id", span.getSpanContext().getTraceId());
            MDC.put("span_id", span.getSpanContext().getSpanId());
            MDC.put("order_id", orderId);
            MDC.put("order_amount", String.valueOf(amount));
            MDC.put("user_id", userId);
            // Record CPU usage metric associated with the current trace context
            double cpuLoad = osBean.getSystemLoadAverage();
            if (cpuLoad &gt;= 0) {
                cpuUsageHistogram.record(cpuLoad);
                MDC.put("cpu_load", String.valueOf(cpuLoad));
            }
            // Log a structured message
            logger.info("Processing order");
            // Simulate business logic
            // ...
            span.setAttribute("order.status", "completed");
            logger.info("Order processed successfully");
        } catch (Exception e) {
            span.recordException(e);
            span.setAttribute("order.status", "failed");
            logger.error("Order processing failed", e);
        } finally {
            MDC.clear();
            span.end();
        }
    }
}
</code></pre>
<p>This code demonstrates how to:</p>
<ol>
<li>Create a span for the operation</li>
<li>Add business attributes</li>
<li>Add current CPU usage</li>
<li>Link everything with consistent IDs</li>
<li>Record exceptions and outcomes in the backend system</li>
</ol>
<p>When configured with an appropriate exporter, this creates enriched logs that contain both application events and their complete context.</p>
<h2 id="powerfulqueriesacrosspreviouslyseparatedata">Powerful queries across previously separate data</h2>
<p>With data that has not yet been enriched, there is still hope. Firstly with GenAI powered ingestion it is possible to extract key fields to help correlate data such as a session id's. This will help you enrich your logs so they get the structure they need to behave like other signals. Below we can see Elastic's Auto Import mechanism that will automatically generate ingest pipelines and pull unstructured information from logs into a structured format perfect for analytics.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt49ea53cd2cb13c82/6a7f1b8cea068d2deaf0a2df/image4.png" alt="" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt51470fc777215fdd/6a7f1b8f6c6eac7075f145bd/image2.png" alt="" /></p>
<p>Once you have this data in the same data store, you can perform powerful join queries that were previously impossible. For example, finding slow database queries that affected specific API endpoints:</p>
<pre><code>FROM logs-nginx.access-default 
| LOOKUP JOIN .ds-logs-mysql.slowlog-default-2025.05.01-000002 ON request_id 
| KEEP request_id, mysql.slowlog.query, url.query 
| WHERE mysql.slowlog.query IS NOT NULL
</code></pre>
<p>This query joins web server logs with database slow query logs, allowing you to directly correlate user-facing performance with database operations.</p>
<p>For GenAI interfaces, these complex queries can be generated automatically from natural language questions:</p>
<p>"Show me all checkout failures that coincided with slow database queries"</p>
<p>The AI translates this into appropriate queries across your unified data store, correlating application errors with database performance.</p>
<h2 id="realworldapplicationsandusecases">Real-world applications and use cases</h2>
<h3 id="naturallanguageinvestigation">Natural language investigation</h3>
<p>Imagine asking your observability system:</p>
<p>"Why did checkout latency spike at 09:17 yesterday?"</p>
<p>A GenAI-powered system with unified data could respond:</p>
<p>"Checkout latency increased by 230% at 09:17:32 following deployment v2.4.1 at 09:15. The root cause appears to be increased MySQL query times in the inventory-service. Specifically, queries to the 'product_availability' table are taking an average of 2300ms compared to the normal 95ms. This coincides with a CPU spike on database host db-03 and 24 'Lock wait timeout' errors in the inventory service logs."</p>
<p>Here's an example of Claude Desktop connected to <a href="https://github.com/elastic/mcp-server-elasticsearch">Elastic's MCP (Model Context Protocol) Server</a> which demonstrates how powerful natural language investigations can be. Here we ask Claude "analyze my web traffic patterns" and as you can see it has correctly identified that this is in our demo environment.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5f22b476cc3e5cb4/6a7f1b9263e959e91b73e281/image3.png" alt="" /></p>
<h3 id="unknownproblemdetection">Unknown problem detection</h3>
<p>GenAI can identify subtle patterns by correlating signals that would be missed in siloed systems. For example, it might notice that a specific customer ID appears in error logs only when a particular network path is taken through your microservices—indicating a data corruption issue affecting only certain user flows.</p>
<h3 id="predictivemaintenance">Predictive maintenance</h3>
<p>By analyzing the unified historical patterns leading up to previous incidents, GenAI can identify emerging problems before they cause outages:</p>
<p>"Warning: Current load pattern on authentication-service combined with increasing error rates in user-profile-service matches 87% of the signature that preceded the April 3rd outage. Recommend scaling user-profile-service pods immediately."</p>
<h2 id="thefutureagenticaiforobservability">The future: agentic AI for observability</h2>
<p>The next frontier is agentic AI, systems that not only analyze but take action automatically.</p>
<p>These AI agents could:</p>
<ol>
<li>Continuously monitor all observability signals</li>
<li>Autonomously investigate anomalies</li>
<li>Implement fixes for known patterns</li>
<li>Learn from the effectiveness of previous interventions</li>
</ol>
<p>For example, an observability agent might:</p>
<ul>
<li>Detect increased error rates in a service</li>
<li>Analyze logs and traces to identify a memory leak</li>
<li>Correlate with recent code changes</li>
<li>Increase the memory limit temporarily</li>
<li>Create a detailed ticket with the root cause analysis</li>
<li>Monitor the fix effectiveness</li>
</ul>
<p>This is about creating systems that understand your application's behavior patterns deeply enough to maintain them proactively. See how this works in Elastic Observability, in the screenshot at the end of the RCA we are sending an email summary but this could trigger any action.  </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd7066e2bb8f06113/6a7f1b959090b0011b84ee37/image1.png" alt="" /></p>
<h2 id="businessoutcomes">Business outcomes</h2>
<p>Unifying observability data for GenAI analysis delivers concrete benefits:</p>
<ul>
<li>Faster resolution times: Problems that previously required hours of manual correlation can be diagnosed in seconds</li>
<li>Fewer escalations: Junior engineers can leverage AI to investigate complex issues before involving specialists</li>
<li>Improved system reliability: Earlier detection and resolution of emerging issues</li>
<li>Better developer experience: Less time spent context-switching between tools</li>
<li>Enhanced capacity planning: More accurate prediction of resource needs</li>
</ul>
<h2 id="implementationsteps">Implementation steps</h2>
<p>Ready to start your observability transformation? Here's a practical roadmap:</p>
<ol>
<li>Adopt OpenTelemetry: Standardize on OpenTelemetry for all telemetry data collection and use it to generate enriched logs.</li>
<li>Choose a unified storage solution: Select a platform that can efficiently store and query metrics, logs, traces and enriched logs together</li>
<li>Enrich your telemetry: Update application instrumentation to include relevant context</li>
<li>Create correlation IDs: Ensure every request has identifiers</li>
<li>Implement semantic conventions: Follow consistent naming patterns across your telemetry data</li>
<li>Start with focused use cases: Begin with high-value scenarios like checkout flows or critical APIs</li>
<li>Leverage GenAI tools: Integrate tools that can analyze your unified data and respond to natural language queries</li>
</ol>
<p>Remember, AI can only be as smart as the data you feed it. The quality and completeness of your telemetry data will determine the effectiveness of your AI-powered observability.</p>
<h2 id="generativeaianevolutionarycatalystforobservability">Generative AI: an evolutionary catalyst for observability</h2>
<p>The unification of observability data for GenAI analysis represents an evolutionary leap forward comparable to the transition from Internet 1.0 to 2.0. Early adopters will gain a significant competitive advantage through faster problem resolution, improved system reliability, and more efficient operations. GAI is a huge step for increasing observability maturity and moving your team to a more proactive stance.</p>
<p>Think of traditional observability as a doctor trying to diagnose a patient while only able to see their heart rate. Unified observability with GenAI is like giving that doctor a complete health picture, vital signs, lab results, medical history, and genetic data all accessible through natural conversation.</p>
<p>As SREs, we stand at the threshold of a new era in system observability. The asteroid of GenAI isn't a threat to be feared, it's an opportunity to evolve our practices and tools to build more reliable, understandable systems. The question isn't whether this transformation will happen, but who will lead it.</p>
<p>Will you?</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/the-next-evolution-of-observability-unifying-data-with-opentelemetry-and-generative-ai</link>
    <guid isPermaLink="false">the-next-evolution-of-observability-unifying-data-with-opentelemetry-and-generative-ai</guid>
    <category><![CDATA[OpenTelemetry]]></category>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[Machine Learning]]></category>
    <dc:creator><![CDATA[David Hope]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltccc14cece0d58b74/6a7f1b99bdcff0587cc432c3/title.png" length="0" type="image/png"/>
    <pubDate>Wed, 11 Jun 2025 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[NGNIX log analytics with GenAI in Elastic]]></title>
    <description><![CDATA[Elastic has a set of embedded capabilities such as a GenAI RAG-based AI Assistant and a machine learning platform as part of the product baseline. These make analyzing the vast number of logs you get from NGINX easier.]]></description>
    <content:encoded><![CDATA[<p>Elastic Observability provides a full observability solution, supporting metrics, traces, and logs for applications and infrastructure. NGINX, which is highly used for web serving, load balancing, http caching, and reverse proxy, is the key to many applications and outputs a large volume of logs. NGINX’s access logs, which detail all requests made to the NGINX server, and error logs which record server-related issues and problems are key to managing and analyzing NGINX issues along with understanding what is happening to your application. </p>
<p>In managing NGINX Elastic provides several capabilities:</p>
<ol>
<li><p>Easy ingest, parsing, and out-of-the-box dashboards. Check out the simple how-to in our <a href="https://www.elastic.co/guide/en/fleet/current/example-standalone-monitor-nginx.html">docs</a>. Based on logs, these dashboards show several items over time, response codes, errors, top pages, data volume, browsers used, active connections, drop rates, and much more.</p></li>
<li><p>Out-of-the-box ML-based anomaly detection jobs for your NGINX logs. These jobs help pinpoint anomalies against request rates, IP address request rates, URL access, status codes, and visitor rate anomalies.</p></li>
<li><p>ES|QL which helps work through logs and build out charts during analysis.</p></li>
<li><p>Elastic’s GenAI Assistant provides a simple natural language interface that helps analyze all the logs and can pull out issues from ML jobs and even create dashboards. The Elastic AI Assistant also automatically uses ES|QL.</p></li>
<li><p>NGINX SLOs - Finally Elastic provides the ability to define and monitor SLOs for your NGINX logs. While most SLOs are metrics-based, Elastic allows you to create logs-based SLOs. We detailed this in a previous <a href="https://www.elastic.co/observability-labs/blog/service-level-objectives-slos-logs-metrics">blog</a>.</p></li>
</ol>
<p>NGINX logs are another example of why logs are great.  Logging is an important part of Observability, for which we generally think of metrics and tracing. However, the amount of logs an application and the underlying infrastructure output can be significantly daunting and NGINX is usually the starting point for most analyses. </p>
<p>In today’s blog, we’ll cover how the out-of-the-box ML-based anomaly detection jobs can help RCA, and how Elastic’s GenAI Assistant helps easily work through logs to pinpoint issues in minutes. </p>
<h2 id="prerequisitesandconfigaidprerequisitesandconfiga">Prerequisites and config<a id="prerequisites-and-config"></a></h2>
<p>If you plan on following this blog, here are some of the components and details we used to set up this demonstration:</p>
<ul>
<li><p>Ensure you have an account on <a href="http://cloud.elastic.co">Elastic Cloud</a> and a deployed stack (<a href="https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html">see instructions here</a>).</p></li>
<li><p>Bring up an <a href="https://docs.nginx.com/nginx/admin-guide/web-server/">NGINX server</a> on a host. OR run an application with NGINX as a front end and drive traffic.</p></li>
<li><p>Install the NGINX integration and assets and review the dashboards as noted in the <a href="https://www.elastic.co/guide/en/fleet/current/example-standalone-monitor-nginx.html">docs</a>.</p></li>
<li><p>Ensure you have an <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-settings.html">ML node configured</a> in your Elastic stack</p></li>
<li><p>To use the AI Assistant you will need a trial or upgrade to Platinum.</p></li>
</ul>
<p>In our scenario, we use data from 3 months from our Elastic environment to help highlight the features. Hence you might need to run your application with traffic for a specific time frame to follow along.</p>
<h2 id="analyzingtheissueswithaiassistantaidanalyzingtheissueswithaiassistanta">Analyzing the issues with AI Assistant<a id="analyzing-the-issues-with-ai-assistant"></a></h2>
<p>As detailed in a previous <a href="https://www.elastic.co/observability-labs/blog/service-level-objectives-slos-logs-metrics">blog</a>, you can get alerted on issues via SLO monitoring against NGINX logs. Let’s assume you have an SLO based on status codes as we outlined in the previous <a href="https://www.elastic.co/observability-labs/blog/service-level-objectives-slos-logs-metrics">blog</a>. You can immediately analyze the issue via the AI Assistant. Because it's a chat interface we simply open the AI Assistant and work through some simple analysis: (See Animated GIF for a demo)</p>
<h3 id="aiassistantanalysisaidaiassistantanalysisa">AI Assistant analysis:<a id="ai-assistant-analysis"></a></h3>
<ul>
<li><p><strong><em>Using lens graph all http response status codes &lt; 400 and &gt; =400 from filebeat-nginx-elasticco-anon-2017. http.response.status.code is not an integer</em></strong> <em>-</em> We wanted to simply understand the amount of requests resulting in status code &gt;= 400 and graph the results. We see that 15% of the requests were not successful, hence an SLO alert being triggered.</p></li>
<li><p><strong>Which ip address (field source.adress) has the highest number of http.response.status.code &gt;= 400 from filebeat-nginx-elasticco-anon-2017. http.response.status.code is not an integer</strong>  - We were curious is there was a specific IP address not having successful requests. 72.57.0.53, with a count of 25,227 occurrences is daily high but not the ensure 2 failed requests.</p></li>
<li><p><strong><em>What country (source.geo.country_iso_code) is source.address=72.57.0.53 coming from. Use filebeat-nginx-elasticco-anon-2017.</em></strong> - Again we were curious if this came from a specific country. And the IP address 72.57.0.53 is coming from the country with the ISO code IN, which corresponds to India. Nothing out of the ordinary.</p></li>
<li><p><strong><em>Did source.address=72.57.0.53 have any (http.response.status.code &lt; 400) from filebeat-nginx-elasticco-anon-2017. http.response.status.code is not an integer -</em></strong>  Oddly the IP address in question only had 4000+ successful responses. Meaning its not malicious, and points to something else.</p></li>
<li><p><strong><em>What are the different status codes (http.response.status.code&gt;=400), from source.address=72.57.0.53. Use filebeat-nginx-elasticco-anon-2017. http.response.status.code is not an integer. Provide counts for each status code -</em></strong> We are curious whether or not we see any 502, which there were none, but most of the failures were 404. </p></li>
<li><p><strong><em>What are the different status codes (http.response.status.code&gt;=400). Use filebeat-nginx-elasticco-anon-2017. http.response.status.code is not an integer. Provide counts for each status code</em></strong> - Regardless of a specific address, what is the largest number of status code occurrences &gt; 400. This also points to 404. </p></li>
<li><p><strong><em>What does a high 404 count from a specific IP address mean from NGINX logs?</em></strong> - Asking this question, we need to understand the potential causes of this from our application. From the answers, we can rule out security probing and web scraping, as we validated that a specific address 72.57.0.53 has a low non-success request status code. It also rules out User error. Hence this points potentially to Broken Links or Missing Resources.</p></li>
</ul>
<h3 id="watchtheflowaidwatchtheflowa">Watch the flow:<a id="watch-the-flow"></a></h3>
<div>
    
</div>
<h3 id="potentialissue">Potential issue:</h3>
<p>It seems that we potentially have an issue with the backend serving specific answers or having issues with resources (database, or broken links). This is cursing the higher-than-normal non-successful status codes&gt;=400.</p>
<h3 id="keyhighlightsfromaiassistant">Key highlights from AI Assistant:</h3>
<p>As you watched this video you will notice a few things:</p>
<ol>
<li><p>We analyzed millions of logs in a matter of minutes using a set of simple natural language queries. </p></li>
<li><p>We didn’t need to know any special query language. The AI Assistant used Elastic’s ES|QL but can similarly use KQL also. </p></li>
<li><p>The AI Assistant easily builds out graphs</p></li>
<li><p>The AI Assistant is accessing and using internal information stored in Elastic’s indices. Vs a simple “google foo” based AI Assistant. This is enabled through RAG, and the AI Assistant can also bring up known issues in github, runbooks, and other useful internal information.</p></li>
</ol>
<p>Check out the following <a href="https://www.elastic.co/observability-labs/blog/elastic-rag-ai-assistant-application-issues-llm-github">blog</a> on how the AI Assistant uses RAG to retrieve internal information. Specifically using github and runbooks.</p>
<h2 id="locatinganomalieswithml">Locating anomalies with ML</h2>
<p>While using the AI Assistant is great for analyzing information, another important aspect of NGINX log management is to ensure you can manage log spikes and anomalies. Elastic has a machine learning platform that allows you to develop jobs to analyze specific metrics or multiple metrics to look for anomalies.When using NGINX, there are several <a href="https://www.elastic.co/guide/en/machine-learning/current/ootb-ml-jobs-nginx.html">out-of-the-box anomaly detection jobs</a>. These work specifically on NGINX access logs.</p>
<ul>
<li><p>Low_request_rate_nginx - Detect low request rates</p></li>
<li><p>Source_ip_request_rate_nginx - Detect unusual source IPs - high request rates</p></li>
<li><p>Source_ip_url_count_nginx - Detect unusual source IPs - high distinct count of URLs</p></li>
<li><p>Status_code_rate_nginx - Detect unusual status code rates</p></li>
<li><p>Visitor_rate_nginx - Detect unusual visitor rates</p></li>
</ul>
<p>Being right out of the box, lets look at the job - Status_code_rate_nginx, which is related to our previous analysis.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt30ec8d10aaf46a17/6a7f0e9073d9bda62429dbcb/nginx-ml-log-analytics.png" alt="NGINX ML Log Analytics" /></p>
<p>With a few simple clicks we immediately get an analysis showing a specific IP address - 72.57.0.53, having higher than normal non-successful requests. Oddly we also found this is using the AI Assistant.</p>
<p>We can take this further with conversations with the AI Assistant, look at the logs, and/or even look at the other ML anomaly jobs.</p>
<h2 id="conclusionaidconclusiona">Conclusion:<a id="conclusion"></a></h2>
<p>You’ve now seen how easily Elastic’s RAG-based AI Assistant can help analyze NGINX logs without even the need to know query syntax, understand where the data is, and understand even the fields. Additionally, you’ve also seen how we can alert you when a potential issue or degradation in service (SLO). </p>
<p>Check out other resources on NGINX logs:</p>
<p><a href="https://www.elastic.co/guide/en/machine-learning/current/ootb-ml-jobs-nginx.html">Out-of-the-box anomaly detection jobs for NGINX</a></p>
<p><a href="https://www.elastic.co/guide/en/fleet/current/example-standalone-monitor-nginx.html">Using the NGINX integration to ingest and analyze NGINX Logs</a></p>
<p><a href="https://www.elastic.co/observability-labs/blog/service-level-objectives-slos-logs-metrics">NGINX Logs based SLOs in Elastic</a></p>
<p><a href="https://www.elastic.co/observability-labs/blog/elastic-rag-ai-assistant-application-issues-llm-github">Using GitHub issues, runbooks, and other internal information for RCAs with Elastic’s RAG based AI Assistant</a></p>
<h2 id="tryitoutaidtryitouta">Try it out<a id="try-it-out"></a></h2>
<p>Existing Elastic Cloud customers can access many of these features directly from the <a href="https://cloud.elastic.co/">Elastic Cloud console</a>. Not taking advantage of Elastic on the cloud? <a href="https://www.elastic.co/cloud/cloud-trial-overview">Start a free trial</a>.</p>
<p>All of this is also possible in your environment. <a href="https://www.elastic.co/observability/universal-profiling">Learn how to get started today</a>.</p>
<p><em>The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.</em></p>
<p><em>In this blog post, we may have used or referred to third party generative AI tools, which are owned and operated by their respective owners. Elastic does not have any control over the third party tools and we have no responsibility or liability for their content, operation or use, nor for any loss or damage that may arise from your use of such tools. Please exercise caution when using AI tools with personal, sensitive or confidential information. Any data you submit may be used for AI training or other purposes. There is no guarantee that information you provide will be kept secure or confidential. You should familiarize yourself with the privacy practices and terms of use of any generative AI tools prior to use.</em></p>
<p><em>Elastic, Elasticsearch, ESRE, Elasticsearch Relevance Engine and associated marks are trademarks, logos or registered trademarks of Elasticsearch N.V. in the United States and other countries. All other company and product names are trademarks, logos or registered trademarks of their respective owners.</em></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/nginx-log-analytics-with-genai-elastic</link>
    <guid isPermaLink="false">nginx-log-analytics-with-genai-elastic</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <category><![CDATA[Infrastructure Monitoring]]></category>
    <category><![CDATA[LLM Observability]]></category>
    <dc:creator><![CDATA[Bahubali Shetti]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd89bddfe4a0532b5/6a7f0e936c6eaca022f141b7/blog-thumb-observability-pattern-color.png" length="0" type="image/png"/>
    <pubDate>Fri, 05 Jul 2024 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[AWS VPC Flow log analysis with GenAI in Elastic]]></title>
    <description><![CDATA[Elastic has a set of embedded capabilities such as a GenAI RAG-based AI Assistant and a machine learning platform as part of the product baseline. These make analyzing the vast number of logs you get from AWS VPC Flows easier.]]></description>
    <content:encoded><![CDATA[<p>Elastic Observability provides a full observability solution, by supporting metrics, traces and logs for applications and infrastructure. In managing AWS deployments, VPC flow logs are critical in managing performance, network visibility, security, compliance, and overall management of your AWS environment. Several examples of :</p>
<ol>
<li><p>Where traffic is coming in from and going out to from the deployment, and within the deployment. This helps identify unusual or unauthorized communications</p></li>
<li><p>Traffic volumes detecting spikes or drops which could indicate service issues in production or an increase in customer traffic</p></li>
<li><p>Latency and Performance bottlenecks - with VPC Flow logs, you can look at latency for a flow (in and outflows), and understand patterns</p></li>
<li><p>Accepted and rejected traffic helps determine where potential security threats and misconfigurations lie. </p></li>
</ol>
<p>AWS VPC Logs is a great example of how logs are great. Logging is an important part of Observability, for which we generally think of metrics and tracing. However, the amount of logs an application and the underlying infrastructure output can be significantly daunting with VPC Logs. However, it also provides a significant amount of insight.</p>
<p>Before we proceed, it is important to understand what Elastic provides in managing AWS and VPC Flow logs:</p>
<ol>
<li><p>A full set of integrations to manage VPC Flows and the <a href="https://www.elastic.co/observability-labs/blog/aws-service-metrics-monitor-observability-easy">entire end-to-end deployment on AWS</a>. </p></li>
<li><p>Elastic has a simple-to-use <a href="https://www.elastic.co/observability-labs/blog/aws-kinesis-data-firehose-observability-analytics">AWS Firehose integration</a>. </p></li>
<li><p>Elastic’s tools such as <a href="https://www.elastic.co/observability-labs/blog/vpc-flow-logs-monitoring-analytics-observability">Discover, spike analysis,  and anomaly detection help provide you with better insights and analysis</a>.</p></li>
<li><p>And a set of simple <a href="https://www.elastic.co/guide/en/observability/current/monitor-amazon-vpc-flow-logs.html#aws-firehose-dashboard">Out-of-the-box dashboards</a></p></li>
</ol>
<p>In today’s blog, we’ll cover how Elastics’ other features can support analyzing and RCA for potential VPC flow logs even more easily. Specifically, we will focus on managing the number of rejects, as this helps ensure there weren’t any unauthorized or unusual activities:</p>
<ol>
<li><p>Set up an easy-to-use SLO (newly released) to detect when things are potentially degrading</p></li>
<li><p>Create an ML job to analyze different fields of the VPC Flow log</p></li>
<li><p>Using our newly released RAG-based AI Assistant to help analyze the logs without needing to know Elastic’s query language nor how to even graph on Elastic</p></li>
<li><p>ES|QL will help understand and analyze add latency for patterns.</p></li>
</ol>
<p>In subsequent blogs, we will use AI Assistant and ESQL to show how to get other insights beyond just REJECT/ACCEPT from VPC Flow log.</p>
<h2 id="prerequisitesandconfig">Prerequisites and config</h2>
<p>If you plan on following this blog, here are some of the components and details we used to set up this demonstration:</p>
<ul>
<li><p>Ensure you have an account on <a href="http://cloud.elastic.co">Elastic Cloud</a> and a deployed stack (<a href="https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html">see instructions here</a>).</p></li>
<li><p>Follow the steps in the following blog to get <a href="https://github.com/aws-samples/aws-three-tier-web-architecture-workshop">AWS’s three-tier app</a> installed instructed in git, and bring in the <a href="https://www.elastic.co/observability-labs/blog/aws-kinesis-data-firehose-observability-analytics">AWS VPC Flow logs</a>.</p></li>
<li><p>Ensure you have an <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-settings.html">ML node configured</a> in your Elastic stack</p></li>
<li><p>To use the AI Assistant you will need a trial or upgrade to Platinum.</p></li>
</ul>
<h2 id="slowithvpcflowlogs">SLO with VPC Flow Logs</h2>
<p>Elastic’s SLO capability is based directly on the Google SRE Handbook. All the definitions and semantics are utilized as described in Google’s SRE handbook. Hence users can perform the following on SLOs in Elastic:</p>
<ul>
<li>Define an SLO on Logs not just metrics - Users can use KQL (log-based query), service availability, service latency, custom metric, histogram metric, or a timeslice metric.</li>
<li>Define SLO, SLI, Error budget and burn rates. Users can also use occurrence versus time slice-based budgeting. </li>
<li>Manage, with dashboards, all the SLOs in a singular location.</li>
<li>Trigger alerts from the defined SLO, whether the SLI is off, the burn rate is used up, or the error rate is X.</li>
</ul>
<p>Setting up an SLO for VPC is easy. You simply create a query you want to trigger off. In our case, we look for all the good events where <em>aws.vpcflow.action=ACCEPT</em> and we define the target at 85%. </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd21d06910b861cd4/6a7f037f33fa8a81e0202287/VPCFlowSLOsetup.png" alt="Setting up SLO for VPC FLow log" /></p>
<p>As the following example shows, over the last 7 days, we have exceeded our budget by 43%. Additionally, we have not complied for the last 7 days.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltdce0dcb24898fd24/6a7f038296b5a69c6487b03d/VPCFlowSLOMiss.png" alt="VPC Flow Reject SLO" /></p>
<h2 id="analyzingtheslowithaiassistant">Analyzing the SLO with AI Assistant</h2>
<p>Now that we see that there is an issue with the VPC Flows, we immediately work with the AI Assistant to start analyzing the SLO. Because it's a chat interface we simply open the AI Assistant and work through some simple analysis: (See Animated GIF for a demo below)</p>
<h3 id="aiassistantanalysis">AI Assistant analysis:</h3>
<ul>
<li><p><strong>what were the top 3 source.address that had <em>aws.vpcflow.action=REJECT</em> over the last 7 days, which is causing this SLO issue?</strong> - We wanted to simply see what could be causing the loss in error budget. Were there any particular source.addresses causing a heavy reject rate.</p></li>
<li><p>The answer: A table with the highest count = 42670 and <em>source.address = 79.110.62.185</em></p></li>
<li><p>There is one singular <em>source.address</em> that is causing the loss in SLO. </p></li>
<li><p><strong>What is the largest number of  <em>aws.vpcflow.action=REJECT</em> in a 30 min time frame for the last 3 days where the <em>source.address=79.110.62.185</em>?</strong> - After understanding that a specific source.address is causing the loss in SLO, we want to understand the averages. </p></li>
<li><p>**The answer: ** "The largest number of <em>aws.vpcflow.action=REJECT</em> in a 30-minute time frame for the last 3 days where the <em>source.address</em> is 79.110.62.185 is 229. This occurred on 2024-06-01T04:00:00.000Z.”</p></li>
<li><p>It means there must be a low REJECT rate but fairly consistent vs spiky over the last 7 days. </p></li>
<li><p><strong>for the logs with <em>source.address</em>="79.110.62.185" was there any country code of <em>source.geo.country_iso_code</em> field present. If yes what is the value</strong> - Given the last question showed a low REJECT rate, it only means that this was fairly consistent vs spiky over the last 7 days.</p></li>
<li><p><strong>The answer:</strong> Yes, there is a country code present in the <em>source.geo.country_iso_code</em> field for logs with <em>source.address</em>="79.110.62.185". The value is BG (Bulgaria).</p></li>
<li><p><strong>Is there a specific destination.address where <em>source.address=79.110.62.185</em> is getting a <em>aws.vpcflow.action=REJECT</em>. Give me both the destination.address and the number of REJECTs for that destination.address?</strong></p></li>
<li><p><strong>The answer:</strong> destination.address of 10.0.0.27 is giving a reject number of 53433 in this time frame.</p></li>
<li><p><strong>Graph the number of REJECT vs ACCEPT for <em>source.address</em>="79.110.62.185" over the last 7 days. The graph is on a daily basis in a singular graph</strong> - We asked this question to see what the comparison is between ACCEPT and REJECT. </p></li>
<li><p><strong>The answer:</strong> See the animated GIF to see that the generated graph is fairly stable</p></li>
<li><p><strong>Were there any source.address that had a spike, high reject rate in. a 30min period over the 30 days?</strong> - We wanted to see if there was any other spike </p></li>
<li><p><strong>The answer</strong> - Yes, there was a source.address that had a spike in high reject rates in a 30-minute period over the last 30 days. <em>source.address</em>: 185.244.212.67, Reject Count: 8975, Time Period: 2024-05-22T03:00:00.000Z</p></li>
</ul>
<hr />
<h3 id="watchtheflow">Watch the flow</h3>
<div>
    
</div>
<h3 id="potentialissue">Potential issue:</h3>
<p>he server handling requests from source <strong><em>79.110.62.185</em></strong> is potentially having an issue.</p>
<p>Again using logs, we essentially asked the AI Assistant to give the <em>eni</em> ids where the internal ip address was 10.0.0.27</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt2ec3d25d096c3357/6a7f038605b7b5b00a18b519/VPCFlow-findingwebserver.png" alt="Finding the issue - webserver" /></p>
<p>From our AWS console, we know that this is the webserver. Further analysis in Elastic, and with the developers we realized there is a new version that was installed recently causing a problem with connections.</p>
<h2 id="locatinganomalieswithml">Locating anomalies with ML</h2>
<p>While using the AI Assistant is great for analyzing information, another important aspect of VPC flow management is to ensure you can manage log spikes and anomalies. Elastic has a machine learning platform that allows you to develop jobs to analyze specific metrics or multiple metrics to look for anomalies.</p>
<p>VPC Flow logs come with a large amount of information. The full set of fields is listed in <a href="https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-logs-basics">AWS docs</a>. We will use a specific subset to help detect anomalies.</p>
<p>We were setting up anomalies for aws.vpcflow.action=REJECT, which requires us to use multimetric anomaly detection in Elastic.</p>
<p>The config we used utilizes:</p>
<p>Detectors:</p>
<ul>
<li><p>destination.address</p></li>
<li><p>destination.port</p></li>
</ul>
<p>Influencers:</p>
<ul>
<li><p>source.address</p></li>
<li><p>aws.vpcflow.action</p></li>
<li><p>destination.geo.region_iso_code</p></li>
</ul>
<p>The way we set this up will help us understand if there is a large spike in REJECT/ACCEPT against <em>destination.address</em> values from a specific <em>source.address</em> and/or <em>destination.geo.region_iso_code</em> location.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blta48754a0753271b1/6a7f03896c6eac6468f13cdd/VPCFlowanomalysetup.png" alt="Anomaly detection job config" /></p>
<p>The job once run reveals something interesting:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt9f3aee82193c8e44/6a7f038c05b7b54b1718b51d/VPCFlowAnomalyDetection.png" alt="Anomaly detected" /></p>
<p>Notice that <em>source.address</em> 185.244.212.67 has had a high REJECT rate in the last 30 days. </p>
<p>Notice where we found this before? In the AI Assistant!!!!!</p>
<p>While we can run the AI Assistant and find this sort of anomaly, the ML job can be setup to run continuously and alert us on such spikes. This will help us understand if there are any issues with the webserver like we found above or even potential security attacks.</p>
<h2 id="conclusion">Conclusion:</h2>
<p>You’ve now seen how easily Elastic’s RAG-based AI Assistant can help analyze VPC Flows without even the need to know query syntax, understand where the data is, and understand even the fields. Additionally, you’ve also seen how we can alert you when a potential issue or degradation in service (SLO). Check out our other blogs on AWS VPC Flow analysis in Elastic:</p>
<ol>
<li><p>A full set of integrations to manage VPC Flows and the <a href="https://www.elastic.co/observability-labs/blog/aws-service-metrics-monitor-observability-easy">entire end-to-end deployment on AWS</a>. </p></li>
<li><p>Elastic has a simple-to-use <a href="https://www.elastic.co/observability-labs/blog/aws-kinesis-data-firehose-observability-analytics">AWS Firehose integration</a>. </p></li>
<li><p>Elastic’s tools such as <a href="https://www.elastic.co/observability-labs/blog/vpc-flow-logs-monitoring-analytics-observability">Discover, spike analysis,  and anomaly detection help provide you with better insights and analysis</a>.</p></li>
<li><p>And a set of simple <a href="https://www.elastic.co/guide/en/observability/current/monitor-amazon-vpc-flow-logs.html#aws-firehose-dashboard">Out-of-the-box dashboards</a></p></li>
</ol>
<h2 id="tryitout">Try it out</h2>
<p>Existing Elastic Cloud customers can access many of these features directly from the <a href="https://cloud.elastic.co/">Elastic Cloud console</a>. Not taking advantage of Elastic on the cloud? <a href="https://www.elastic.co/cloud/cloud-trial-overview">Start a free trial</a>.</p>
<p>All of this is also possible in your environment. <a href="https://www.elastic.co/observability/universal-profiling">Learn how to get started today</a>.</p>
<p><em>The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.</em></p>
<p><em>In this blog post, we may have used or referred to third party generative AI tools, which are owned and operated by their respective owners. Elastic does not have any control over the third party tools and we have no responsibility or liability for their content, operation or use, nor for any loss or damage that may arise from your use of such tools. Please exercise caution when using AI tools with personal, sensitive or confidential information. Any data you submit may be used for AI training or other purposes. There is no guarantee that information you provide will be kept secure or confidential. You should familiarize yourself with the privacy practices and terms of use of any generative AI tools prior to use.</em></p>
<p><em>Elastic, Elasticsearch, ESRE, Elasticsearch Relevance Engine and associated marks are trademarks, logos or registered trademarks of Elasticsearch N.V. in the United States and other countries. All other company and product names are trademarks, logos or registered trademarks of their respective owners.</em></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/aws-vpc-flow-log-analysis-with-genai-elastic</link>
    <guid isPermaLink="false">aws-vpc-flow-log-analysis-with-genai-elastic</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <category><![CDATA[Infrastructure Monitoring]]></category>
    <category><![CDATA[LLM Observability]]></category>
    <dc:creator><![CDATA[Bahubali Shetti]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5265effb8d313486/6a7f038fde23157404fd7786/21-cubes.jpeg" length="0" type="image/jpeg"/>
    <pubDate>Fri, 07 Jun 2024 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Better RCAs with multi-agent AI Architecture]]></title>
    <description><![CDATA[Discover how specialized LLM agents collaborate to tackle complex tasks with unparalleled efficiency]]></description>
    <content:encoded><![CDATA[<h2 id="whatsamultiagentarchitecture">What’s a multi agent architecture?</h2>
<p>You might have heard the term Agent pop up recently in different open source projects or vendors focusing their go-to-market on GenAI. Indeed, while most GenAI applications are focused on RAG applications today, there is an increasing interest in isolating tasks that could be achieved with a more special model into what is called an Agent.</p>
<p>To be clear, an agent will be given a task, which could be a prompt, and execute the task by leveraging other models, data sources, and a knowledge base. Depending on the field of application, the results should ultimately look like generated text, pictures, charts, or sounds. </p>
<p>Now, what the multi-Agent Architecture, is the process of leveraging multiple agents around a given task by: </p>
<ul>
<li>Orchestrating complex system oversight with multiple agents </li>
<li>Analyzing and strategizing in real-time with strategic reasoning </li>
<li>Specializing agents, tasks are decomposed into smaller focused tasks into expert-handled elements</li>
<li>Sharing insights for cohesive action plans, creating collaborative dynamics</li>
</ul>
<p>In a nutshell, multi-agent architecture's superpower is tackling intricate challenges beyond human speed and solving complex problems. It enables a couple of things:</p>
<ul>
<li>Scale the intelligence as the data and complexity grows. The tasks are decomposed into smaller work units, and the expert network grows accordingly.</li>
<li>Coordinate simultaneous actions across systems, scale collaboration </li>
<li>Evolving with data allows continuous adaptation with new data for cutting-edge decision-making. </li>
<li>Scalability, high performance, and resilience</li>
</ul>
<h2 id="singleagentvsmultiagentarchitecture">Single Agent Vs Multi-Agent Architecture</h2>
<p>Before double-clicking on the multi-agent architecture, let’s talk about the single-agent architecture. The single-agent architecture is designed for straightforward tasks and a late feedback loop from the end user. There are multiple single-agent frameworks such as ReAct (Reason+Act), RAISE (ReAct+ Short/Long term memory), Reflexion, AutoGPT+P, and LATS (Language Agent Tree Search). The general process these architectures enable is as follows:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blta56c5a29be3497ae/6a7f1b4be3a219768599f8d2/single.png" alt="alt_text" /></p>
<p>The Agent takes action, observes, executes, and self-decides whether or not it looks complete, ends the process if finished, or resubmits the new results as an input action, the process keeps going. </p>
<p>While simple tasks are ok with this type of agent, such as a RAG application where a user will ask a question, and the agent returns an answer based on the LLM and a knowledge base, there are a couple of limitations:</p>
<ul>
<li>Endless execution loop: the agent is never satisfied with the output and reiterates. </li>
<li>Hallucinations</li>
<li>Lack of feedback loop or enough data to build a feedback loop</li>
<li>Lack of planning </li>
</ul>
<p>For these reasons, the need for a better self-evaluation loop, externalizing the observation phase, and division of labor is rising, creating the need for a multi-agent architecture.</p>
<p>Multi-agent architecture relies on taking a complex task, breaking it down into multiple smaller tasks, planning the resolution of these tasks, executing, evaluating, sharing insights, and delivering an outcome. For this, there is more than one agent; in fact, the minimum value for the network size N is N=2 with:</p>
<ul>
<li>A Manager </li>
<li>An Expert</li>
</ul>
<p>When N=2, the source task is simple enough only to need one expert agent as the task can not be broken down into multiple tasks. Now, when the task is more complex, this is what the architecture can look like:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt1fa71331f0a0f6e7/6a7f1b4ec2e914577c017002/multi-vertical.png" alt="alt_text" /></p>
<p>With the help of an LLM, the Manager decomposes the tasks and delegates the resolutions to multiple agents. The above architecture is called Vertical since the agents directly send their results to the Manager. In a horizontal architecture, agents work and share insight together as groups, with a volunteer-based system to complete a task, they do not need a leader as shown below:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt66f7b563d6e24eda/6a7f1b51ea068d47d1f0a2db/multi-horizontal.png" alt="alt_text" /></p>
<p>A very good paper covering these two architectures with more insights can be found here: <a href="https://arxiv.org/abs/2404.11584">https://arxiv.org/abs/2404.11584</a></p>
<h2 id="applicationverticalmultiagentarchitecturetoobservability">Application Vertical Multi-Agent Architecture to Observability</h2>
<p>Vertical Multi-Agent Architecture can have a manager, experts, and a communicator. This is particularly important when these architectures expose the task's result to an end user.</p>
<p>In the case of Observability, what we envision in this blog post is the scenario of an SRE running through a Root Cause Analysis (RCA) process. The high-level logic will look like this: </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt3cdc9faa6d124ca8/6a7f1b54b4377058854d7122/maar-observability.png" alt="alt_text" /></p>
<ul>
<li>Communicator: <ul>
<li>Read the initial command from the Human</li>
<li>Pass command to Manager</li>
<li>Provide status updates to Human</li>
<li>Provide a recommended resolution plan to the Human</li>
<li>Relay follow-up commands from Human to Manager</li></ul></li>
<li>Manager: <ul>
<li>Read the initial command from the Communicator </li>
<li>Create working group </li>
<li>Assign Experts to group </li>
<li>Evaluate signals and recommendations from Experts </li>
<li>Generate recommended resolution plan </li>
<li>Execute plan (optional)</li></ul></li>
<li>Expert:<ul>
<li>Each expert task with singular expertise tied to Elastic integration </li>
<li>Use o11y AI Assistant to triage and troubleshoot data related to their expertise </li>
<li>Work with other Experts as needed to correlate issues </li>
<li>Provide recommended root cause analysis for their expertise (if applicable) </li>
<li>Provide recommended resolution plan for their expertise (if applicable)</li></ul></li>
</ul>
<p>We believe that breaking down the experts by integration provides enough granularity in the case of observability and allows them to focus on a specific data source. Doing this also gives the manager a breakdown key when receiving a complex incident involving multiple data layers (application, network, datastores, infrastructures).</p>
<p>For example, a complex task initiated by an alert in an e-commerce application could be “Revenue dropped by 30% in the last hour.” This task would be submitted to the manager, who will look at all services, applications, datastores, network components, and infrastructure involved and decompose these into investigation tasks. Each expert would investigate within their specific scope and provide observations to the manager. The manager will be responsible for correlating and providing observations on what caused the problem. </p>
<h3 id="corearchitecture">Core Architecture</h3>
<p>In the above example, we have decided to deploy the architecture on the below software architecture: </p>
<ul>
<li>The agent manager and expert agent are deployed on GCP or your favorite cloud provider</li>
<li>Most of the components are written in Python</li>
<li>A task management layer is necessary to queue the task to the expert</li>
<li>Expert agents are specifically deployed by integration/data source and converse with the Elastic AI Assistant deployed in Kibana.</li>
<li>The AI Assistant can access a real-time context to help the expert resolve their task.</li>
<li>Elasticsearch is used as the AI Assistant context and as the expert memory to build its experience. </li>
<li>The backend LLM here is GPT-4, now GTP-4o, running on Azure.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5437b38178aa7715/6a7f1b56bdcff0654bc432b7/core-architecture.png" alt="alt_text" /></p>
<h3 id="agentexperience">Agent Experience</h3>
<p>Agent experience is built based on previous events stored in Elasticsearch, to which the expert can look semantically for similar events. When they find one, they get the execution path stored in memory to execute it. </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt338e50db9c705a52/6a7f1b5933fa8a1c25202b92/agent-experience.png" alt="alt_text" /></p>
<p>The beauty of using the Elasticsearch Vector Database for this is the semantic query the agent will be able to execute against the memory and how the memory itself can be managed. Indeed, there is a notion of short—and long-term memory that could be very interesting in the case of observability, where some events often happen and probably worth to be stored in the short-term memory because they are questioned more often. Less queried but important events can be stored in a longer-term memory with more cost-effective hardware.</p>
<p>The other aspect of the Agent Experience is the semantic <a href="https://www.elastic.co/search-labs/blog/semantic-reranking-with-retrievers">reranking</a> feature with Elasticsearch. When the agent executes a task, reranking is used to surface the best outcome compared to past experience:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5e76bee7b41f7fcd/6a7f1b5c42a1179ceb95c32f/agent-experience-build.png" alt="alt_text" /></p>
<p>If you are looking for a working example of the above, <a href="https://www.elastic.co/observability-labs/blog/elastic-ai-assistant-observability-escapes-kibana">check this blog post</a> where 2 agents are working together with the Elastic Observability AI Assistant on an RCA: </p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt45576f30f39e21b9/6a7f1b5f96b5a66af087b8ad/ops-burger.png" alt="alt_text" /></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/super-agent-architecture</link>
    <guid isPermaLink="false">super-agent-architecture</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[Infrastructure Monitoring]]></category>
    <dc:creator><![CDATA[Baha Azarmi,Jeff Vestal]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5a10b1f962d70c57/6a7f1b6277b03421073ff91d/githubcopilot-aiassistant.png" length="0" type="image/png"/>
    <pubDate>Fri, 31 May 2024 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Enhancing SRE troubleshooting with the AI Assistant for Observability and your organization's runbooks]]></title>
    <description><![CDATA[Empower your SRE team with this guide to enriching Elastic's AI Assistant Knowledge Base with your organization's internal observability information for enhanced alert remediation and incident management.]]></description>
    <content:encoded><![CDATA[<p>The <a href="https://www.elastic.co/blog/context-aware-insights-elastic-ai-assistant-observability">Observability AI Assistant</a> helps users explore and analyze observability data using a natural language interface, by leveraging automatic function calling to request, analyze, and visualize your data to transform it into actionable observability. The Assistant can also set up a Knowledge Base, powered by <a href="https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html">Elastic Learned Sparse EncodeR</a> (ELSER) to provide additional context and recommendations from private data, alongside the large language models (LLMs) using RAG (Retrieval Augmented Generation). Elastic’s Stack — as a vector database with out-of-the-box semantic search and connectors to LLM integrations and the Observability solution — is the perfect toolkit to extract the maximum value of combining your company's unique observability knowledge with generative AI.</p>
<h2 id="enhancedtroubleshootingforsres">Enhanced troubleshooting for SREs</h2>
<p>Site reliability engineers (SRE) in large organizations often face challenges in locating necessary information for troubleshooting alerts, monitoring systems, or deriving insights due to scattered and potentially outdated resources. This issue is particularly significant for less experienced SREs who may require assistance even with the presence of a runbook. Recurring incidents pose another problem, as the on-call individual may lack knowledge about previous resolutions and subsequent steps. Mature SRE teams often invest considerable time in system improvements to minimize "fire-fighting," utilizing extensive automation and documentation to support on-call personnel.</p>
<p>Elastic® addresses these challenges by combining generative AI models with relevant search results from your internal data using RAG. The <a href="https://www.elastic.co/guide/en/observability/current/obs-ai-assistant.html">Observability AI Assistant's internal Knowledge Base</a>, powered by our semantic search retrieval model <a href="https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html">ELSER</a>, can recall information at any point during a conversation, providing RAG responses based on internal knowledge.</p>
<p>This Knowledge Base can be enriched with your organization's information, such as runbooks, GitHub issues, internal documentation, and Slack messages, allowing the AI Assistant to provide specific assistance. The Assistant can also document and store specific information from an ongoing conversation with an SRE while troubleshooting issues, effectively creating runbooks for future reference. Furthermore, the Assistant can generate summaries of incidents, system status, runbooks, post-mortems, or public announcements.</p>
<p>This ability to retrieve, summarize, and present contextually relevant information is a game-changer for SRE teams, transforming the work from chasing documents and data to an intuitive, contextually sensitive user experience.The Knowledge Base (see <a href="https://www.elastic.co/guide/en/observability/current/obs-ai-assistant.html#obs-ai-requirements">requirements</a>) serves as a central repository of Observability knowledge, breaking documentation silos and integrating tribal knowledge, making this information accessible to SREs enhanced with the power of LLMs.</p>
<p>Your LLM provider may collect query telemetry when using the AI Assistant. If your data is confidential or has sensitive details, we recommend you verify the data treatment policy of the LLM connector you provided to the AI Assistant.</p>
<p>In this blog post, we will cover different ways to enrich your Knowledge Base (KB) with internal information. We will focus on a specific alert, indicating that there was an increase in logs with “502 Bad Gateway” errors that has surpassed the alert’s threshold.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt432418d2871ff281/6a7f1b0873d9bd18b729df69/elastic-blog-1.png" alt="1 - threshold breached" /></p>
<h2 id="howtotroubleshootanalertwiththeknowledgebase">How to troubleshoot an alert with the Knowledge Base</h2>
<p>Before the KB has been enriched with internal information, when the SRE asks the AI Assistant about how to troubleshoot an alert, the response from the LLM will be based on the data it learned during training; however, the LLM is not able to answer questions related to private, recent, or emerging knowledge. In this case, when asking for the steps to troubleshoot the alert, the response will be based on generic information.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf2577ea1ce6b71b1/6a7f1b0b05b7b519c318bd51/elastic-blog-2.png" alt="2 - troubleshooting steps" /></p>
<p>However, once the KB has been enriched with your runbooks, when your team receives a new alert on “502 Bad Gateway” Errors, they can use AI Assistant to access the internal knowledge to troubleshoot it, using semantic search to find the appropriate runbook in the Knowledge Base.</p>
<p>In this blog, we will cover different ways to add internal information on how to troubleshoot an alert to the Knowledge Base:</p>
<ol>
<li><p>Ask the assistant to remember the content of an existing runbook.</p></li>
<li><p>Ask the Assistant to summarize and store in the Knowledge Base the steps taken during a conversation and store it as a runbook.</p></li>
<li><p>Import your runbooks from GitHub or another external source to the Knowledge Base using our Connector and APIs.</p></li>
</ol>
<p>After the runbooks have been added to the KB, the AI Assistant is now able to recall the internal and specific information in the runbooks. By leveraging the retrieved information, the LLM could provide more accurate and relevant recommendations for troubleshooting the alert. This could include suggesting potential causes for the alert, steps to resolve the issue, preventative measures for future incidents, or asking the assistant to help execute the steps mentioned in the runbook using functions. With more accurate and relevant information at hand, the SRE could potentially resolve the alert more quickly, reducing downtime and improving service reliability.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blte9f381e6f96debcb/6a7f1b0e73d9bd5ba529df6d/Screenshot_2023-11-10_at_9.52.38_AM.png" alt="3 - troubleshooting 502 Bad gateway" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltb7975cbd842b6cd8/6a7f1b11c2e91480da016ffa/elastic-blog-4.png" alt="4 - (5) test the backend directly" /></p>
<p>Your Knowledge Base documents will be stored in the indices <em>.kibana-observability-ai-assistant-kb-</em>*. Have in mind that LLMs have restrictions on the amount of information the model can read and write at once, called token limit. Imagine you're reading a book, but you can only remember a certain number of words at a time. Once you've reached that limit, you start to forget the earlier words you've read. That's similar to how a token limit works in an LLM.</p>
<p>To keep runbooks within the token limit for Retrieval Augmented Generation (RAG) models, ensure the information is concise and relevant. Use bullet points for clarity, avoid repetition, and use links for additional information. Regularly review and update the runbooks to remove outdated or irrelevant information. The goal is to provide clear, concise, and effective troubleshooting information without compromising the quality due to token limit constraints. LLMs are great for summarization, so you could ask the AI Assistant to help you make the runbooks more concise.</p>
<h2 id="asktheassistanttorememberthecontentofanexistingrunbook">Ask the assistant to remember the content of an existing runbook</h2>
<p>The easiest way to store a runbook into the Knowledge Base is to just ask the AI Assistant to do it! Open a new conversation and ask “Can you store this runbook in the KB for future reference?” followed by pasting the content of the runbook in plain text.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt88e751fe6aabf649/6a7f1b146c6eac1f20f145b5/elastic-blog-5.png" alt="5 - new conversation - let's work on this together" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltcbdbc2440f80ddda/6a7f1b1696b5a6f0e687b89f/elastic-blog-6.png" alt="6 - new converastion" /></p>
<p>The AI Assistant will then store it in the Knowledge Base for you automatically, as simple as that.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt678daca55cfe0ff7/6a7f1b19fc63ab131a64d08e/elastic-blog-7.png" alt="7 - storing a runbook" /></p>
<h2 id="asktheassistanttosummarizeandstorethestepstakenduringaconversationintheknowledgebase">Ask the Assistant to summarize and store the steps taken during a conversation in the Knowledge Base</h2>
<p>You can also ask the AI Assistant to remember something while having a conversation — for example, after you have troubleshooted an alert using the AI Assistant, you could ask to "remember how to troubleshoot this alert for next time." The AI Assistant will create a summary of the steps taken to troubleshoot the alert and add it to the Knowledge Base, effectively creating runbooks for future reference. Next time you are faced with a similar situation, the AI Assistant will recall this information and use it to assist you.</p>
<p>In the following demo, the user asks the Assistant to remember the steps that have been followed to troubleshoot the root cause of an alert, and also to ping the Slack channel when this happens again. In a later conversation with the Assistant, the user asks what can be done about a similar problem, and the AI Assistant is able to remember the steps and also reminds the user to ping the Slack channel.</p>
<p>After receiving the alert, you can open the AI Assistant chat and test troubleshooting the alert. After investigating an alert, ask the AI Assistant to summarize the analysis and the steps taken to root cause. To remember them for the next time, we have a similar alert and add extra instruction like to warn the Slack channel.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt59ebedea4c01cbd8/6a7f1b1dbd21980b3c7584bf/elastic-blog-8.png" alt="8. -teal box" /></p>
<p>The Assistant will use the built-in functions to summarize the steps and store them into your Knowledge Base, so they can be recalled in future conversations.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt3ab3c30c33361206/6a7f1b20c2cc0977992499ca/Screenshot_2023-11-08_at_11.34.08_AM.png" alt="9 - Elastic assistant chat (CROP)" /></p>
<p>Open a new conversation, and ask what are the steps to take when troubleshooting a similar alert to the one we just investigated. The Assistant will be able to recall the information stored in the KB that is related to the specific alert, using semantic search based on <a href="https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html">ELSER</a>, and provide a summary of the steps taken to troubleshoot it, including the last indication of informing the Slack channel.</p>
<div>
    
</div>
<h2 id="importyourrunbooksstoredingithubtotheknowledgebaseusingapisorourgithubconnector">Import your runbooks stored in GitHub to the Knowledge Base using APIs or our GitHub Connector</h2>
<p>You can also add proprietary data into the Knowledge Base programmatically by ingesting it (e.g., GitHub Issues, Markdown files, Jira tickets, text files) into Elastic.</p>
<p>If your organization has created runbooks that are stored in Markdown documents in GitHub, follow the steps in the next section of this blog post to index the runbook documents into your Knowledge Base.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt55e94e2bbca1d4c5/6a7f1b23ead8ec8c11baac5e/elastic-blog-10.png" alt="10 - github handling 502" /></p>
<p>The steps to ingest documents into the Knowledge Base are the following:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blte50ccc306ed43ff6/6a7f1b26227b1cac36598a09/elastic-blog-11.png" alt="11 - using internal knowledge" /></p>
<h3 id="ingestyourorganizationsknowledgeintoelasticsearch">Ingest your organization’s knowledge into Elasticsearch</h3>
<p><strong>Option 1:</strong> <strong>Use the</strong> <a href="https://www.elastic.co/guide/en/enterprise-search/current/crawler.html"><strong>Elastic web crawler</strong></a> <strong>.</strong> Use the web crawler to programmatically discover, extract, and index searchable content from websites and knowledge bases. When you ingest data with the web crawler, a search-optimized <a href="https://www.elastic.co/blog/what-is-an-elasticsearch-index">Elasticsearch® index</a> is created to hold and sync webpage content.</p>
<p><strong>Option 2: Use Elasticsearch's</strong> <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html"><strong>Index API</strong></a> <strong>.</strong> <a href="https://www.elastic.co/guide/en/cloud/current/ec-ingest-guides.html">Watch tutorials</a> that demonstrate how you can use the Elasticsearch language clients to ingest data from an application.</p>
<p><strong>Option 3: Build your own connector.</strong> Follow the steps described in this blog: <a href="https://www.elastic.co/search-labs/how-to-create-customized-connectors-for-elasticsearch">How to create customized connectors for Elasticsearch</a>.</p>
<p><strong>Option 4: Use Elasticsearch</strong> <a href="https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources.html"><strong>Workplace Search connectors</strong></a> <strong>.</strong> For example, the <a href="https://www.elastic.co/guide/en/workplace-search/current/workplace-search-github-connector.html">GitHub connector</a> can automatically capture, sync, and index issues, Markdown files, pull requests, and repos.</p>
<ul>
<li>Follow the steps to <a href="https://www.elastic.co/guide/en/workplace-search/current/workplace-search-github-connector.html#github-configuration">configure the GitHub Connector in GitHub</a> to create an OAuth App from the GitHub platform.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt934623424f99c138/6a7f1b29bd21985ea47584c3/elastic-blog-12.png" alt="12 - elastic workplace search" /></p>
<ul>
<li>Now you can connect a GitHub instance to your organization. Head to your organization’s <strong>Search &gt; Workplace Search</strong> administrative dashboard, and locate the Sources tab.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt562317ca772f6b3d/6a7f1b2ceab5be27ce20ab08/Screenshot_2023-11-08_at_10.19.19_AM.png" alt="13 - screenshot" /></p>
<ul>
<li>Select <strong>GitHub</strong> (or GitHub Enterprise) in the Configured Sources list, and follow the GitHub authentication flow as presented. Upon the successful authentication flow, you will be redirected to Workplace Search and will be prompted to select the Organization you would like to synchronize.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt6c465cdefe93ce4d/6a7f1b2fde231504f2fd80af/elastic-blog-14.png" alt="14 - configure and connect" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt54d1b7727cb79ab9/6a7f1b32eab5be3b6220ab0c/elastic-blog-15.png" alt="15 - how to add github" /></p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf86ab1779e93317c/6a7f1b35bdcff09009c432af/elastic-blog-16.png" alt="16 - github" /></p>
<ul>
<li>After configuring the connector and selecting the organization, the content should be synchronized and you will be able to see it in Sources. If you don’t need to index all the available content, you can specify the indexing rules via the API. This will help shorten indexing times and limit the size of the index. See <a href="https://www.elastic.co/guide/en/workplace-search/current/workplace-search-customizing-indexing-rules.html">Customizing indexing</a>.</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltded840b7b410baf3/6a7f1b37eab5be779e20ab10/elastic-blog-17.png" alt="17 - source overview" /></p>
<ul>
<li>The source has created an index in Elastic with the content (Issues, Markdown Files…) from your organization. You can find the index name by navigating to <strong>Stack Management &gt; Index Management</strong> , activating the <strong>Include hidden Indices</strong> button on the right, and searching for “GitHub.”</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt22ee12a22538f12f/6a7f1b3b05b7b517f518bd55/elastic-blog-18.png" alt="18 - index mgmt" /></p>
<ul>
<li>You can explore the documents you have indexed by creating a Data View and exploring it in Discover. Go to <strong>Stack Management &gt; Kibana &gt; Data Views &gt; Create data view</strong> and introduce the data view Name, Index pattern (make sure you activate “Allow hidden and system indices” in advanced options), and Timestamp field:</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt10bb270db2987d53/6a7f1b3eb437702e514d711e/elastic-blog-19.png" alt="19 - create data view" /></p>
<ul>
<li>You can now explore the documents in Discover using the data view:</li>
</ul>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt0626e95bf462405f/6a7f1b4142a11770e795c32b/elastic-blog-20.png" alt="20 - data view" /></p>
<h3 id="reindexyourinternalrunbooksintotheaiassistantsknowledgebaseindexusingitssemanticsearchpipeline">Reindex your internal runbooks into the AI Assistant’s Knowledge Base Index, using it's semantic search pipeline</h3>
<p>Your Knowledge Base documents are stored in the indices <em>.kibana-observability-ai-assistant-kb-*</em>. To add your internal runbooks imported from GitHub to the KB, you just need to reindex the documents from the index you created in the previous step to the KB’s index. To add the semantic search capabilities to the documents in the KB, the reindex should also use the ELSER pipeline preconfigured for the KB, <em>.kibana-observability-ai-assistant-kb-ingest-pipeline</em>.</p>
<p>By creating a Data View with the KB index, you can explore the content in Discover.</p>
<p>You execute the query below in <strong>Management &gt; Dev Tools</strong> , making sure to replace the following, both on “_source” and “inline”:</p>
<ul>
<li>InternalDocsIndex : name of the index where your internal docs are stored</li>
<li>text_field : name of the field with the text of your internal docs</li>
<li>timestamp : name of the field of the timestamp in your internal docs</li>
<li>public : (true or false) if true, makes a document available to all users in the defined <a href="https://www.elastic.co/guide/en/kibana/current/xpack-spaces.html">Kibana Space</a> (if is defined) or in all spaces (if is not defined); if false, document will be restricted to the user indicated in</li>
<li>(optional) space : if defined, restricts the internal document to be available in a specific <a href="https://www.elastic.co/guide/en/kibana/current/xpack-spaces.html">Kibana Space</a></li>
<li>(optional) user.name : if defined, restricts the internal document to be available for a specific user</li>
<li>(optional) "query" filter to index only certain docs (see below)</li>
</ul>
<pre><code>POST _reindex
{
    "source": {
        "index": "&lt;InternalDocsIndex&gt;",
        "_source": [
            "&lt;text_field&gt;",
            "&lt;timestamp&gt;",
            "namespace",
            "is_correction",
            "public",
            "confidence"
        ]
    },
    "dest": {
        "index": ".kibana-observability-ai-assistant-kb-000001",
        "pipeline": ".kibana-observability-ai-assistant-kb-ingest-pipeline"
    },
    "script": {
        "inline": "ctx._source.text=ctx._source.remove(\"&lt;text_field&gt;\");ctx._source.namespace=\"&lt;space&gt;\";ctx._source.is_correction=false;ctx._source.public=&lt;public&gt;;ctx._source.confidence=\"high\";ctx._source['@timestamp']=ctx._source.remove(\"&lt;timestamp&gt;\");ctx._source['user.name'] = \"&lt;user.name&gt;\""
    }
}
</code></pre>
<p>You may want to specify the type of documents that you reindex in the KB — for example, you may only want to reindex Markdown documents (like Runbooks). You can add a “query” filter to the documents in the source. In the case of GitHub, runbooks are identified with the “type” field containing the string “file,” and you could add that to the reindex query like indicated below. To add also GitHub Issues, you can also include in the query “type” field containing the string “issues”:</p>
<pre><code>"source": {
        "index": "&lt;InternalDocsIndex&gt;",
        "_source": [
            "&lt;text_field&gt;",
            "&lt;timestamp&gt;",
            "namespace",
            "is_correction",
            "public",
            "confidence"
        ],
    "query": {
      "terms": {
        "type": ["file"]
      }
    }
</code></pre>
<p>Great! Now that the data is stored in your Knowledge Base, you can ask the Observability AI Assistant any questions about it:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blta473e0043f5dbf04/6a7f1b442f00b25aabefef31/elastic-blog-21.png" alt="21 - new conversation" /></p>
<div>
    
</div>
<div>
    
</div>
<h2 id="conclusion">Conclusion</h2>
<p>In conclusion, leveraging internal Observability knowledge and adding it to the Elastic Knowledge Base can greatly enhance the capabilities of the AI Assistant. By manually inputting information or programmatically ingesting documents, SREs can create a central repository of knowledge accessible through the power of Elastic and LLMs. The AI Assistant can recall this information, assist with incidents, and provide tailored observability to specific contexts using Retrieval Augmented Generation. By following the steps outlined in this article, organizations can unlock the full potential of their Elastic AI Assistant.</p>
<p><a href="https://www.elastic.co/generative-ai/ai-assistant">Start enriching your Knowledge Base with the Elastic AI Assistant today</a> and empower your SRE team with the tools they need to excel. Follow the steps outlined in this article and take your incident management and alert remediation processes to the next level. Your journey toward a more efficient and effective SRE operation begins now.</p>
<p><em>The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.</em></p>
<p><em>In this blog post, we may have used or referred to third party generative AI tools, which are owned and operated by their respective owners. Elastic does not have any control over the third party tools and we have no responsibility or liability for their content, operation or use, nor for any loss or damage that may arise from your use of such tools. Please exercise caution when using AI tools with personal, sensitive or confidential information. Any data you submit may be used for AI training or other purposes. There is no guarantee that information you provide will be kept secure or confidential. You should familiarize yourself with the privacy practices and terms of use of any generative AI tools prior to use.</em></p>
<p><em>Elastic, Elasticsearch, ESRE, Elasticsearch Relevance Engine and associated marks are trademarks, logos or registered trademarks of Elasticsearch N.V. in the United States and other countries. All other company and product names are trademarks, logos or registered trademarks of their respective owners.</em></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/sre-troubleshooting-ai-assistant-observability-runbooks</link>
    <guid isPermaLink="false">sre-troubleshooting-ai-assistant-observability-runbooks</guid>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[OpenTelemetry]]></category>
    <category><![CDATA[Kubernetes]]></category>
    <category><![CDATA[AI]]></category>
    <category><![CDATA[LLM Observability]]></category>
    <dc:creator><![CDATA[Almudena Sanz Olivé,Katrin Freihofner,Tom Grabowski]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt2d0f6fc2d38fa05b/6a7f1b47bd21987d717584c9/11-hand.jpg" length="0" type="image/jpeg"/>
    <pubDate>Wed, 08 Nov 2023 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Optimizing Observability with ES|QL: Streamlining SRE operations and issue resolution for Kubernetes and OTel]]></title>
    <description><![CDATA[ES|QL enhances operational efficiency, data analysis, and issue resolution for SREs. This blog covers the advantages of ES|QL in Elastic Observability and how it can apply to managing issues instrumented with OpenTelemetry and running on Kubernetes.]]></description>
    <content:encoded><![CDATA[<p>As an operations engineer (SRE, IT Operations, DevOps), managing technology and data sprawl is an ongoing challenge. Simply managing the large volumes of high dimensionality and high cardinality data is overwhelming.</p>
<p>As a single platform, Elastic® helps SREs unify and correlate limitless telemetry data, including metrics, logs, traces, and profiling, into a single datastore — Elasticsearch®. By then applying the power of Elastic’s advanced machine learning (ML), AIOps, AI Assistant, and analytics, you can break down silos and turn data into insights. As a full-stack observability solution, everything from infrastructure monitoring to log monitoring and application performance monitoring (APM) can be found in a single, unified experience.</p>
<p>In Elastic 8.11, a technical preview is now available of <a href="https://www.elastic.co/blog/esql-elasticsearch-piped-query-language">Elastic’s new piped query language, ES|QL (Elasticsearch Query Language)</a>, which transforms, enriches, and simplifies data investigations. Powered by a new query engine, ES|QL delivers advanced search capabilities with concurrent processing, improving speed and efficiency, irrespective of data source and structure. Accelerate resolution by creating aggregations and visualizations from one screen, delivering an iterative, uninterrupted workflow.</p>
<h2 id="advantagesofesqlforsres">Advantages of ES|QL for SREs</h2>
<p>SREs using Elastic Observability can leverage ES|QL to analyze logs, metrics, traces, and profiling data, enabling them to pinpoint performance bottlenecks and system issues with a single query. SREs gain the following advantages when managing high dimensionality and high cardinality data with ES|QL in Elastic Observability:</p>
<ul>
<li><strong>Improved operational efficiency:</strong> By using ES|QL, SREs can create more actionable notifications with aggregated values as thresholds from a single query, which can also be managed through the Elastic API and integrated into DevOps processes.</li>
<li><strong>Enhanced analysis with insights:</strong> ES|QL can process diverse observability data, including application, infrastructure, business data, and more, regardless of the source and structure. ES|QL can easily enrich the data with additional fields and context, allowing the creation of visualizations for dashboards or issue analysis with a single query.</li>
<li><strong>Reduced mean time to resolution:</strong> ES|QL, when combined with Elastic Observability's AIOps and AI Assistant, enhances detection accuracy by identifying trends, isolating incidents, and reducing false positives. This improvement in context facilitates troubleshooting and the quick pinpointing and resolution of issues.</li>
</ul>
<p>ES|QL in Elastic Observability not only enhances an SRE's ability to manage the customer experience, an organization's revenue, and SLOs more effectively but also facilitates collaboration with developers and DevOps by providing contextualized aggregated data.</p>
<p>In this blog, we will cover some of the key use cases SREs can leverage with ES|QL:</p>
<ul>
<li>ES|QL integrated with the Elastic AI Assistant, which uses public LLM and private data, enhances the analysis experience anywhere in Elastic Observability.</li>
<li>SREs can, in a single ES|QL query, break down, analyze, and visualize observability data from multiple sources and across any time frame.</li>
<li>Actionable alerts can be easily created from a single ES|QL query, enhancing operations.</li>
</ul>
<p>I will work through these use cases by showcasing how an SRE can solve a problem in an application instrumented with OpenTelemetry and running on Kubernetes. The OpenTelemetry (OTel) demo is on an Amazon EKS cluster, with Elastic Cloud 8.11 configured.</p>
<p>You can also check out our <a href="https://www.youtube.com/watch?v=vm0pBWI2l9c">Elastic Observability ES|QL Demo</a>, which walks through ES|QL functionality for Observability.</p>
<h2 id="esqlwithaiassistant">ES|QL with AI Assistant</h2>
<p>As an SRE, you are monitoring your OTel instrumented application with Elastic Observability, and while in Elastic APM, you notice some issues highlighted in the service map.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt67931374daecc7f2/6a85cdd8eaf2450312a49fab/elastic-blog-1-services.png" alt="1 - services" /></p>
<p>Using Elastic AI Assistant, you can easily ask for analysis, and in particular, we check on what the overall latency is across the application services.</p>
<pre><code>My APM data is in traces-apm*. What's the average latency per service over the last hour? Use ESQL, the data is mapped to ECS
</code></pre>
<div>
    
</div>
<p>The Elastic AI Assistant generates an ES|QL query, which we run in the AI Assistant to get a list of the average latencies across all the application services. We can easily see the top four are:</p>
<ul>
<li>load generator</li>
<li>front-end proxy</li>
<li>frontendservice</li>
<li>checkoutservice</li>
</ul>
<p>With a simple natural language query in the AI Assistant, it generated a single ES|QL query that helped list out the latencies across the services.</p>
<p>Noticing that there is an issue with several services, we decide to start with the frontend proxy. As we work through the details, we see significant failures, and through <strong>Elastic APM failure correlation</strong> , it becomes apparent that the frontend proxy is not properly completing its calls to downstream services.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt497215d42651cc18/6a85cddbd7b2e75e41fe853e/elastic-blog-2-failed-transaction.png" alt="2 - failed transaction" /></p>
<h2 id="esqlinsightfulandcontextualanalysisindiscover">ES|QL insightful and contextual analysis in Discover</h2>
<p>Knowing that the application is running on Kubernetes, we investigate if there are issues in Kubernetes. In particular, we want to see if there are any services having issues.</p>
<p>We use the following query in ES|QL in Elastic Discover:</p>
<pre><code>from metrics-* | where kubernetes.container.status.last_terminated_reason != "" and kubernetes.namespace == "default" | stats reason_count=count(kubernetes.container.status.last_terminated_reason) by kubernetes.container.name, kubernetes.container.status.last_terminated_reason | where reason_count &gt; 0
</code></pre>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt837d9acfc045bf02/6a85cddeeaf245c0cea49faf/elastic-blog-3-two-horizontal-bar-graphs.png" alt="3 - horizontal graph" /></p>
<p>ES|QL helps analyze 1,000s/10,000s of metric events from Kubernetes and highlights two services that are restarting due to OOMKilled.</p>
<p>The Elastic AI Assistant, when asked about OOMKilled, indicates that a container in a pod was killed due to an out-of-memory condition.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt4e0b7f31ffb0e6f7/6a85cde1501a854b28fbb38d/elastic-blog-4-understanding-oomkilled.png" alt="4 - understanding oomkilled" /></p>
<p>We run another ES|QL query to understand the memory usage for emailservice and productcatalogservice.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf8feafaa0a4b2fa6/6a85cde4d7b2e78477fe8542/elastic-blog-5-split-bar-graphs.png" alt="5 - split bar graphs" /></p>
<p>ES|QL easily found the average memory usage fairly high.</p>
<p>We can now further investigate both of these services’ logs, metrics, and Kubernetes-related data. However, before we continue, we create an alert to track heavy memory usage.</p>
<h2 id="actionablealertswithesql">Actionable alerts with ES|QL</h2>
<p>Suspecting a specific issue, that might recur, we simply create an alert that brings in the ES|QL query we just ran that will track for any service that exceeds 50% in memory utilization.</p>
<p>We modify the last query to find any service with high memory usage:</p>
<pre><code>FROM metrics*
| WHERE @timestamp &gt;= NOW() - 1 hours
| STATS avg_memory_usage = AVG(kubernetes.pod.memory.usage.limit.pct) BY kubernetes.deployment.name | where avg_memory_usage &gt; .5
</code></pre>
<p>With that query, we create a simple alert. Notice how the ES|QL query is brought into the alert. We simply connect this to pager duty. But we can choose from multiple connectors like ServiceNow, Opsgenie, email, etc.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt16f1d7ecefc9df0f/6a85cde627c5cd53fd5f7450/elastic-blog-6-create-rule.png" alt="6 - create rule" /></p>
<p>With this alert, we can now easily monitor for any services that exceed 50% memory utilization in their pods.</p>
<h2 id="makethemostofyourdatawithesql">Make the most of your data with ES|QL</h2>
<p>In this post, we demonstrated the power ES|QL brings to analysis, operations, and reducing MTTR. In summary, the three use cases with ES|QL in Elastic Observability are as follows:</p>
<ul>
<li>ES|QL integrated with the Elastic AI Assistant, which uses public LLM and private data, enhances the analysis experience anywhere in Elastic Observability.</li>
<li>SREs can, in a single ES|QL query, break down, analyze, and visualize observability data from multiple sources and across any time frame.</li>
<li>Actionable alerts can be easily created from a single ES|QL query, enhancing operations.</li>
</ul>
<p>Elastic invites SREs and developers to experience this transformative language firsthand and unlock new horizons in their data tasks. Try it today at <a href="https://ela.st/free-trial">https://ela.st/free-trial</a> now in technical preview.</p>
<blockquote>
  <ul>
  <li><a href="https://www.elastic.co/demo-gallery/observability">Elastic Observability Tour</a></li>
  <li><a href="https://www.elastic.co/blog/log-management-observability-operations">The power of effective log management</a></li>
  <li><a href="https://www.elastic.co/blog/context-aware-insights-elastic-ai-assistant-observability">Transforming Observability with the AI Assistant</a></li>
  <li><a href="https://www.elastic.co/blog/esql-elasticsearch-piped-query-language">ES|QL announcement blog</a></li>
  </ul>
</blockquote>
<p><em>The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.</em></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/opentelemetry-kubernetes-esql</link>
    <guid isPermaLink="false">opentelemetry-kubernetes-esql</guid>
    <category><![CDATA[Kubernetes]]></category>
    <category><![CDATA[OpenTelemetry]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <category><![CDATA[Agentic Observability]]></category>
    <category><![CDATA[LLM Observability]]></category>
    <dc:creator><![CDATA[Bahubali Shetti]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd21cab120ad20933/6a85cde980984ce0f666902e/ES_QL_blog-720x420-05.png" length="0" type="image/png"/>
    <pubDate>Wed, 01 Nov 2023 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Root cause analysis with logs: Elastic Observability's AIOps Labs]]></title>
    <description><![CDATA[Elastic Observability provides more than just log aggregation, metrics analysis, APM, and distributed tracing. Our machine learning-based AIOps capabilities help you analyze the root cause of issues allowing you to focus on the most important tasks.]]></description>
    <content:encoded><![CDATA[<p>In the <a href="https://www.elastic.co/blog/reduce-mttd-ml-machine-learning-observability">previous blog</a> in our root cause analysis with logs series, we explored how to analyze logs in Elastic Observability with Elastic’s anomaly detection and log categorization capabilities. Elastic’s platform enables you to get started on machine learning (ML) quickly. You don’t need to have a data science team or design a system architecture. Additionally, there’s no need to move data to a third-party framework for model training.</p>
<p>Preconfigured <a href="https://www.elastic.co/blog/may-2023-launch-machine-learning-models">machine learning models</a> for observability and security are available. If those don't work well enough on your data, in-tool wizards guide you through the few steps needed to configure custom anomaly detection and train your model with supervised learning. To get you started, there are several key features built into Elastic Observability to aid in analysis, bypassing the need to run specific ML models. These features help minimize the time and analysis of logs.</p>
<p>Let’s review the set of machine learning-based observability features in Elastic:</p>
<p><strong>Anomaly detection:</strong> Elastic Observability, when turned on (<a href="https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html">see documentation</a>), automatically detects anomalies by continuously modeling the normal behavior of your time series data — learning trends, periodicity, and more — in real time to identify anomalies, streamline root cause analysis, and reduce false positives. Anomaly detection runs in and scales with Elasticsearch and includes an intuitive UI.</p>
<p><strong>Log categorization:</strong> Using anomaly detection, Elastic also identifies patterns in your log events quickly. Instead of manually identifying similar logs, the logs categorization view lists log events that have been grouped, based on their messages and formats, so that you can take action more quickly.</p>
<p><strong>High-latency or erroneous transactions:</strong> Elastic Observability’s APM capability helps you discover which attributes are contributing to increased transaction latency and identifies which attributes are most influential in distinguishing between transaction failures and successes. Read <a href="https://www.elastic.co/blog/apm-correlations-elastic-observability-root-cause-transactions">APM correlations in Elastic Observability: Automatically identifying probable causes of slow or failed transactions</a> for an overview of this capability.</p>
<p><strong>AIOps Labs:</strong> AIOps Labs provides two main capabilities using advanced statistical methods:</p>
<ul>
<li><strong>Log spike detector</strong> helps identify reasons for increases in log rates. It makes it easy to find and investigate the causes of unusual spikes by using the analysis workflow view. Examine the histogram chart of the log rates for a given data view, and find the reason behind a particular change possibly in millions of log events across multiple fields and values.</li>
<li><strong>Log pattern analysis</strong> helps you find patterns in unstructured log messages and makes it easier to examine your data. It performs categorization analysis on a selected field of a data view, creates categories based on the data, and displays them together with a chart that shows the distribution of each category and an example document that matches the category.</li>
</ul>
<p>As we showed in the <a href="https://www.elastic.co/blog/reduce-mttd-ml-machine-learning-observability">last blog</a>, using machine learning-based features helps minimize the extremely tedious and time-consuming process of analyzing data using traditional methods, such as alerting and simple pattern matching (visual or simple searching, etc.). Trying to find the needle in the haystack requires the use of some level of artificial intelligence due to the increasing amounts of telemetry data (logs, metrics, and traces) being collected across ever-growing applications.</p>
<p>In this blog post, we’ll cover two capabilities found in Elastic’s AIOps Labs: log spike detector and log pattern analysis. We’ll use the same data from the previous blog and analyze it using these two capabilities.</p>
<p> <strong>We will cover log spike detector and log pattern analysis against the popular Hipster Shop app developed by Google, and modified recently by OpenTelemetry.</strong> </p>
<p>Overviews of high-latency capabilities can be found <a href="https://www.elastic.co/blog/apm-correlations-elastic-observability-root-cause-transactions">here</a>, and an overview of AIOps labs can be found <a href="https://www.youtube.com/watch?v=jgHxzUNzfhM&amp;list=PLhLSfisesZItlRZKgd-DtYukNfpThDAv_&amp;index=5">here</a>.</p>
<p>Below, we will examine a scenario where we use anomaly detection and log categorization to help identify a root cause of an issue in Hipster Shop.</p>
<h2 id="prerequisitesandconfig">Prerequisites and config</h2>
<p>If you plan on following this blog, here are some of the components and details we used to set up this demonstration:</p>
<ul>
<li>Ensure you have an account on <a href="http://cloud.elastic.co">Elastic Cloud</a> and a deployed stack (<a href="https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html">see instructions here</a>) on AWS. Deploying this on AWS is required for Elastic Serverless Forwarder.</li>
<li>Utilize a version of the popular <a href="https://github.com/GoogleCloudPlatform/microservices-demo">Hipster Shop</a> demo application. It was originally written by Google to showcase Kubernetes across a multitude of variants available, such as the <a href="https://github.com/open-telemetry/opentelemetry-demo">OpenTelemetry Demo App</a>. The Elastic version is found <a href="https://github.com/elastic/opentelemetry-demo">here</a>.</li>
<li>Ensure you have configured the app for either Elastic APM agents or OpenTelemetry agents. For more details, please refer to these two blogs: <a href="https://www.elastic.co/blog/opentelemetry-observability">Independence with OTel in Elastic</a> and <a href="https://www.elastic.co/blog/implementing-kubernetes-observability-security-opentelemetry">Observability and Security with OTel in Elastic</a>. Additionally, review the <a href="https://www.elastic.co/guide/en/apm/guide/current/open-telemetry.html">OTel documentation in Elastic</a>.</li>
<li>Look through an overview of <a href="https://www.elastic.co/guide/en/observability/current/apm.html">Elastic Observability APM capabilities</a>.</li>
<li>Look through our <a href="https://www.elastic.co/guide/en/observability/8.5/inspect-log-anomalies.html">anomaly detection documentation</a> for logs and <a href="https://www.elastic.co/guide/en/observability/8.5/categorize-logs.html">log categorization documentation</a>.</li>
</ul>
<p>Once you’ve instrumented your application with APM (Elastic or OTel) agents and are ingesting metrics and logs into Elastic Observability, you should see a service map for the application as follows:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blta9d36b30928e7224/6a7f0eb5de23157ee8fd7cdd/blog-elastic-observability-service-map.png" alt="observability service map" /></p>
<p>In our example, we’ve introduced issues to help walk you through the root cause analysis features. You might have a different set of issues depending on how you load the application and/or introduce specific feature flags.</p>
<p>As part of the walk-through, we’ll assume we are DevOps or SRE managing this application in production.</p>
<h2 id="rootcauseanalysis">Root cause analysis</h2>
<p>While the application has been running normally for some time, you get a notification that some of the services are unhealthy. This can occur from the notification setting you’ve set up in Elastic or other external notification platforms (including customer-related issues). In this instance, we’re assuming that customer support has called in multiple customer complaints about the website.</p>
<p>How do you as a DevOps or SRE investigate this? We will walk through two avenues in Elastic to investigate the issue:</p>
<ul>
<li>Log spike analysis</li>
<li>Log pattern analysis</li>
</ul>
<p>While we show these two paths separately, they can be used in conjunction and are complementary, as they are both tools Elastic Observability provides to help you troubleshoot and identify a root cause.</p>
<p>Starting with the service map, you can see anomalies identified with red circles and as we select them, Elastic will provide a score for the anomaly.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd43a5fdcc58e77ae/6a7f0eb8b43770411d4d6d4f/blog-elastic-observability-service-map-service-details.png" alt="observability service map service details" /></p>
<p>In this example, we can see that there is a score of 96 for a specific anomaly for the productCatalogService in the Hipster Shop application. An anomaly score indicates the significance of the anomaly compared to previously seen anomalies. Rather than jump into anomaly detection (see previous <a href="https://www.elastic.co/blog/reduce-mttd-ml-machine-learning-observability">blog</a>), let’s look at some of the potential issues by reviewing the service details in APM.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt146757fbf179e467/6a7f0ebbfc63abce9164cd2f/blog-elastic-observability-product-catalog-service-overview.png" alt="observability product catalog service overview" /></p>
<p>What we see for the productCatalogService is that there are latency issues, failed transactions, a large number of issues, and a dependency to PostgreSQL. When we look at the errors in more detail and drill down, we see they are all coming from <a href="https://pkg.go.dev/github.com/lib/pq">PQ - which is a PostgreSQL driver in Go</a>.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt3d30199bf7ae5c6a/6a7f0ebe73d9bd166229dbd5/blog-elastic-observability-product-catalog-service-errors.png" alt="observability product catalog service errors" /></p>
<p>As we drill further, we still can’t tell why the productCatalogService is not able to pull information from the PostgreSQL database.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt2ea03c73a1b9776d/6a7f0ec16693f804b3663ff3/blog-elastic-observability-product-catalog-service-error-group.png" alt="observability product catalog service error group" /></p>
<p>We see that there is a spike in errors, so let's see if we can gleam further insight using one of our two options:</p>
<ul>
<li>Log rate spikes</li>
<li>Log pattern analysis</li>
</ul>
<h3 id="logratespikes">Log rate spikes</h3>
<p>Let’s start with the <strong>log rate spikes</strong> detector capability from Elastic’s AIOps Labs section of Elastic’s machine learning capabilities. We also pre-select analyzing the spike against a baseline history.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt0bc6a360acca0efa/6a7f0ec49090b024f184ea9f/blog-elastic-observability-explain-log-rate-spikes-postgres.png" alt="explain log rate spikes postgres" /></p>
<p>The log rate spikes detector has looked at all the logs from the spike and compared them to the baseline, and it's seeing higher-than-normal counts in specific log messages. From a visual inspection, we see that PostgreSQL log messages are high. We further filter this with postgres.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blte922b9077ca384e5/6a7f0ec7c2cc09fa92249652/blog-elastic-observability-explain-log-rate-spikes-pgbench.png" alt="explain log rates spikes pgbench" /></p>
<p>We immediately notice that this issue is potentially caused by pgbench, a popular PostgreSQL tool to help benchmark the database. pgbench runs the same sequence of SQL commands over and over, possibly in multiple, concurrent database sessions. While pgbench is definitely a useful tool, it should not be used in a production environment as it causes a heavy load on the database host, likely causing higher latency issues on the site.</p>
<p>While this may or may not be the ultimate root cause, we have rather quickly identified a potential issue that has a high probability of being the root cause. An engineer likely intended to run pgbench against a staging database to evaluate its performance, and not the production environment.</p>
<h3 id="logpatternanalysis">Log pattern analysis</h3>
<p>Instead of log rate spikes, let’s use log pattern analysis to investigate the spike in errors we saw in productCatalogService. In AIOps Labs, we simply select Log Pattern Analysis, use Logs data, filter the results with postgres (since we know it's related to PostgreSQL), and look at information from the message field of the logs we are processing. We see the following:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blte965362e068db55a/6a7f0eca1967ea593b330813/blog-elastic-observability-explain-log-pattern-analysis.png" alt="observability explain log pattern analysis" /></p>
<p>Almost immediately we see the biggest pattern it finds is a log message where pgbench is updating the database. We can further directly drill into this log message from log pattern analysis into Discover and review the details and further analyze the messages.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt80d6079ba85313db/6a7f0ecdbd2198cc1b758169/blog-elastic-observability-expanded-document.png" alt="expanded document" /></p>
<p>As we mentioned in the previous section, while it may or may not be the root cause, it quickly gives us a place to start and a potential root cause. A developer likely intended to run pgbench against a staging database to evaluate its performance, and not the production environment.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Between the <a href="https://www.elastic.co/blog/reduce-mttd-ml-machine-learning-observability">first blog</a> and this one, we’ve shown how Elastic Observability can help you further identify and get closer to pinpointing the root cause of issues without having to look for a “needle in a haystack.” Here’s a quick recap of what you learned in this blog.</p>
<ul>
<li>Elastic Observability has numerous capabilities to help you reduce your time to find the root cause and improve your MTTR (even MTTD). In particular, we reviewed the following two main capabilities (found in AIOps Labs in Elastic) in this blog:</li>
</ul>
<ol>
<li><strong>Log rate spikes</strong> detector helps identify reasons for increases in log rates. It makes it easy to find and investigate the causes of unusual spikes by using the analysis workflow view. Examine the histogram chart of the log rates for a given data view, and find the reason behind a particular change possibly in millions of log events across multiple fields and values.</li>
<li><strong>Log pattern analysis</strong> helps you find patterns in unstructured log messages and makes it easier to examine your data. It performs categorization analysis on a selected field of a data view, creates categories based on the data, and displays them together with a chart that shows the distribution of each category and an example document that matches the category.</li>
</ol>
<ul>
<li>You learned how easy and simple it is to use Elastic Observability’s log categorization and anomaly detection capabilities without having to understand machine learning (which helps drive these features) or having to do any lengthy setups.</li>
</ul>
<p>Ready to get started? <a href="https://cloud.elastic.co/registration">Register for Elastic Cloud</a> and try out the features and capabilities outlined above.</p>
<h3 id="additionalloggingresources">Additional logging resources:</h3>
<ul>
<li><a href="https://www.elastic.co/getting-started/observability/collect-and-analyze-logs">Getting started with logging on Elastic (quickstart)</a></li>
<li><a href="https://www.elastic.co/guide/en/observability/current/logs-metrics-get-started.html">Ingesting common known logs via integrations (compute node example)</a></li>
<li><a href="https://docs.elastic.co/integrations">List of integrations</a></li>
<li><a href="https://www.elastic.co/blog/log-monitoring-management-enterprise">Ingesting custom application logs into Elastic</a></li>
<li><a href="https://www.elastic.co/blog/observability-logs-parsing-schema-read-write">Enriching logs in Elastic</a></li>
<li>Analyzing Logs with <a href="https://www.elastic.co/blog/reduce-mttd-ml-machine-learning-observability">Anomaly Detection (ML)</a> and <a href="https://www.elastic.co/blog/observability-logs-machine-learning-aiops">AIOps</a></li>
</ul>
<h3 id="commonusecaseexampleswithlogs">Common use case examples with logs:</h3>
<ul>
<li><a href="https://youtu.be/ax04ZFWqVCg">Nginx log management</a></li>
<li><a href="https://www.elastic.co/blog/vpc-flow-logs-monitoring-analytics-observability">AWS VPC Flow log management</a></li>
<li><a href="https://www.elastic.co/blog/kubernetes-errors-elastic-observability-logs-openai">Using OpenAI to analyze Kubernetes errors</a></li>
<li><a href="https://youtu.be/Li5TJAWbz8Q">PostgreSQL issue analysis with AIOps</a></li>
</ul>
<p><em>Elastic and Elasticsearch are trademarks, logos or registered trademarks of Elasticsearch B.V. in the United States and other countries.</em></p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/observability-logs-machine-learning-aiops</link>
    <guid isPermaLink="false">observability-logs-machine-learning-aiops</guid>
    <category><![CDATA[Machine Learning]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <category><![CDATA[Agentic Observability]]></category>
    <dc:creator><![CDATA[Bahubali Shetti]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt01dcd709335ca52d/6a7f0ed03ce8e276b1cf5437/illustration-machine-learning-anomaly-1680x980.png" length="0" type="image/png"/>
    <pubDate>Thu, 27 Apr 2023 00:00:00 GMT</pubDate>
  </item>
  <item>
    <title><![CDATA[Root cause analysis with logs: Elastic Observability's anomaly detection and log categorization]]></title>
    <description><![CDATA[Elastic Observability provides more than just log aggregation, metrics analysis, APM, and distributed tracing. Elastic’s machine learning capabilities help analyze the root cause of issues, allowing you to focus your time on the most important tasks.]]></description>
    <content:encoded><![CDATA[<p>With more and more applications moving to the cloud, an increasing amount of telemetry data (logs, metrics, traces) is being collected, which can help improve application performance, operational efficiencies, and business KPIs. However, analyzing this data is extremely tedious and time consuming given the tremendous amounts of data being generated. Traditional methods of alerting and simple pattern matching (visual or simple searching etc) are not sufficient for IT Operations teams and SREs. It’s like trying to find a needle in a haystack.</p>
<p>In this blog post, we’ll cover some of Elastic’s artificial intelligence for IT operations (AIOps) and machine learning (ML) capabilities for root cause analysis.</p>
<p>Elastic’s machine learning will help you investigate performance issues by providing anomaly detection and pinpointing potential root causes through time series analysis and log outlier detection. These capabilities will help you reduce time in finding that “needle” in the haystack.</p>
<p>Elastic’s platform enables you to get started on machine learning quickly. You don’t need to have a data science team or design a system architecture. Additionally, there’s no need to move data to a third-party framework for model training.</p>
<p>Preconfigured machine learning models for observability and security are available. If those don't work well enough on your data, in-tool wizards guide you through the few steps needed to configure custom anomaly detection and train your model with supervised learning. To help get you started, there are several key features built into Elastic Observability to aid in analysis, helping bypass the need to run specific ML models. These features help minimize the time and analysis for logs.</p>
<p>Let’s review some of these built-in ML features:</p>
<p><strong>Anomaly detection:</strong> Elastic Observability, when turned on (<a href="https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html">see documentation</a>), automatically detects anomalies by continuously modeling the normal behavior of your time series data — learning trends, periodicity, and more — in real time to identify anomalies, streamline root cause analysis, and reduce false positives. Anomaly detection runs in and scales with Elasticsearch and includes an intuitive UI.</p>
<p><strong>Log categorization:</strong> Using anomaly detection, Elastic also identifies patterns in your log events quickly. Instead of manually identifying similar logs, the logs categorization view lists log events that have been grouped, based on their messages and formats, so that you can take action quicker.</p>
<p><strong>High-latency or erroneous transactions:</strong> Elastic Observability’s APM capability helps you discover which attributes are contributing to increased transaction latency and identifies which attributes are most influential in distinguishing between transaction failures and successes. An overview of this capability is published here: <a href="https://www.elastic.co/blog/apm-correlations-elastic-observability-root-cause-transactions">APM correlations in Elastic Observability: Automatically identifying probable causes of slow or failed transactions</a>.</p>
<p><strong>AIOps Labs:</strong> AIOps Labs provides two main capabilities using advanced statistical methods:</p>
<ul>
<li><strong>Log spike detector</strong> helps identify reasons for increases in log rates. It makes it easy to find and investigate causes of unusual spikes by using the analysis workflow view. Examine the histogram chart of the log rates for a given data view, and find the reason behind a particular change possibly in millions of log events across multiple fields and values.</li>
<li><strong>Log pattern analysis</strong> helps you find patterns in unstructured log messages and makes it easier to examine your data. It performs categorization analysis on a selected field of a data view, creates categories based on the data, and displays them together with a chart that shows the distribution of each category and an example document that matches the category.</li>
</ul>
<p> <strong>In this blog, we will cover anomaly detection and log categorization against the popular “Hipster Shop app” developed by Google, and modified recently by OpenTelemetry.</strong> </p>
<p>Overviews of high-latency capabilities can be found <a href="https://www.elastic.co/blog/apm-correlations-elastic-observability-root-cause-transactions">here</a>, and an overview of AIOps labs can be found <a href="https://www.youtube.com/watch?v=jgHxzUNzfhM&amp;list=PLhLSfisesZItlRZKgd-DtYukNfpThDAv_&amp;index=5">here</a>.</p>
<p>In this blog, we will examine a scenario where we use anomaly detection and log categorization to help identify a root cause of an issue in Hipster Shop.</p>
<h2 id="prerequisitesandconfig">Prerequisites and config</h2>
<p>If you plan on following this blog, here are some of the components and details we used to set up this demonstration:</p>
<ul>
<li>Ensure you have an account on <a href="http://cloud.elastic.co">Elastic Cloud</a> and a deployed stack (<a href="https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html">see instructions here</a>) on AWS. Deploying this on AWS is required for Elastic Serverless Forwarder.</li>
<li>Utilize a version of the ever so popular <a href="https://github.com/GoogleCloudPlatform/microservices-demo">Hipster Shop</a> demo application. It was originally written by Google to showcase Kubernetes across a multitude of variants available, such as the <a href="https://github.com/open-telemetry/opentelemetry-demo">OpenTelemetry Demo App</a>. The Elastic version is found <a href="https://github.com/elastic/opentelemetry-demo">here</a>.</li>
<li>Ensure you have configured the app for either Elastic APM agents or OpenTelemetry agents. For more details, please refer to these two blogs: <a href="https://www.elastic.co/blog/opentelemetry-observability">Independence with OTel in Elastic</a> and <a href="https://www.elastic.co/blog/implementing-kubernetes-observability-security-opentelemetry">Observability and security with OTel in Elastic</a>. Additionally, review the <a href="https://www.elastic.co/guide/en/apm/guide/current/open-telemetry.html">OTel documentation in Elastic</a>.</li>
<li>Look through an overview of <a href="https://www.elastic.co/guide/en/observability/current/apm.html">Elastic Observability APM capabilities</a>.</li>
<li>Look through our <a href="https://www.elastic.co/guide/en/observability/8.5/inspect-log-anomalies.html">Anomaly detection documentation</a> for logs and <a href="https://www.elastic.co/guide/en/observability/8.5/categorize-logs.html">log categorization documentation</a>.</li>
</ul>
<p>Once you’ve instrumented your application with APM (Elastic or OTel) agents and are ingesting metrics and logs into Elastic Observability, you should see a service map for the application as follows:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc051b75831308f32/6a7f1a3c77b03453e73ff8f9/blog-elastic-service-map.png" alt="" /></p>
<p>In our example, we’ve introduced issues to help walk you through the root cause analysis features: anomaly detection and log categorization. You might have a different set of anomalies and log categorization depending on how you load the application and/or introduce specific issues.</p>
<p>As part of the walk-through, we’ll assume we are a DevOps or SRE managing this application in production.</p>
<h2 id="rootcauseanalysis">Root cause analysis</h2>
<p>While the application has been running normally for some time, you get a notification that some of the services are unhealthy. This can occur from the notification setting you’ve set up in Elastic or other external notification platforms (including customer related issues). In this instance, we’re assuming that customer support has called in multiple customer complaints about the website.</p>
<p>How do you as a DevOps or SRE investigate this? We will walk through two avenues in Elastic to investigate the issue:</p>
<ul>
<li>Anomaly detection</li>
<li>Log categorization</li>
</ul>
<p>While we show these two paths separately, they can be used in conjunction and are complementary, as they are both tools Elastic Observability provides to help you troubleshoot and identify a root cause.</p>
<h3 id="machinelearningforanomalydetection">Machine learning for anomaly detection</h3>
<p>Elastic will detect anomalies based on historical patterns and identify a probability of these issues.</p>
<p>Starting with the service map, you can see anomalies identified with red circles and as we select them, Elastic will provide a score for the anomaly.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt38b12944fdbdd0e8/6a7f1a40e3a21944b499f8c2/blog-elastic-service-map-anomaly-detection.png" alt="" /></p>
<p>In this example, we can see that there is a score of 96 for a specific anomaly for the productCatalogService in the Hipster Shop application. An anomaly score indicates the significance of the anomaly compared to previously seen anomalies. More information on anomaly detection results can be found here. We can also dive deeper into the anomaly and analyze the details.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltf7a1b60a1109fa57/6a7f1a426693f82b89664375/blog-elastic-single-metric-viewer.png" alt="" /></p>
<p>What you will see for the productCatalogService is that there is a severe spike in average transaction latency time, which is the anomaly that was detected in the service map. Elastic’s machine learning has identified a specific metric anomaly (shown in the single metric view). It’s likely that customers are potentially responding to the slowness of the site and that the company is losing potential transactions.</p>
<p>One step to take next is to review all the other potential anomalies that we saw in the service map in a larger picture. Use an anomaly explorer to view all the anomalies that have been identified.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5f8c2653add063e8/6a7f1a456c6eac6dcbf145a0/blog-elastic-anomaly-explorer.png" alt="" /></p>
<p>Elastic is identifying numerous services with anomalies. productCatalogService has the highest score and a good number or others: frontend, checkoutService, advertService, and others, also have high scores. However, this analysis is looking at just one metric.</p>
<p>Elastic can help detect anomalies across all types of data, such as kubernetes data, metrics, and traces. If we analyze across all these types (via individual jobs we’ve created in Elastic machine learning), we will see a more comprehensive view as to what is potentially causing this latency issue.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd958db4183c3832d/6a7f1a483ce8e28c58cf57a7/blog-elastic-anomaly-explorer-job-selection.png" alt="" /></p>
<p>Once all the potential jobs are selected and we’ve sorted by service.name, we can see that productCatalogService is still showing a high anomaly influencer score.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt6756a3a0aadd2dbc/6a7f1a4b42a11732ea95c2fd/blog-elastic-anomaly-explorer-timeline.png" alt="" /></p>
<p>In addition to the chart giving us a visual of the anomalies, we can review all the potential anomalies. As you will notice, Elastic has also categorized these anomalies (see category examples column). As we scroll through the results, we notice a potential postgreSQL issue from the categorization, which also has a high 94 score. Machine learning has identified a “rare mlcategory,” meaning that it has rarely occurred, hence pointing to a potential cause of the issue customers are seeing.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt46c0097b09183fa8/6a7f1a4eeab5be957820aaf8/blog-elastic-machine-learning-service-name.png" alt="" /></p>
<p>We also notice that this issue is potentially caused by pgbench , a popular postgreSQL tool to help benchmark the database. pgbench runs the same sequence of SQL commands over and over, possibly in multiple, concurrent database sessions. While pgbench is definitely a useful tool, it should not be used in a production environment as it causes heavy load on the database host, likely causing the higher latency issues on the site.</p>
<p>While this may or may not be the ultimate root cause, we have rather quickly identified a potentially issue that has a high probability of being the root cause. An engineer likely intended to run pgbench against a staging database to evaluate its performance, and not the production environment.</p>
<h3 id="machinelearningforlogcategorization">Machine learning for log categorization</h3>
<p>Elastic Observability’s service map has detected an anomaly, and in this part of the walk-through, we take a different approach by investigating the service details from the service map versus initially exploring the anomaly. When we explore the service details for productCatalogService, we see the following:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt6bcfa46b1ba24f70/6a7f1a523ce8e27f3acf57ab/blog-elastic-product-catalog-service.png" alt="" /></p>
<p>The service details are identifying several things:</p>
<ol>
<li>There is an abnormally high latency compared to expected bounds of the service. We see that recently there was a higher than normal (upward of 1s latency) compared to the average to 275ms on average.</li>
<li>There is also a high failure rate for the same time frame as the high latency (lower left chart “ <strong>Failed transaction rate</strong> ”).</li>
<li>Additionally, we can see the transactions and one in particular /ListProduct has an abnormally high latency, in addition to a high failure rate.</li>
<li>We see productCatalogService has a dependency on postgreSQL.</li>
<li>We also see errors all related to postgreSQL.</li>
</ol>
<p>We have an option to dig through the logs and analyze in Elastic or we can use a capability to identify the logs more easily.</p>
<p>If we go to Categories under Logs in Elastic Observability and search for postgresql.logto help identify postgresql logs that could be causing this error, we see that Elastic’s machine learning has automatically categorized the postgresql logs.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt7ef998b88afc1e4d/6a7f1a55c2e9149015016fec/blog-elastic-categories.png" alt="" /></p>
<p>We notice two additional items:</p>
<ul>
<li>There is a high count category (message count of 23,797 with a high anomaly of 70) related to pgbench (which is odd to see in production). Hence we search further for all pgbench related logs in Categories .</li>
<li>We see an odd issue regarding terminating the connection (with a low count).</li>
</ul>
<p>While investigating the second error, which is severe, we can see logs from Categories before and after the error.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt208408824fb1cb51/6a7f1a5877b0346da53ff8ff/blog-elastic-timestamp.png" alt="" /></p>
<p>This troubleshooting shows postgreSQL having a FATAL error, the database shutting down prior to the error, and all connections terminating. Given the two immediate issues we identified, we have an idea that someone was running pgbench and this potentially overloaded the database, causing the latency issue that customers are seeing.</p>
<p>The next steps here could be to investigate anomaly detection and/or work with the developers to review the code and identify pgbench as part of the deployed configuration.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I hope you’ve gotten an appreciation for how Elastic Observability can help you further identify and get closer to pinpointing root cause of issues without having to look for a “needle in a haystack.” Here’s a quick recap of lessons and what you learned:</p>
<ul>
<li>Elastic Observability has numerous capabilities to help you reduce your time to find root cause and improve your MTTR (even MTTD). In particular, we reviewed the following two main capabilities in this blog:</li>
</ul>
<ol>
<li><strong>Anomaly detection:</strong> Elastic Observability, when turned on (<a href="https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html">see documentation</a>), automatically detects anomalies by continuously modeling the normal behavior of your time series data — learning trends, periodicity, and more — in real time to identify anomalies, streamline root cause analysis, and reduce false positives. Anomaly detection runs in and scales with Elasticsearch and includes an intuitive UI.</li>
<li><strong>Log categorization:</strong> Using anomaly detection, Elastic also identifies patterns in your log events quickly. Instead of manually identifying similar logs, the logs categorization view lists log events that have been grouped based on their messages and formats so that you can take action quicker.</li>
</ol>
<ul>
<li>You learned how easy and simple it is to use Elastic Observability’s log categorization and anomaly detection capabilities without having to understand machine learning (which help drive these features), nor having to do any lengthy setups.
Ready to get started? <a href="https://cloud.elastic.co/registration">Register for Elastic Cloud</a> and try out the features and capabilities I’ve outlined above.</li>
</ul>
<h3 id="additionalloggingresources">Additional logging resources:</h3>
<ul>
<li><a href="https://www.elastic.co/getting-started/observability/collect-and-analyze-logs">Getting started with logging on Elastic (quickstart)</a></li>
<li><a href="https://www.elastic.co/guide/en/observability/current/logs-metrics-get-started.html">Ingesting common known logs via integrations (compute node example)</a></li>
<li><a href="https://docs.elastic.co/integrations">List of integrations</a></li>
<li><a href="https://www.elastic.co/blog/log-monitoring-management-enterprise">Ingesting custom application logs into Elastic</a></li>
<li><a href="https://www.elastic.co/blog/observability-logs-parsing-schema-read-write">Enriching logs in Elastic</a></li>
<li>Analyzing Logs with <a href="https://www.elastic.co/blog/reduce-mttd-ml-machine-learning-observability">Anomaly Detection (ML)</a> and <a href="https://www.elastic.co/blog/observability-logs-machine-learning-aiops">AIOps</a></li>
</ul>
<h3 id="commonusecaseexampleswithlogs">Common use case examples with logs:</h3>
<ul>
<li><a href="https://youtu.be/ax04ZFWqVCg">Nginx log management</a></li>
<li><a href="https://www.elastic.co/blog/vpc-flow-logs-monitoring-analytics-observability">AWS VPC Flow log management</a></li>
<li><a href="https://www.elastic.co/blog/kubernetes-errors-elastic-observability-logs-openai">Using OpenAI to analyze Kubernetes errors</a></li>
<li><a href="https://youtu.be/Li5TJAWbz8Q">PostgreSQL issue analysis with AIOps</a></li>
</ul>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/reduce-mttd-ml-machine-learning-observability</link>
    <guid isPermaLink="false">reduce-mttd-ml-machine-learning-observability</guid>
    <category><![CDATA[Machine Learning]]></category>
    <category><![CDATA[Logs Analytics]]></category>
    <category><![CDATA[Agentic Observability]]></category>
    <dc:creator><![CDATA[Bahubali Shetti]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltcea834289bfca650/6a7f1a5bde23151d7efd809b/illustration-machine-learning-anomaly-1680x980.png" length="0" type="image/png"/>
    <pubDate>Tue, 07 Feb 2023 00:00:00 GMT</pubDate>
  </item>
  </channel>
</rss>