Skip to Content
Technical Articles

Receive Notifications for Failed SAP Cloud Platform Integration Flows via Any Channel with Alert Notification

Pre-read

This blog post is part of a series of blog posts related to SAP Cloud Platform Alert Notification service.

You can relate to the parent blog post for more detailed information about the service itself.

Very often, we have multiple Integration Flows running in our SAP Cloud Platform Integration environment. Depending on their setup and dependencies, those can fail due to numerous reasons.

We are happy to tell you that SAP Cloud Platform Alert Notification is now integrated with SAP Cloud Platform Integration. You are now able to understand about every Integration Flow failure that happens via the alert management channel you like.

How does it work?

What we have done so far is that we have introduced a package, available on SAP API Business Hub. Once you configure this package into your SAP Cloud Platform Integration tenant, it is going to start reading the Message Processing Logs for you. Then it is going to send failures to SAP Cloud Platform Alert Notification. On the Alert Notification side, you can subscribe to receive that notifications.

The whole process of the configuration takes about 30 minutes. Read on to find out a short tutorial of how to configure your Cloud Platform Integration and Alert Notification.

Configure and receive your first alerts

Prerequisites

  1. You need to have an active subscription for SAP Cloud Platform Integration
  2. You need to have an active subscription for SAP Cloud Platform Alert Notification

Configure SAP Cloud Platform Alert Notification

What we are going to do first is to obtain credentials which Cloud Platform Integration needs.

Also, we are going to create the subscriptions for receiving an alert. In our example, we are going to use email. However, Alert Notificaitton supports multiple channels such as – SAP Solution Manager or Focused Run for Solution Manager, Slack. And virtually any alert management tool which supports WebHook such as ServiceNow, Jira, etc.

 

Obtain Credentials from Alert Notification

Let’s obtain the credentials that we are going to need. Depending on your setup, you can use either BASIC or OAuth authentication. In this example, I am going to use BASIC.

  1. Navigate to Alert Notification UI in your Cloud Cockpit. This you can find in the Subscriptions tab of your CF Space or Neo Subaccount.
  2. Click on the Service Key section and then on the Create Service Key button
  3. In the popup give the credentials a meaningful name and also put the following lines if you want basic authentication in the Configuration Parameter input field.
    {"type":"BASIC"}​

  4. Click on the Save button. Once you do that you will see your credentials for a given landscape. You are going to need those later on when you configure your CPI.

 

Configure Subscription in Alert Notification

We have prepared the configuration for you all you have to do is to import it. With this configuration, you are going to receive a notification for each failed integration flow in your CPI tenant. You can fine-tune this and filter it for particular integration flows. This is explained later in that blog post.

  1. In the JSON below replace <Your Email> with the email you want to receive a notification to.
    {
      "conditions": [
        {
          "name": "CPIIntegrationFlowIsFailed",
          "propertyKey": "eventType",
          "predicate": "EQUALS",
          "propertyValue": "CPIIntegrationFlowExecutionFailure",
          "labels": [],
          "description": ""
        }
      ],
      "actions": [
        {
          "name": "SendMeAnEmail",
          "state": "ENABLED",
          "labels": [],
          "description": "",
          "destination": "<Your Email>",
          "type": "EMAIL"
        }
      ],
      "subscriptions": [
        {
          "name": "FailedIFlow",
          "conditions": [
            "CPIIntegrationFlowIsFailed"
          ],
          "actions": [
            "SendMeAnEmail"
          ],
          "labels": [
            "CPI"
          ],
          "state": "ENABLED",
          "description": ""
        }
      ]
    }
  2. Click on the Import/Export section of the Alert Notification UI and paste the JSON. Then click import.
  3. Note: You need to confirm your email. To do so, go to the Actions tab, click on the SendMeEmail action, click on the action and click the Confirm Action button. Then follow the instructions.
  4. Optional: Once you are done, you can also send a test alert. Go your subscription in the Subscriptions section and click on Send Test Event button.

 

Configure SAP Cloud Platform Integration

Before you start with this section, you should have:

  1. Credentials name for a user that has permissions in the CPI tenant. The default value is CPI_USER.
  2. Service Technical Client Name: Credentials name for the technical client created in SAP Cloud Platform Alert Notification. Supported types are Basic Authentication or OAuth2 Client Credentials flow. The default value is SERVICE_TECHNICAL_CLIENT. It should hold the basic or OAuth credentials that we have configured in the previous section.

 

Once you have done this, follow the steps below:

  1. Go to the Discover section in SAP Cloud Platform integration and search for SAP Cloud Platform Alert Notification
  2. Once you find the integration flow click on it then click on the Copy button.
  3. Once you have copied the integration flow, you should be able to find it in the Design section.
  4. Click on the Integration Flow it should look like this.
  5. Click on the Configure button. On the first screen, set a timer to point how often do you want it to run. The default is 5 minutes.
  6. In the Receiver tab, you should configure your CPI tenant and also point to the user who has permissions in that tenant.
  7. In the More tab, configure the Alert Notification endpoint and authentication from the previous steps.
  8. Click on the Deploy button. Once the integration flow is deployed, and some integration flow in your tenant fails, you will receive an email with similar content.

If you want to filter the notifications for specific integration flows you can simply play a little with the conditions in Alert Notification and filter by cpi:integrationArtificat.Id

What’s Next?

We are working on ever seamless integration between Alert Notification and SAP Cloud Platform Integration, so stay tuned.

A lot of new features will come in Alert notification amongst which are – SMS and ServiceNow integration.

We are looking forward to trying this out and give us feedback.

57 Comments
You must be Logged on to comment or reply to a post.
  • Thanks Kiril. Alert Notification is always there in every flow. It is exciting that we have separate service for it now.

    I tried to replicate the steps, however, I can't see Alert Notification service under DevOps. Am I missing a step?

    Kind regards,

    Bala

    /
    • Dear Bala,

      thanks for the comment.
      can you contact me at: k.gavrailov at sap dot com I am going to take to the technical team.
      also can you mention which is this landscape?

      Thanks,

      Kiril

    • Dear Sri,

      thank you for your comment.
      It is possible to get the service everywhere. We are providing it based on customer demand for CF, for Neo it is going to be configured for all available Neo landscapes during Q4.

      Next in line is the US3 region (US Chandler) which is planned to be available next Friday (25.10), of course, delays might occur.

      Next in our priority are Sao Paolo and Sydney for both CF and Neo environments. We are working on a detailed roadmap for this.

      Can I ask you which are the regions that are an interest for you in order to provide you with more accurate timelines? You can drop me an email to - k.gavrailov at sap dot com in order to discuss details.

      Thank you,

      Kiril

       

    • Dear Adam,

      thank you for the comment.

      Currently, Alert Notification is available on the Cloud Foundry Trial. However, the CPI scenario should work fine with that, as it is a matter of configuration, so you can simply configure CPI to work agains CF trial. We do not have plans for getting ANS on Neo Trial at this moment.

       

      Thanks,

      Kiril

  • Hello Kiril,

    On our Alert Notification overview page, I couldn't find the "Service Keys" option.

    I could not find that under the Sub-account Subscriptions too. Can you please help?

    Best Regards,

    Anirban

    /
  • Hi Kiril,

    Could you please let me know if this particular feature is applicable in the CPI trial account.

    I have followed your post & could complete till the part where we create an Alert Instance.
    After that I could not find the Import/Export option in the Alert Notification UI.

    /
    • Dear Shreyashri,

      thank you for your question.

      We are experiencing some challenges with trial landscape. We are working on a fix. I will keep you posted once we have this.

      Thanks,

      Kiril

  • Hi Kiril,

    We are planning to subscribe for SAP CPI over Neo with Enterprise Edition. Do we have this alert service bundled with Enterprise edition ? Can you share any source for this information ?

     

    BR

    shobhit

     

    • Dear Shobbit,

      Please excuse me for the delayed response, I was on vacation.

      We are working into bundling the ANS into Enterprise Edition, it should happen very soon, I will keep you posted once we have it.

      Cheers,

      Kiril

  • Hi Kiril Gavrailov,

    Thanks for writing great blog with good example.

    I have followed your blog and i achieved the alert notification. my client is asking to configure sender mail id  as custom  ex : abcd@xyz.com. Can you guide me where i can configure custom from mail id in SCP alert mechanism.

     

    Regards,

    Prardhana S

    • Dear Prardhana,

      thank you for getting in touch.

      To setup this, you can refer to that help page in the section "Email with custom SMTP server Action".

       

      In case you have additional questions don't hesitate to get in touch.

       

      Cheers,

      Kiril

    • Dear Prardhana,

      Thank you for getting in touch. Can you elaborate a bit more on what attachments would be? Are those some files with content in them? If it is too long you are always welcome to drop me an email at - k.gavrailov at sap dot com.

      Thank you,

      Kiril

  • /
    • Dear Dhanish,

      thank you for getting in touch. This is so, because for Neo Alert Notification should first be acquired via SAP Store. https://www.sapstore.com/solutions/47001/SAP-Cloud-Platform-Alert-Notification-Service - once you do that the service is going to be visible into Cloud Cockpit.

      In case you have any more questions don't hesitate to ask.

       

      Thanks,
      Kiril

  • Hi Kiril,

     

    Quick Question : We are having CF CPIS subaccounts for Dev/QA/Prd.

    1. For ANS do we need to activate in the same subaccount where we have the CPIS subscription OR we can have a separate subaccount to subscribe for ANS ?
    2. Can we subscribe to ANS service and if it can be shared among 2 subaccounts. For Example, we can activate it production CPIS subaccount for production alerts and same service can be shared with QA for testing purpose.
    3. If point 2 is not possible then do we need to have seperate subsciption for ANS for QA and Prod subaccounts for alerting failed integration flows. IF yes, do SAP charge for non prod service ?

    BR,

    Shobhit

    • Dear Shobhit,

      thanks for your questions.

      1. No you can activate it in any subaccount and configure the CPI to send alerts to it. So separate or same it is your choice 🙂
      2. Yes, if you don't use ANS for alerts specific to the subaccount (like CPU or memory usage) but you use it for CPI notification this is possible.

       

      In case you have more questions don't hesitate to ask.

      Cheers,

      Kiril

  • Hi Kiril,

    We are using SAP CPIS in CLoud Foundry (Singapore).

     

    I am following this blog but can't find configuration link at

    Configure Subscription in Alert Notification - Point 1, 2...

    How can I configure in CF?

     

    vasu

     

     

    • Hi Vasu,

      thanks for getting in touch.

      Please refer to the attached screenshot in order to access the ANS. In case you have more questions don't hesitate to ask.

      /
  • HI Kiril,

     

    We have followed according to your blog but not able to receive any email alerts from CPI monitoring flows. And, also we tried to trigger test messages but not receiving any alerts. Kindly help to guide me. Can we get your contact number to reach you on clarification? Else, please reach me on vasudev.gem@gmail.com

     

     

     

     

     

  • Hi

     

    Can you please  confirm that errors on CPI flows in Neo environment can also be monitored and alerts sent to email?

     

    I can see ANS is for system load and availability etc... but it is not clear if we can monitor errors on the flows in CPI.

     

    Thank you

    Jurgen

  • Hi Kiril Gavrailov,

    I'm trying to get ANS working on a SCP Trial account on Cloud Foundry, everything is enabled, condition is 'eventType = Any value', I see events in the event log for my app but the ANS does not trigger and send me an email (Email address was confirmed). I've also set an action to store events but my API call comes back with HTTP 200 but no results.

    You mention a 'Send Test Event button.' but there is none that I can see...is this a Neo thing?

    Thanks, Peter

    /
    • Hi Peter,

      thanks for getting in touch. There’s one more configuration that has to be done in order to receive the app events for CF. You should add one of our technical users to your account as a Space Auditor, this will enable ANS to have permissions to take this information from the platform. In the trial case this is the EU10 user – sap_cp_eu10_ans@sap.com

      More information can be found on this help page

      Once you add the user wait for 5 minutes, then start/stop/restart your app and you’ll get an alert.

      If you have configured this and still do not receive alerts please do tell.

      Thanks,

      Kiril

       

      • I just wanted to say a big thanks Kiril Gavrailov for the solution which you correctly diagnosed but also for the quick response and actively helping us all even after you published this blog post back in 2019! All working now 🙂

        Thanks, Peter

  • Hi Kiril,

    Great Blog!!

    I followed all the steps, but I am facing one issue in artifact with receiver OData adapter throwing below error.

    Could you please tell me any solution to this?

    Thank you

    Sopan

    /
    • Hello dear Sopan,

       

      We are currently looking into your issue.

      In order to help us with the investigation could it be possible for you to provide us with some more details.

      We are mostly interested in the 'CI Tenant Base URL' property.

      If you want feel free to contact me directly at s.petkov@sap.com.

       

      Best Regards,

      Simeon

      • Hi Simeon and Kiril,

        Thank you for your reply!! Really appreciate the quick response.

        I have found the solution. The problem was with the user credential role. It worked fine after assigning the 'PI_Read_Only' role.

         

        Thanks and Regards,

        Sopan

         

  • Hi Kiril,

     

    Is Alert notification service available for Neo environment, US East (Sterling) region?

    I do not see it in available services yet.

     

    Regards,

    Rutika

  • Hi Kiril Gavrailov ,

    Thanks for the document.

    I am trying to replicate it on my CF trial account.

    I created service keys on BTP. I used same in my deployed std artfact.

    However I am getting 401 error.

    Please suggest what is wrong here.

     

     

    I tried this URL and basic authentication (service keys) in POSTMAN. I am getting same 401 error.

    TIA,

    Rashmi

    /
    • Hello dear Rashmi,

      the error you are experiencing is most probably caused because of the use of a technical client that supports OAuth 2.0 authentication in order to perform BASIC authentication. Can you, please, check this document and confirm that you're using the correct type of technical client for the authentication ?

      Best Regards,
      Martin

      • Hi Martin Lakov

        With Basic Aithentcation I was gettng 401 error so I tried with OAuth 2.0 authentcation and this time I am getting 404 error.

        Any idea what is causing this issue.

         

         

        Error Details
        org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[ID-bf06a028-7fcb-4501-6e16-1148-1620120744985-14-1], cause: Assertion failed: assert postRequest.getResponseCode() == SERVICE_SUCCESS_STATUS_CODE | | | | | 404 | 202 | false sun.net.www.protocol.https.DelegateHttpsURLConnection:https://clm-sl-ans-live-ans-service-api.cfapps.eu10.hana.ondemand.com/
        TIA,
        Rashmi

         

         

         

         

  • Hello Kiril and Martin,

    Thank you for wonderful blog to explain the process stepwise and continuously supporting us in our queries.

     

    I have created a subscription in my trial cloud foundry subaccount and added condition that it should send an email to my internal corporate slack channel and an email to my personal gmail id, when a user is added as a Space Developer in dev space inside trial subaccount.

    I have confirmed the email action with the confirmation code that I received on my personal gmail.

    However, when I do Send Test Notification or even add a user to dev space as Space Developer, no Slack message or E-mail is seen.

    Could you please suggest what's going wrong here and what should I do?

     

    Warm Regards,

    Amey

    • Dear Amey,

      thanks for getting in touch. I assume the following - when you hit the "Send Test Event" button there is a json that describes the test event. If the subscription you've defined is let's say something like "eventType is equal to CPIIntegrationFlowIsFailed", you should adapt this json to match the conditions of your subscription. So in this example you should change the value of eventType from sampleType to CPIIntegrationFlowIsFailed

      In case you have more questions don't hesitate to get in touch.

      • /
        eventtype
        • Hello Kiril,

          Thank you so much for prompt reply. Yes!! when I put audit.user.space_developer_add eventType that matches with the condition I defined, I received an email on my Gmail!!

          Could you pls comment on below as well?

          1. In second action, of the same condition, I have configured my company's internal corporate Slack channel URL (I went to my own Slack chat window & copied the URL and pasted it in Action). But I didn't receive any message on my Slack window? Any idea what's wrong here? Does it have to do something with my company's VPN, network restrictions?
          2. I tried to simulate actual event, by added a user in "Space Developer" role in subaccount "trial" > Space "dev". But I didn't receive any email (in Gmail) or ping (on Slack)
          3. Is there any kind of monitoring mechanism where I can see history of all subscriptions matched & executed and if failed. I mean, as a SAP BTP admin, can I check somewhere what all mails/pings/actions are executed by Alert Notification service instance?

          Warm Regards,

          Amey

          • Hello Amey,

            Please find my comments on the points you’ve raised:

            1. You should enter the Slack Webhook URL in the URL Address field of your action of type Slack, not the channel URL. The Webhook URL for the channel you can get after adding Incoming WebHooks integration (in Slack go to Apps->Add apps, search for 'Incoming WebHooks' and add it to Slack; select the channel you’d like to use in Post to Channel dropdown, then after choosing 'Add Incoming WebHooks integration', you’ll see the Webhook URL that you should use in your Slack action configuration);

            2. In order to receive User Lifecycle events from Alert notification, you should add a special technical user as Space Auditor for your space. Please find the technical user that corresponds to the data center where your account is created in the following page:
            https://help.sap.com/viewer/5967a369d4b74f7a9c2b91f5df8e6ab6/Cloud/en-US/4255e6064ea44f20a540c5ae0804500d.html

            3. There is no way for you to check which subscriptions were matched and actions were executed but there is an option to specify a fallback action – an alternative action to be executed, if the original fails – just expand the Advanced Action Properties section when you create or edit an action to select a fallback action… And in case there is no fallback action or the fallback action itself failed, you can pull the events that were not successfully delivered using the following API – see the Undelivered events in particular:
            https://api.sap.com/api/cf_consumer_api/resource
            If you include the query parameter 'include' in your GET request with value 'FAILURE_REASON', you may get some hints why the delivery of an event/execution of an action failed.

            Please let me know, if you have further doubts!

            Thanks,
            Valentina

          • Hello Valentina,

            Thank you for elaborate, informative & prompt reply.

            Points-1 & 2. I'll give it a go now.

            Point-3, quite a long way though, I'll probably park that topic now.

            Warm Regards,

            Amey