Configuring for using Business Automation Insights

You can configure the Decision Intelligence Client Managed Software custom resources (CR) to emit events to Business Automation Insights.

Before you begin

Get the following information about Business Automation Insights.

URL for Apache Kafka:
BOOTSTRAP_SERVERS=$(oc get kafka iaf-system -o jsonpath='{.status.listeners[?(.name=="external")].bootstrapServers}')
Username and password for Kafka:
KAFKA_SECRET=$(oc get kafkauser icp4ba-kafka-auth-0 -o jsonpath='{.status.secret}')
KAFKA_USERNAME=${KAFKA_SECRET}
KAFKA_PASSWORD=$(oc get secret ${KAFKA_SECRET} -o jsonpath='{.data.password}' | base64 -d)
Kafka certificate in plain text:
KAFKA_CA_CERT=$(oc get kafka iaf-system -o jsonpath='{.status.listeners[?(.name=="external")].certificates[0]}')

For more information, see Retrieving information for connection to Kafka External link opens a new window or tab in the Business Automation Insights documentation.

Procedure

  1. Create a secret to store the information about Kafka.
    Create a secret with the credentials to connect to Kafka based on the information that is gathered in Before you begin:
    kind: Secret
    apiVersion: v1
    metadata:
      name: kafka-auth
    stringData:
      kafka-username: <the KAFKA_USERNAME from previous step>
      kafka-password: <the KAFKA_PASSWORD from previous step>
      kafka-server-certificate: <the KAFKA_CA_CERT from previous step >
    type: Opaque
    For more information, see Configuring the event emitter for an external Apache Kafka instance.
  2. Edit the CR.
    Edit the Decision Intelligence Client Managed Software CR to configure the decision runtime to send events to Kafka in Business Automation Insights:
    spec:
      decision_runtime:
        event_emitter:
          enabled: true
          kafka_bootstrap_servers: <The BOOTSTRAP_SERVERS from previous step>
          kafka_connection_secret_name: kafka-auth <= the name of the secret created before
          kafka_sasl_mechanism: SCRAM-SHA-512
          kafka_security_protocol: SASL_SSL
          kafka_topic: icp4ba-bai-ads-ingress 
    For more information about the event_emitter.* parameters, see Decision runtime parameters.

    Apply the Decision Intelligence Client Managed Software CR to enable the event emitter.

  3. Verify that the event emitter is enabled.
    Query the decision runtime API to check whether the emitter is enabled:
    curl -X 'GET' \ 'https://<cpd-url>/ads/runtime/api/v1/health' \ -H 'accept: application/json'
    It returns something similar to the following result:
    {
      "status": "PASS",
      "archiveStorageStatus": "READY",
      "metadataStorageStatus": "READY",
      "eventEmitterStatus": "READY"
    }

What to do next

For more information about emitting events to Business Automation Insights, see Emitting decision execution events.