This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Configuring Alerts

WSO2 API Manager Analytics allows you to customize and configure the analytics-based alerts sent to the subscribers using the features listed below.

Before you begin...

Make sure that you have configured Analytics for API Manager. For instructions, see Configuring APIM Analytics.

Edit alerts as business rules

  1. Go to the <API-M_ANALYTICS_HOME>/ bin directory and run the following command to start the dashboard, if you have not started it already.

  2. Go to the Business Rules and Status Dashboard. (e.g.,  https://localhost:9643/business-rules)
  3. You can view the existing business rules that are applied for API Manager. Depending on your privileges, you can view, edit, and delete business rules. 
    For more details on working with business rules, see Managing Business Rules.

Configuring alerts via the Publisher

The users of your APIs can subscribe to analytics-related alerts from the API Publisher and the API Store.  Follow the instructions below to manage alerts via the Publisher:

You can not disable Health Availability related alerts, because they are enabled by default. However, you can enable and disable the email alerts that correspond to the Health Availability alerts.

Creating an abnormal response time alert

  1. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  2. Sign in to the API Publisher.
    https://localhost:9443/publisher
  3. Click Manage Alert Types.

    The Manage Alert Types page appears.
  4. Click on the setting option that corresponds to the Abnormal Response Time option.
  5. Select the API for which you need to set up the alerts.
  6. Define the time period (in milliseconds).
    Immediately after the response period of the API exceeds the above defined time period an alert gets triggered, such alerts could be treated as an indication of a slow WSO2 API Manager runtime or a slow backend.

  7. Click Save.

Updating an abnormal response time alert

  1. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  2. Sign in to the API Publisher.
    https://localhost:9443/publisher
  3. Click Manage Alert Types.
  4. Click on the setting option that corresponds to the Abnormal Response Time option.
  5. Update the alert.
    • To edit a abnormal response time alert -
      1. Select the API that corresponds to the existing alerts.
      2. Define the new time period (in milliseconds).
      3. Click Save.
        This will update the existing alert details.
    • To delete a abnormal response time alert, click the Remove option that corresponds to the respective API.

Enabling an abnormal backend time alert

  1. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  2. Sign in to the API Publisher.
    https://localhost:9443/publisher
  3. Click Manage Alert Types.
  4. Click on the setting option that corresponds to the Abnormal Backend Time option.
  5. Select the API for which you need to set up the alerts.
  6. Define the time period (in milliseconds).
    Immediately after the backend time of the API exceeds the above defined time period an alert gets triggered, such alerts could be treated as an indication of a slow backend. In technical terms, if the backend time of a particular API of a tenant lies outside the predefined value, an alert is sent.
  7. Click Save.

Updating an abnormal backend time alert

  1. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  2. Sign in to the API Publisher.
    https://localhost:9443/publisher
  3. Click Manage Alert Types.
  4. Click on the setting option that corresponds to the Abnormal Backend Time option.
  5. Update the alert.
    • To edit an existing abnormal backend time alert -
      1. Select the API that corresponds to the existing alert.
      2. Define the new time period (in milliseconds).
      3. Click Save.
        This will update the existing alert details.
    • To delete an abnormal backend time alert, click the Remove option that corresponds to the respective API.

Subscribing to emails based on Publisher alerts

  1. Configure the sender's details for the email alerts.

    Follow the instructions below to configure an email address with API Manager to send email alerts to subscribers.

    1. Open the <API-M_ANALYTICS_HOME>/conf/worker/deployment.yaml file. 
    2. Configure the sender email address.
      The sample code is shown below.

      • If you are using Gmail as the SMTP host.

        siddhi:
          extensions:
        ...
            -
              extension:
                name: email
                namespace: sink
                properties:
                  username: alex@gmail.com
                  address: alex@gmail.com
                  password: password 
        ...
      • If you are using an SMTP host other than Gmail.

        siddhi:
          extensions:
        ...
            -
              extension:
                name: email
                namespace: sink
                properties:
                  username: <senders-email-username>
                  address: <senders-email-address>
                  password: <senders-email-password>
                  host: <senders-email-host>
                  port: 25
                  ssl.enable : false
                  auth : false
                  mail.store.protocol: pop3
        ...

        For more details on the email sender configurations, see the Siddhi IO Email configurations in the offical Siddhi documentation.

        Note that you might have to bypass a security warning to configure this with a private email address.

        If you encounter the 'javax.mail.AuthenticationFailedException: Username and Password not accepted' exception for gmail after deploying APIM_ALERT_EMAIL_NOTIFICATION.siddhi app, open https://www.google.com/settings/security/lesssecureapps being signed in with the username added in the config and Turn on 'Allow less secure apps'

    3. Go to the <API-M_ANALYTICS_HOME>/resources/apim-analytics/ directory. Copy the APIM_ALERT_EMAIL_NOTIFICATION.siddhi file and paste it in the <API-M_ANALYTICS_HOME>/wso2/worker/deployment/siddhi-files directory.
    4. Restart the WSO2 API-M Analytics and WSO2 API-M Servers.
      For more information see, Configuring APIM Analytics.

  2. Sign in to the API Publisher.
    https://localhost:9443/publisher
  3. Click Manage Alert Types.
  4. Select the alert options that you wish to start receiving emails on.
  5. Click Save.

Unsubscribing from emails based on Publisher alerts

  1. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  2. Sign in to the API Publisher.
    https://localhost:9443/publisher
  3. Click Manage Alert Types.
  4. Deselect the alert options that you wish to stop receiving emails on.
  5. Click Unsubscribe.

Configuring alerts via the Store

The users of your APIs can subscribe to analytics-related alerts from the API Publisher and the API Store.  Follow the instructions below to manage alert types via the Store:

You can not disable Abnormal Resource Access Alerts, Unseen Source IP Access Alerts and Tier Crossing Alerts, because they are enabled by default. However, you can enable and disable the email alerts that correspond to the latter mentioned alerts.

Creating an abnormal request count alert

  1. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  2. Sign in to the API Store.
    https://localhost:9443/store
  3. Click Manage Alert.
    The Manage Alerts page appears.
  4. Click on the setting option that corresponds to the Abnormal Request Count option.
  5. Select the application for which you need to set up the alerts.
  6. Select the API for which you need to set up the alerts.
    Only the APIs that you have subscribed to using the latter mentioned application are displayed.
  7. Define the request count (per minute).
    Immediately after the request count of the API exceeds the above defined time period an alert gets triggered. These alerts could be treated as indications of possible high traffic, suspicious activity, possible malfunction of the client application etc.
  8. Click Save.

Updating an abnormal request count alert

  1. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  2. Sign in to the API Store.
    https://localhost:9443/store
  3. Click Manage Alert.
  4. Click on the setting option that corresponds to the Abnormal Request Count option.
  5. Update the alert.
    • To edit an abnormal response count alert -
      1. Select the application that corresponds to the existing alert.
      2. Select the API that corresponds to the existing alert.
      3. Define the new request count (per minute).
      4. Click Save.
        This will update the existing alert details.
    • To delete an abnormal response count alert, click the Remove option that corresponds to the respective API.

Subscribing to emails based on Store alerts

  1. Configure the sender's details for the email alerts.
    Follow the instructions below to configure an email address with API Manager to send email alerts to subscribers.

    1. Open the <API-M_ANALYTICS_HOME>/conf/worker/deployment.yaml file. 
    2. Configure the sender email address.
      The sample code is shown below.

      • If you are using Gmail as the SMTP host.

        siddhi:
          extensions:
        ...
            -
              extension:
                name: email
                namespace: sink
                properties:
                  username: alex@gmail.com
                  address: alex@gmail.com
                  password: password 
        ...
      • If you are using an SMTP host other than Gmail.

        siddhi:
          extensions:
        ...
            -
              extension:
                name: email
                namespace: sink
                properties:
                  username: <senders-email-username>
                  address: <senders-email-address>
                  password: <senders-email-password>
                  host: <senders-email-host>
                  port: 25
                  ssl.enable : false
                  auth : false
                  mail.store.protocol: pop3
        ...

        For more details on the email sender configurations, see the Siddhi IO Email configurations in the offical Siddhi documentation.

        Note that you might have to bypass a security warning to configure this with a private email address.

        If you encounter the 'javax.mail.AuthenticationFailedException: Username and Password not accepted' exception for gmail after deploying APIM_ALERT_EMAIL_NOTIFICATION.siddhi app, open https://www.google.com/settings/security/lesssecureapps being signed in with the username added in the config and Turn on 'Allow less secure apps'

    3. Go to the <API-M_ANALYTICS_HOME>/resources/apim-analytics/ directory. Copy the APIM_ALERT_EMAIL_NOTIFICATION.siddhi file and paste it in the <API-M_ANALYTICS_HOME>/wso2/worker/deployment/siddhi-files directory.
    4. Restart the WSO2 API-M Analytics and WSO2 API-M Servers.
      For more information see, Configuring APIM Analytics.

  2. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  3. Sign in to the API Store.
    https://localhost:9443/store
  4. Click Manage Alert.
  5. Select the alert options that you wish to start receiving emails on.
  6. Click Save.

Unsubscribing from emails based on Store alerts

  1. Start the WSO2 API-M Analytics and WSO2 API-M Servers.
    For more information see, Configuring APIM Analytics.
  2. Sign in to the API Store.
    https://localhost:9443/store
  3. Click Manage Alert.
  4. Deselect the alert options that you wish to stop receiving emails on.
  5. Click Unsubscribe.