Intelligent Remediation: Action generation with AI

Instana Intelligent Remediation uses generative AI to accelerate incident or issue remediation. You can input the Instana event details to a large language model (LLM) as a prompt. The LLM can generate a manual action, which is a set of steps to diagnose or remediate the event, or a script action based on manual steps. You can further configure these actions and add them to the action catalog. These actions can also be applied to an automation policy to link the action to the event for convenient reference.

For some frequently-occurring built-in events, predefined curated actions are available for selection.

Artificial Intelligence (AI)-generated actions are not run automatically against a target system. In addition, AI can sometimes make mistakes. Therefore, you must always review, verify, and test these actions before using them in an automation policy or on production systems.

Note: Instana Intelligent Remediation with AI is offered for both SaaS and self-hosted environments.

AI integration

Generative AI for manual action and script generation uses the ibm/granite-3-3-8b-instruct large language model (LLM) to generate manual actions and scripts. This model uses event data as input and recommends steps to diagnose or fix issues. The LLM also converts manual steps into bash or Ansible scripts by accepting the step as input and generating the required script to execute the instructions.

Prerequisites

To use Instana Intelligent Remediation with AI, you must meet the following prerequisites:

Permissions

You must enable the following Automation RBAC permissions:

    • Access type: Owner (enables configuration of new automation actions)
    • Configuration of automation policies (if policy creation is required)

SaaS environments

For SaaS environments, default LLM gateways for watsonx.ai are provided by Instana. No additional configuration is required to use this capability. You can configure separate gateways for your own watsonx.ai runtime if desired. For more information, see AI gateway.

Self-hosted environments

For Standard Edition and Custom Edition, you must enable the required feature flag and configure LLM gateways to use this capability. For more information, see AI gateway.

To configure the feature flag for AI action generation on {{site.data.keyword.self_se}}, see Enabling optional features in Standard edition.

To configure the feature flag for AI action generation on {{site.data.keyword.self_kub}}, see Enable optional features in Custom edition .

Self-Hosted Classic Edition (Docker) does not support action generation by using AI.

Generating manual actions with AI

For any occurrence of a built-in event, custom event, or Smart Alert, go to Recommended Actions in the Automation section. Click the link to Generate with AI.

To generate a manual action for any occurrence of a built-in event, custom event, or Smart Alert, complete the following steps:

  1. In the Instana UI, go to Events > Incidents or Events > Issues.
  2. Open an incident or issue.
  3. In the Recommended Actions table, click Generate action.

Generate action

The process for generating a manual action involves two main steps, with an optional third step for automation:
  1. Generate or select an action.
  2. Edit and save the remediation steps that are generated by AI to the action catalog as manual action.
  3. Optional: Generate an automation Bash script or Ansible playbook and export to GitHub or GitLab or save to the action catalog.

Step 1: Generate or select an action

When an incident includes a topology chart with a triggering event and probable root causes, Recommended Actions appear in the topology section. The fields that are displayed in Step 1 of 2 depend on the node clicked in the topology chart and whether AI action generation is enabled.

  • If the Triggering Event node is clicked, configuration details such as Event Summary and Event Entity Type are automatically populated from the current event information.
  • If a Probable Root Cause node is clicked, configuration details such as Root Cause Summary and Entity Type are automatically populated from the current root cause information.

If the Run Investigation button is clicked for a root cause, the Recommended Actions table appears based on the context of the investigation results.

When Generate action is clicked from the Recommended Actions table, configuration details such as Investigation Summary and Entity Type are automatically populated from the investigation results.

Live generation (when AI action generation feature is enabled)

  1. Review the event summary. You can enrich the details of the AI prompt or keep it as it is to generate the remediation steps.
  2. To generate remediation steps, click Generate.
  3. Review the generated results in Step 2 of 2.
Note: If required, you can improve the results by modifying the prompt input fields and clicking Generate again. Provide appropriate details to achieve better results from AI.
Generated manual action]

Built-in actions (pre-generated actions)

For several commonly occurring built-in events, you see tabs for both Live generation and Built-in actions in Step 1.

  • The Built-in actions tab contains a list of pre-generated and curated actions related to the event.
  • These pre-generated actions are ready to use and can be saved to the action catalog.
  • Select an action from the list to view and edit it in Step 2 of 2.
Built-in actions

Optional: Generate automation scripts

When AI action generation is enabled, an Optional actions section appears in Step 2 of 2, which enables the conversion of manual remediation steps into automation scripts.To generate an automation script from the manual steps:
  1. In the Optional actions section, select one of the following interpreters:

    • Generate Bash script: Creates a Bash shell script
    • Generate Ansible playbook: Creates an Ansible playbook
  2. Review the generated code in the Generated code section.

  3. Optional: Click the Edit icon to modify the script, then click Save to apply your changes.

  4. Optional: You can edit remediation steps in step 2 and click Regenerate to generate a new version of the script.

  5. Choose one of the following options to save or export the script:

Optional automation scripts

Viewing the action

  • The new actions are available in the Action Catalog tab in the Automation section of Instana UI.
  • Manual actions can be viewed from the Recommended Actions tab of the incident or issue.
  • Script actions can be configured to run automatically through automation policies.

View action

Generating script actions with AI

To select any manual action and generate a script, complete the following steps:

  1. From the navigation menu in the Instana UI, click Automation.
  2. On the Action Catalog tab, select any action with type Manual.
  3. To Generate script from manual action, do one of the following:
    • Click action, and in the configuration tab, click Generate script.
    • Click the Options overflow, and then click Generate script.

The Generate Script function is also available in the Recommended Actions table under the manual actions Options, based on event occurrences.

Generating a script action with AI involves two steps:

  • Generate the script
  • Create script action or export to external source

To generate a script from the manual action, complete the following steps:

Generating a script

In the Step 1: Generate a script page, modify the manual action content as required. The step details are used to form the AI prompt to generate a new script action.

To generate a script action, complete the following steps:

  1. Select one of the following interpreters for script generation: Bash or Ansible.

  2. Optional: In the Prompt field, modify the selected prompt text.

    Note: Modify the prompt details to improve the results.
  3. Click Generate.

  4. Review the generated code and click Next.

The following images display the generated bash and Ansible scripts:

Figure 1. Generated bash script
Generated bash script
Figure 2. Generated Ansible script
Generated Ansible script

Creating a script action

To create a script action, complete the following steps:

  1. On the "Step 3: Create action or export to external source" page, select "Create an action" option.
  2. Enter Name, Description, and Tags.
  3. Optional: Modify the script content before saving it to the catalog.
  4. Click Create action. The action is saved in the action catalog.
Note: Notes: The available options for storing scripts are as follows: For Bash scripts: Save the script in the catalog Export it to an external source (GitHub or GitLab) For Ansible scripts: Export to an external source (GitHub or GitLab)

The following image displays how to create a script action:

Create action

Exporting the script to external source

You can export the generated script to a GitHub repository or GitLab project.

  1. On the "Step 3: Create action or export to external" page, select Export to GitHub or Export to GitLab.
  2. Select a target agent with action github or action gitlab sensor enabled.
  3. Enter Repository, Branch, Commit message, Target branch and File path.
  4. Optional: Modify the script content before exporting it.
  5. Click Export. The script is exported and a new pull request is created.
  6. Optional: Once the pull request is approved and merged, you can create an action script in action catalog by using the exported file URL.

The following image displays how to export script to a GitHub repository: Export script to GitHub repository