Creating Instana integrations

You can integrate with Instana to enable connectivity to Instana events and metrics by using an Instana integration. Instana assets can be combined with IBM Cloud Pak for AIOps AI, such as runbooks, metric anomaly detection, and log anomaly detection to help you gain insights.

If needed, you can create multiple Instana integrations.

The ability to retrieve topology data from an Instana integration has been removed with version 4.11.0. If you need to retrieve topology data from Instana, you must use the Instana Observer. See Configuring Instana Observer jobs for information on using the Instana Observer.

The list of technologies is determined dynamically, based on the actual resources available in the Instana instance the integration is pulling metrics data from. Each technology includes a list of all available metrics that can be dynamically retrieved by the Instana integration. The integration also provides a set of recommended metrics to select from.

For more information about working with Instana integrations, see the following sections:

For more information about HTTP headers for the various credential types, see HTTP headers for credential types.

Before you begin

Make sure that you have the following information to hand:

  • Endpoint
  • API Token
  • Filters to define subsets of data that is pulled from Instana (optional)
Important: Starting from Cloud Pak for AIOps 4.13.0, the new Analyze Infrastructure API (/api/infrastructure-monitoring/analyze/entities) is used to collect infrastructure metric data from Instana. The Analyze Infrastructure API requires BeeInstana to be enabled.

BeeInstana is enabled by default in Instana SaaS and Self-Hosted Standard Edition. In Self-Hosted Custom and Classic Editions, you must manually enable BeeInstana. For more information, see the Using the BeeInstana Kubernetes Operator topic in the Instana documentation.

Alternatively, if you do not want to enable BeeInstana but need to upgrade Cloud Pak for AIOps to version 4.13.0, you can continue by using the old metric data collection method by disabling the Analyze Infrastructure API.

To disable the Analyze Infrastructure API, complete the following steps:

Important: Before you begin, make sure that you have installed the yq command-line YAML processor (version v4.47.2 or later) and it is available in your system's PATH. To check, run the command yq --version . You must get a response similar to the following example:
yq (https://github.com/mikefarah/yq/) version v4.47.2
  1. After the upgrade to Cloud Pak for AIOps 4.13.0, log in to Red Hat OpenShift Container Platform by using the CLI.

  2. Run the following commands in your terminal within the Cloud Pak for AIOps namespace:

    namespace=<cp4aiops_namespace> #Replace <cp4aiops_namespace> with your CP4AIOps namespace.
    oc get connectorconfiguration #Returns a list of connector configurations. Identify your required Instana connection that is configured for infrastructure metrics.
    connectionname=<connection_name> #Replace <connection_name> with the name of the required connection from the list.
    connconfig=$(oc get connectorconfiguration --no-headers $connectionname | awk '{print $1}')
    connconfiguid=$(oc get connectorconfiguration $connconfig -o jsonpath='{.metadata.uid}')
    gitappname=$(oc get gitapp -l connectors.aiops.ibm.com/connection-id==$connconfiguid --no-headers | awk '{print $1}')
    jsonpatch=$(yq -o json <<EOF
        patch: |-
          apiVersion: apps/v1
          kind: Deployment
          metadata:
            name: ibm-grpc-instana-connector
          spec:
            template:
              spec:
                containers:
                  - name: ibm-grpc-instana-connector
                    env:
                      - name: DISABLE_ANALYZE_INFRA_API
                        value: "true"
        target:
          group: apps
          kind: Deployment
          name: ibm-grpc-instana-connector
          version: v1
    EOF
    )
    oc get gitapp $gitappname -n $namespace -o json | jq ".spec.components[0].kustomization.patches = [$jsonpatch]" | oc apply -f -
    

After you run the commands, the infrastructure metric data are collected from Instana by using the /api/infrastructure-monitoring/metrics endpoint.

If you enable BeeInstana later, you can enable the Analyze Infrastructure API by updating the environment variable DISABLE_ANALYZE_INFRA_API to false. Then, the infrastructure metric data is collected from Instana by using the /api/infrastructure-monitoring/analyze/entities endpoint.

Creating Instana integrations

To create an Instana integration, complete the following steps:

  1. Log in to IBM Cloud Pak for AIOps console.

  2. Expand the navigation menu (four horizontal bars), then click Define > Integrations.

  3. On the Integrations page, click Add integration.

  4. From the list of available integrations, find and click the Instana tile.

    Note: If you do not immediately see the integration that you want to create, you can filter the tiles by type of integration. Click the type of integration that you want in the Category section.
  5. On the side-panel, review the instructions and click Get started.

  6. On the Add integration page, define the general integration details:

    • Name: The display name of your integration.

    • Description: An optional description for the integration.

    • Endpoint: Enter an endpoint for the integration. For example https://myinstance.mydomain.com.

    • API Tokens: You can add mulitple API tokens for the integration. Enter the details for each API token. The token is rotated when the API rate limit is reached for a token. The API tokens can be fetched from the Instana web UI.

      Instana integration

    • Application filter (Optional): Enter a regular expression to filter the applications, services, and endpoints from which you want to collect events and metrics. Example: (myApp[1-9]|myOtherApp). Default: No filter; all events are processed.

      Note: The integration also collects metrics and events from services and endpoints that linked to the filtered application.
    • Installation options: Select between the Cloud Pak for AIOps or Self-hosted radio buttons. If you select Self-hosted, after adding the integration, you will be provided with a bootstrap command to finish the deployment.

    The default configuration for a new API token is enough for this Instana integration.

  7. Click Next.

  8. If you would you like to optionally use an HTTP proxy configuration with the Instana integration, enter the following Configure proxy information:

    • Host name or IP address of HTTP proxy server: Enter the host name or IP address of the proxy server including the protocol. Do not include the port in this field.

    • Port number of proxy server: Enter the port as a number.

    • Proxy Username: If the HTTP proxy server requires authentication, enter the proxy username. If not, you can leave this field blank to use the proxy without authentication.

    • Proxy Password: If the HTTP proxy server requires authentication, enter the proxy password. If not, you can leave this field blank to use the proxy without authentication.

      Instana integration

    • Test connection: click to see is the connection can be established.

      To use the Instana API for the collection of Instana data (metrics, events, and topologies), an API token is required. These API tokens can be created on the Instana user interface. Click the Settings icon, then Team Settings > API Tokens, and lastly click Add API Token to create a new API token.

    An HTTPS proxy server and certificate authentication are not supported for the proxy configuration. Only basic authentication (username and password) or no authentication with an HTTP proxy server are supported.

  9. Click Next.

  10. Enter the following Collect event data information:

    • Enable data collection: Enable the toggle button if required.

    • Types of events: Select one or more event types for data collection from the following options:

      • Incidents
      • Issues
      • Changes
    • Map incoming JSON events to Cloud Pak for AIOps alerts: This field is automatically filled with a default JSONata, which is used to configure the Instana event handling and create alerts. You can modify the JSONata to specify how the events are handled and alerts are created. For more information and sample JSONata configuration, see Configuring Instana alerts by using JSONata.

  11. Click Next.

  12. Enter the following Collect metric data information to define how you want to collect metric data.

    • Enable data collection: Set the toggle button to 'on'.
    • Monitored hosts: You can select specific hosts to monitor and collect the metrics. By default, metrics for all hosts are collected.
      • Host Filter: Enter the regular expression for the hosts for which you want to collect the metrics. Example: .*\.important\.example.com.
    • Monitored metrics: You can select built-in metrics to monitor. These metrics are categorized by the technologies that they are associated with. You can also add custom-defined metrics to monitor. To select metrics, use any of the following options:
      • Enter your preferred metrics in the search bar and select their corresponding checkboxes.
      • Search and select your preferred technologies and their associated metrics in their respective filter table. To find the related metrics of a technology, click its corresponding arrow. By default, all metrics of the chosen technologies are selected.
      • Select the Start from recommended metrics checkbox if you are not sure which metrics to start with. This option selects all recommended technologies and their associated metrics in the filter table.
      • Clear the selected checkboxes to undo any selection. However, if you clear the Start from recommended metrics checkbox, all current selection is cleared.
      • All selected metrics are listed in the Selected metrics list. You can remove any listed metric by clicking the Deselect Metric icon corresponding to it.
      • You might see performance issues or gaps in your data due to the number of metrics selected. To avoid this problem, consider starting with the set of recommended metrics or those that are most important for you to monitor.
  13. Click Next.

  14. Enter the following Schedule metrics collection information:

    • Only collect Live Data once the integration is established: Select the checkbox to enable live data collection. Note: If you choose to collect only live data, you cannot collect historical data after the live data collection starts.
    • Historical data collection: The recommended time period for collecting historical metric data is two weeks, though it is possible to collect it for up to 31 days. Enter a start and end date and time in the following formats:
      • Start date and time*: Select the start date from the calendar and enter the time in the 'hh:mm' format (hours and minutes).

        Note: Your start date should not exceed 31 days from the present.
      • Time zone: Select your time zone from the dropdown list.

      • Start date and time: Select a date from the calendar. Also, enter the time in the 'hh:mm' format (hours and minutes).

      • End date and time: Click Add end date and select a date from the calendar. Also, enter the time in the 'hh:mm' format (hours and minutes). If you don't want to set an end date at this stage, click Remove End Date.

      • Scheduled collection interval (minutes): Enter a value in minutes. This value is the frequency at which data is collected.

        If you do not select an end date, IBM Cloud Pak for AIOps collects historical data from the specified start date and continues with live data collection. You cannot collect historical data after live data collection starts.

        Note: If you have already set an end date and time for an Instana integration, you cannot edit it. If you need to edit either of these properties, you must delete your integration and create a new one.
  15. Click Done.

For more information about performance considerations for metric data collection, see Performance considerations for metric data collection.

You have created an Instana integration in your instance.

After the integration creation is complete, and if you selected the Self-hosted option for the installation option, you can download the bootstrap script. Select the created integration, and then click download from the options menu (three vertical dots). If a script is regenerated, it invalidates the credentials of previously downloaded scripts for that integration.

Note: You can either copy the script or download as an sh file to run it on a remote cluster.

Prerequisites before you run the bootstrap script on a remote cluster:

  • Podman needs to be installed on the remote cluster.
  • Log in to the Image registry for the script to pull in the image by using the Podman login command.

After you create your integration, you must enable the data collection to connect your integration with the AI of IBM Cloud Pak for AIOps. For more information about enabling your integration, see Enabling Instana integrations.

To create more integrations (such as a ChatOps integration), see Configuring Integrations.

For more information about working with the insights provided by your integrations, see ChatOps insight management.

Rate limiting

For Instana on-prem installation, the recommended rate limit is double the number of resources. This limit is enough to cover most cases, although situations might arise where the limits need to be increased even more. When a more precise way to determine the limit is required (for instance a shared multi-tenant SaaS environment), the following formula can be applied:

number-of-metric-API-calls-per-hour ~= (number-of-selected-technologies x 2) x (snapshots-for-selected-technologies / 30) x (60 / collection-interval)
number-of-events-API-calls-per-hour = 60

This formula is not always 100% accurate, as each technology or plug-in has a different number of metrics collected (the mean value across these is used, which is 2 collection cycles per technology). If the environment is unbalanced toward either end of the spectrum (for instance, if you have mostly hosts that define the most metrics), then the formula might underestimate the required limit.

To determine the number of resources (snapshots) for each infrastructure pluginAPI, you can use the following:

api/infrastructure-monitoring/snapshots?plugin=technology_name

Example:

api/infrastructure-monitoring/snapshots?plugin=host

For more information about Instana APIs, see Instana API.

With the following example curl commands, you can retrieve the number of the following resources:

  • snapshots-for-selected-technologies (such as host)

    curl -k -s --request GET 'https://<instana server hostname>/api/infrastructure-monitoring/snapshots?plugin=host' --header 'Authorization: apiToken <api token>' | jq '.items|length'
    
  • number-of-application-perspectives

    curl -k -s --request GET 'https://<instana server hostname>/api/application-monitoring/applications' --header 'Authorization: apiToken <api token>' | jq '.items|length'
    
  • number-of-services

    curl -k -s --request GET 'https://<instana server hostname>/api/application-monitoring/services' --header 'Authorization: apiToken <api token>' | jq '.items|length'
    

Adaptive rate limiting

Cloud Pak for AIOps applies adaptive rate limit handling when you start the APIs to fetch infrastructure metrics from Instana. It adjusts throttling based on the available quota, adds safety buffers to prevent limit breaches, progressively slows API requests as quota decreases, and help ensure a minimum service level even under low quota conditions. The rate limit is enforced per API token.

To prevent the rate-limiting issues, you can split the Instana Connector integration into multiple integrations. For more information, see Splitting Instana Connector integration into multiple integrations for metric data collection.

Enabling and disabling Instana integrations

If you didn't enable your data collection during creation, you can enable your integration afterward. You can also disable a previously enabled integration the same way. To enable or disable a created integration, complete the following steps:

  1. Log in to IBM Cloud Pak for AIOps console.

  2. Expand the navigation menu (four horizontal bars), then click Define > Integrations.

  3. On the Manage integrations tab of the Integrations page, click the Instana integration type.

  4. Click the integration that you want to enable or disable.

  5. Go to the Collect event data section. Enable the toggle button if required.

  6. Go to the Collect metric data section. Enable the toggle button if required.

Note:
  • Disabling data collection for an integration does not delete the integration. For more information about deleting an integration, see Deleting Instana integrations.
  • Disabling and enabling an Instana integration starts an event data hard resynchronization between Instana and Cloud Pak for AIOps. For more information, see Data resynchronization.

Data resynchronization

The Instana connector data resynchronization on event data collection between Instana and Cloud Pak for AIOps.

  • Full connector resynchronization: Whenever a pod restarts and detects a UI configuration change, it triggers a data resynchronization. This process aligns Cloud Pak for AIOps alerts with what the connector believes that it has sent. If an alert remains active in Cloud Pak for AIOps but is already closed in Instana, Cloud Pak for AIOps automatically closes the alert with the reason Runtime Resync.

    Note: Disabling and enabling an Instana integration is considered as a configuration change, which initiates a hard resynchronization.
  • Runtime resynchronization: During normal operation, the system continuously checks the current state of events and uses validation logic to help ensure Cloud Pak for AIOps alerts truly match Instana. The validation spans two polling cycles to prevent orphaned active alerts that are already closed in Instana.

    Together, these mechanisms make sure consistent data and prevent missed alert closures.

Application filter

The connector now supports filtering events and metrics by using Instana application perspectives. You can enable this by specifying the name of the application you want to collect data for.

Event collection perpsective

  • No filter applied: The connector processes all events.
  • Filter applied with an incorrect application name: No application‑based events are processed (only events without an appId or serviceId).
  • Filter applied with a valid application name: The connector processes only the events for the specified application and filters out events from all other applications.
Note: The connector always captures infrastructure events (events without an appId or serviceId), even when an application filter is applied. If you do not want to process these events, use a custom JSONata function, $discard() to filter them out based on your requirements.

Instana incident–issue relationship grouping

Instana organizes events by using a structured hierarchy:
  • Incidents: Represent high‑level problems that impact users.
  • Issues: Issues are lower‑level events that may trigger or contribute to those incidents.

A single incident can link to multiple related issues.

The connector retains this incident‑issue relationship to improve how alerts are organized and analyzed in Cloud Pak for AIOps:
  • Supports deeper correlation analysis in Cloud Pak for AIOps.
  • Helps trace the root‑cause chain from issues up to incidents.
  • Enables grouping of related alerts based on Instana’s native incident model.

By preserving this structure, Cloud Pak for AIOps aligns with Instana’s incident‑grouping model, enabling more accurate and meaningful alert correlation.

Editing Instana integrations

After you create your integration, you can edit it. To edit an integration, complete the following steps:

  1. Log in to IBM Cloud Pak for AIOps console.

  2. Expand the navigation menu (four horizontal bars), then click Define > Integrations.

  3. Click the Instana integration type on the Manage integrations tab of the Integrations page.

  4. On the Instana integrations page, click the name of the integration that you want to edit. Alternatively, you can click the options menu (three vertical dots) for the integration and click Edit. The integration configuration opens.

  5. Edit your integration as required. Click Save when you are done editing.

    Instana integration

You have edited your integration. If you have not previously enabled or disabled your application, you can enable or disable the integration directly from the interface. For more information about enabling and disabling your integration, see Enabling and disabling Instana integrations. For more information about deleting an integration, see Deleting Instana integrations.

Configuring Instana alerts by using JSONata

You can use JSONata to configure how Instana events are processed in Cloud Pak for Cloud Pak for AIOps and create alerts from them. Use the following JSONata functions to customize how the Instana alerts are processed:

$discard : Use this function to define which Instana events must be excluded from processing as Cloud Pak for AIOps alerts. It can be combined with the custom functions $snapshotGet and $hasSnapshot to filter events based on associated snapshot data. See the Discarding with snapshot data examples section below for more details.

Example:

($.<field_name> in ["field_value1", "field_value2"] ? $discard() : { <jsonata_mapping> } )

In this example: <field_name> is any field in the Instana Event payload, and <field_value1> and <field_value2> are the values for that field that are discarded from processing.

Snapshot-specific functions

Snapshots represent the Instana entity that is associated with an event, such as a host, process, or Kubernetes container.

$snapshotGet
Use this function to get snapshot data associated with the Instana event. This configuration helps to further enrich the Cloud Pak for AIOps alert.
Parameter:
  • The event’s snapshotId.
  • The field name in the snapshot data that you want to retrieve.
Description:
  • The function retrieves the snapshot data that is associated with an event by using the event’s snapshotId field.
Example snapshot structure:
{
    "data": {
        ...
        "nodeName": "<field_value>",
        "clusterName": "<field_value>",
        "clusterLabel": "<field_value>",
        ...
    }
} 
Example:
"clusterLabel": $snapshotGet($.snapshotId, "clusterLabel")

This retrieves the clusterLabel field from the snapshot that is associated with the event.

Note: Snapshot fields vary depending on the entity type. Different entity types might expose different snapshot properties.
$hasSnapshot
Use this function to verify whether an event has valid Instana snapshot data that is associated with it.
It checks that the snapshotId exists and that the snapshot can be queried for extra fields.
Parameter:
  • The event’s snapshotId.
Description:
  • This function can be combined with $snapshotGet to conditionally retrieve snapshot fields only when a valid snapshot is present.
Example:
"clusterLabel": $hasSnapshot($.snapshotId)     ? $snapshotGet($.snapshotId, "clusterLabel")     : undefined

Discarding with snapshot data examples

Using $discard with $snapshotGet:
( $snapshotGet($.snapshotId, <field_name>) in ["field_value1", "field_value2"] ? $discard() : { <jsonata_mapping> })
In this example:
  • $snapshotGet fetches a field from the snapshot that is associated with the event.
  • Events whose snapshot field value matches field_value1 or field_value2 are discarded.
  • Adjusting the JSONata mapping allows you to let events pass instead of discarding them.
Using $discard with $hasSnapshot:
( $.entityType = "INFRASTRUCTURE" and $not($hasSnapshot($.snapshotId)) ? $discard() : { <jsonata_mapping> } )
Here:
  • $hasSnapshot checks if the event has a corresponding snapshot.
  • Only INFRASTRUCTURE events are evaluated because snapshot data applies only to this class of events.
  • Events without snapshot data are discarded; others continue with standard JSONata mapping.

Sample JSONata

See the following sample JSONata that is used to create an alert from an Instana event:

(
    {
        "sender": {
            "managedBySender": "true",
            "name": "Instana",
            "type": "instana"
        },
        "resource": {
            "name": $.snapshotId,
            "sourceId": $.snapshotId,
            "type": $.entityType,
            "clusterUuid": $hasSnapshot($.snapshotId) ? $snapshotGet($.snapshotId,"clusterUuid") : undefined,
            "clusterLabel": $snapshotGet($.snapshotId,"clusterLabel"),
            "port": $snapshotGet($.snapshotId,"subsets[0].ports[0].name") = null ? undefined : $snapshotGet($.snapshotId,"subsets[0].ports[0].name")
        },
        "type": {
            "classification": ($.type) = "incident" ? 'Incident - ' & $.entityLabel & ' - ' & $.problem : $.entityLabel & ' - ' & $.problem,
            "eventType": ($.state) = "open" ? "problem" : "resolution"
        },
        "firstOccurrenceTime": $fromMillis($.start),
        "lastOccurrenceTime": $.end > $millis() ? ($millis() < $.start ? $fromMillis($.start) : $now()) : $fromMillis($.end),
        "deduplicationKey": $.eventId,
        "expirySeconds": $.type = "change" ? 180 : 0,
        "eventCount": 1,
        "state": $.type = "change" ? "open" : ($.state = "manually_closed" ? "closed" : $.state),
        "signature": $.eventId,
        "summary": $.entityLabel & ' - ' & $.problem,
        "severity": $.severity = 10 ? 6 : $.severity = 5 ? 3 : 1,
        "insights": [
            {
                "details": {
                        "lastProcessedEventOccurrenceTime": $.end > $millis() ? ($millis() < $.start ? $fromMillis($.start) : $now()) : $fromMillis($.end)
                },
                "id": "event-occurrence",
                "type": "aiops.ibm.com/insight-type/deduplication-details"
            }
        ]
    }
)

Deleting Instana integrations

If you no longer need your Instana integration and want to remove it completely, delete the integration from the console instead of disabling it.

To delete an integration, complete the following steps:

  1. Log in to IBM Cloud Pak for AIOps console.

  2. Expand the navigation menu (four horizontal bars), then click Define > Integrations.

  3. Click the Instana integration type on the Manage integrations tab of the Integrations page.

  4. On the Instana integrations page, click the options menu (three vertical dots) for the integration that you want to delete and click Delete.

  5. Enter the name of the integration to confirm that you want to delete your integration. Then, click Delete.

Your integration is deleted.