OpsAI

OpsAI reduces the time spent debugging errors by identifying production issues in APM, RUM, and Kubernetes and resolving them with the least human intervention possible. Apparently, you can also automate the implementation of the proposed solution as you see fit. This way, OpsAI truly automates the debugging process.

What OpsAI Does

  1. Detects production issues automatically: OpsAI watches your application through APM traces, Real User Monitoring and Kubernetes. It continuously surfaces production issues across backend and frontend without manual triage.

  2. Finds the root cause and prepares a fix for RUM and APM: After detection, OpsAI pulls together stack traces, error metadata, logs, historical context and your GitHub-linked code files. Using these inputs, it pinpoints the file and line that likely caused the failure, explains why it broke, and generates a candidate fix you can review. Meanwhile, for Kubernetes, it gives a fix directly without creating a PR.

  3. Opens a pull request with a code change: If the problem needs a code change, OpsAI creates a code-level solution, shows a side-by-side diff, and opens a pull request in your repository with the suggested edits and enough context for a quick review and deployment.

  4. Fix issue for Kubernetes: Once any instrumented application that is instrumented with Kubernetes produces any error, it gets detected via logs. Once the issue has been identified via OpsAI, you can do RCA to pinpoint the issue and later on fix it in a single click.

  5. Auto fix (Available for Kubernetes for now): When your application is instrumented with Kubernetes, you can choose between two auto-fix options:

    1. Auto RCA (Root Cause Analysis): With auto RCA, OpsAI analyzes the problem using available data and proposes a fix, which developers can review and apply the fix by themselves.
    2. Auto Fix: Auto Fix goes one step further than the Auto RCA. Instead of just proposing the possible solution, it can implement the fix automatically with zero intervention needed from the developer.

Privacy note: OpsAI reads only the files related to the error through the MCP integration and does not store your source code or error context.

Read more about Ops AI use cases here.

Getting Started with OpsAI

The fastest path is Kubernetes. If you are not on Kubernetes, install the APM and RUM agents, then connect your code host.

1. Kubernetes Quick Start

Install the Middleware Kube Agent, enable OpsAI, and turn on auto-instrumentation. Use your own API key, target and cluster name. For detailed Kubernetes setup, see OpsAI for Kubernetes.

1# Add the Middleware Helm repo
2helm repo add middleware-labs https://helm.middleware.io
3
4# Install the agent with OpsAI and auto-instrumentation enabled
5helm install mw-agent middleware-labs/mw-kube-agent-v3 \
6  --set global.mw.apiKey=<MW_API_KEY> \
7  --set global.mw.target=<MW_TARGET_URL> \
8  --set opsai.enabled=true \
9  --set global.clusterMetadata.name=<CLUSTER_NAME> \
10  --set mw-autoinstrumentation.enabled=true \
11  -n mw-agent-ns --create-namespace

Placeholders:

  • <MW_API_KEY>: your Middleware API key
  • <MW_TARGET_URL>: your region endpoint, for example https://<your-uid>.middleware.io:443
  • <CLUSTER_NAME>: the cluster name you want to see in Infrastructure

Verify the rollout:

1kubectl get daemonset/mw-kube-agent -n mw-agent-ns
2kubectl get deployment/mw-kube-agent -n mw-agent-ns

For Kubernetes workloads, you can either keep manual SDKs or use auto-instrumentation with OTel Operator and language-specific inject annotations.

2. Install APM and RUM and Connect Your Repository

Step 1: Install APM and RUM

APM:

RUM:

  • Include the JavaScript snippet to capture frontend issues and connect the full user journey.

Step 2: Connect Your Repository

  • Link your GitHub or Bitbucket repository so OpsAI can read only the files related to an error through the MCP server.

  • For accurate PR targeting, set these build-time variables in your CI or .env file:

1MW_VCS_REPOSITORY_URL=<your repository URL>
2MW_VCS_COMMIT_SHA=<commit SHA>   # optional but recommended

Where:

  • MW_VCS_REPOSITORY_URL tells OpsAI which repo produced the error.
  • MW_VCS_COMMIT_SHA helps OpsAI open the PR on the right branch.

How OpsAI Works

  1. Telemetry in: traces from APM, user events from RUM and logs arrive in Middleware.

  2. Issue detection: errors, latency spikes and regressions are grouped and ranked.

  3. Code context: OpsAI requests only the files needed for the incident through GitHub's MCP server.

  4. Root cause analysis: stack frames and metadata are matched to code lines and past incidents.

  5. Proposed fix: a pull request with a minimal change is created for review in your repository.

📺 Refer to this video guide to walk through the installation and setup process:

Privacy and Security

  • OpsAI reads only the files that relate to the error it is fixing
  • Access goes through GitHub MCP for security
  • Middleware does not store your source code or error context
  • For Kubernetes auto-fix, OpsAI only implements fixes if you explicitly grant access to write tools

Need assistance or want to learn more about Middleware? Contact our support team at [email protected] or join our Slack channel.