# How to configure a monitoring event for apps

{% embed url="<https://youtu.be/BwZJkQCgJKM?feature=shared>" %}
Quick 'How-to' video with steps to monitor ZBrain apps
{% endembed %}

### **Step 1: Access the monitoring configuration** <a href="#step-1-access-the-monitoring-configuration" id="step-1-access-the-monitoring-configuration"></a>

To set up monitoring for an application:

**Access the app session:**

* Navigate to the Apps page
* Click on your desired application
* Go to the query history section of the app
* Select a specific user session from the list to monitor (shows session ID, user info, prompt count)

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FHPsIZ6mDKmMbePuts6SZ%2Fimage.png?alt=media&#x26;token=a634a6b1-b80e-49dc-9063-ea7305f55b7a" alt=""><figcaption></figcaption></figure>

**Review the conversation:**

* View the session details and chat history. You can configure monitoring events at the query level. For instance, in a conversation containing multiple queries, each query can have its own monitoring event
* Examine the response options (copy, conversation logs, edit annotation reply and feedback)

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FdDRUH46PVRhJDmXtTT2z%2Fimage.png?alt=media&#x26;token=a223b734-7787-439a-99d0-294bef3123d3" alt=""><figcaption></figcaption></figure>

**Access conversation logs:**

* Click 'Conversation Log' to see the interaction details of a specific query
* Review status, time, and token usage
* Check the input, output, and metadata

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2F7iktzPu6WsLqFtXcjSMk%2Fimage.png?alt=media&#x26;token=974813a4-cee9-4302-8f97-d876f424ebb2" alt=""><figcaption></figcaption></figure>

**Enable monitoring:**

* Click the ‘Monitor’ button in the overview tab
* Click ‘Configure now’ when prompted with ‘Added for monitoring’

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2F5C3IPNAjPoa6HczseAE0%2Fimage.png?alt=media&#x26;token=7a84029c-f399-45e3-8bc8-92e7b02764d8" alt=""><figcaption></figcaption></figure>

### **Step 2: Configure event settings** <a href="#step-2-configure-event-settings" id="step-2-configure-event-settings"></a>

You will be redirected to the Events > Monitor page. In the last status column, click ‘Configure’ to open the event settings page. On the event settings screen:

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2Fv10AQgKT3exlLklQ8XQE%2Fimage.png?alt=media&#x26;token=580b9aa8-9bd1-4715-a140-4f284a61b39d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2Fal0mC3k8DSOqnFZhmJrz%2Fimage.png?alt=media&#x26;token=06c09e12-4f95-4f13-aada-d310296ec277" alt=""><figcaption></figcaption></figure>

1. **Review entity information**
   * **Entity name:** The name of your application
   * **Entity type:** The type of entity being monitored (e.g., App)
2. **Verify monitored content**
   * **Monitored input:** The query or prompt being evaluated
   * **Monitored output:** The response being assessed
3. **Set evaluation frequency**
   * Click the dropdown menu under "Frequency of evaluation."
   * Select the desired interval (Hourly, Every 30 minutes, Every 6 hours, Daily, Weekly, or Monthly)

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2F6GFefPya6mjbTo75ezR0%2Fimage.png?alt=media&#x26;token=721bec1d-1ee6-4cf7-b20d-4844e374845c" alt=""><figcaption></figcaption></figure>

4. **Configure evaluation conditions**
   * Click ‘Add metric’ in the Evaluation Conditions section
   * Select a metric type from the available metric types:
     * Non-LLM
     * LLM-based
     * LLM-as-a-judge
     * Performance

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FPyLflaW6LaSgt8uXrowR%2Fimage.png?alt=media&#x26;token=b0a40bd3-dc16-4172-a6d6-3f08433148b8" alt=""><figcaption></figcaption></figure>

* Choose the evaluation method (is less than, is greater than, or equals to)
* Set the threshold value (0.1 to 5.0)
* Click ‘Add’ to save the metric

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2Fdire8Q4gQNl4KviqnjYS%2Fimage.png?alt=media&#x26;token=34051792-570d-41c1-85f3-e58f15d6ef0a" alt=""><figcaption></figcaption></figure>

* Set the "Mark evaluation as" dropdown to fail or success

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FuqJ4Eu0MiXX3i6x5NZ1D%2Fimage.png?alt=media&#x26;token=817ea1d3-3b78-42e9-912d-b43e0b800716" alt=""><figcaption></figcaption></figure>

5. **Configure notifications**

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FZnMVexN3DLwjzyitphOh%2Fimage.png?alt=media&#x26;token=33358e4c-33bc-4539-bfa6-c8f97642486c" alt=""><figcaption></figcaption></figure>

* Toggle the ‘Send Notification’ option to enable alerting for this monitoring event.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FEbbhKrP6MyiOYhPph69m%2Fimage.png?alt=media&#x26;token=7988e7de-d1d7-4996-9883-163e2829c846" alt=""><figcaption></figcaption></figure>

* Click ‘+ Add a Flow from the Flow Library’. This opens the ‘Add a Flow’ panel. This interface allows you to configure notification flows through a dual-tabbed layout.
  * The side panel includes two tabs:
    * Default: Contains predefined ZBrain template Flows.
    * Custom: Displays custom-built Flows created.
  * Choose a Flow from either the Default or Custom tab based on your notification needs.
  * The interface prevents duplication by restricting the addition of the same Flow across multiple notifications.
  * Flows that have already been assigned will be unavailable for selection, ensuring each notification uses a unique Flow.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FWgtncSbliiURI99H6yrU%2Fimage.png?alt=media&#x26;token=c3530698-dc43-45d3-b4d9-cdf9329b2ebf" alt=""><figcaption></figcaption></figure>

* In the panel, search for the desired notification flow and select it.
* You can configure multiple notification flows for a single monitoring event, allowing you to send alerts simultaneously across various channels.
* The system prevents adding the same flow more than once to avoid redundant alerts or conflicts.
* Upon meeting the evaluation trigger conditions, all attached flows are executed in parallel.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2Fhu08Wm0i7sZaqUW597su%2Fimage.png?alt=media&#x26;token=647329ac-e32c-4f32-a745-d1e87352d567" alt=""><figcaption></figcaption></figure>

* You can directly edit linked notification flows from the **Event Settings** screen, allowing you to quickly update or troubleshoot notification logic without needing to navigate away from the monitoring configuration, as it directly redirects you to the Flow page.
  * Click on the pencil icon ![memo](https://leewayhertz.atlassian.net/gateway/api/emoji/86e7216a-2b63-4398-aefe-391cdd46a4ec/1f4dd/path?scale=MDPI) beside the selected Flow.
  * It will redirect you to the defined Flow page, and here you can modify the logic.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FVz42AkNsA2SWHWZhBwP1%2Fimage.png?alt=media&#x26;token=b579fc28-77b0-46d9-a68b-74e9a6124692" alt=""><figcaption></figcaption></figure>

Click the Play ▶️ button to run a delivery test.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2F6hy03KoqOox4J0LYoMU5%2Fimage.png?alt=media&#x26;token=9cc3cc49-1718-46a0-b06e-224b494e3312" alt=""><figcaption></figcaption></figure>

**Note:** Users cannot update the event settings until a valid notification flow passes the delivery test.\
Once the flow passes the delivery test, notifications will be sent via the chosen communication channel whenever the associated event fails.

### Test Evaluation Settings in event monitoring <a href="#test-evaluation-settings-in-event-monitoring" id="test-evaluation-settings-in-event-monitoring"></a>

You can test the evaluation settings configuration from the **Test Evaluation Settings** panel within the page. This panel allows you to choose between using your own manual test input or relying on system-generated LLM outputs when running evaluation tests. The feature provides flexibility in simulating different test scenarios across **Agents, Apps, and Reasoning** configurations.

**Note: Apps & Reasoning**: Manual input is optional and turned off by default.

To test the settings

* Navigate to Monitor and select an event.
* Click **Event Settings,** which will open **Event Monitoring Settings**
* Once you configure all settings, click the **Test** button to open the **Test Evaluation Settings** panel on the right.
  * Toggle **Manually input test value** to ON. A **Test Message** input field will appear.
    * When **Manual Input is** ON, the evaluation compares the LLM output with your custom message using configured metrics.
      * Enter your custom reference message for comparison.
    * When **Manual Input is** OFF, the evaluation runs only against the system-generated LLM output and metrics.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FCNC6yX7hyQ55LJZnUJiP%2Fimage.png?alt=media&#x26;token=10d57744-c4f6-4c68-87aa-8f28793592b0" alt=""><figcaption></figcaption></figure>

* Once you click 'Test', it validates the configuration in monitoring tests by ensuring that the model and temperature values match the exact configuration defined in the associated app. The metrics now dynamically align with the actual model selected in the entity, making evaluation results more realistic and aligned with runtime behavior.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FNzvL1cpTBjEZ3DbpZo95%2Fimage.png?alt=media&#x26;token=4ac33ef0-370f-4d95-942d-7dab28d8eb40" alt=""><figcaption></figcaption></figure>

* To receive a notification for the test evaluation report immediately after a test, enable the Send Notification toggle in the Test Evaluation Settings panel of the monitoring module. This toggle is available on the right side of the Test Evaluation Settings panel.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FirSEeMv25dkWkVa0osoL%2Fimage.png?alt=media&#x26;token=a2f6dd48-0f44-4bff-81cf-1bf4c2a4f79c" alt=""><figcaption></figcaption></figure>

* Select a Flow to send an email notification. If no flow is selected, it still appears but gives a validation erro&#x72;*.*

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2F9k3Z9OsuCYGc5ElI4vpq%2Fimage.png?alt=media&#x26;token=7c4309f2-2ff5-4403-8c0a-f1f098a12a23" alt=""><figcaption></figcaption></figure>

* Hovering over the (i) icon displays the message: *‘If enabled, you’ll receive a notification with the evaluation report,’* ensuring clarity for the user.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FjArx8gkIwDtQjYxOlTdm%2Fimage.png?alt=media&#x26;token=2e1cc462-914a-46a5-b87e-da4439518e16" alt=""><figcaption></figcaption></figure>

* Click the ‘**Reset’** button to clear the input if needed.
* Run the Test and review results
* Save your configuration and click ‘Update’ to save and activate your monitoring event
