Skip to Content
Technical Articles
Author's profile photo Siva Selagala

Build Your Own SCPI Log Reports And Deploy To SAP BTP – CPI IFlows Monitoring Tool

“Having data Is fine,but It’s what you do with the data that really makes a difference”

This blog post will explain how we can create SCPI – Cloud Platform Integration related reports and deploy it to BTP. Once it deployed, BTP will host this application. We can also get real time data into reports.

Many customers are using third party monitoring tools for monitoring SCPI logs / statuses / errors. Etc.. Customer needs to spend additional amount to purchase these tools (or for licenses ). If you already have SAP BTP (Pay as per your usage) then we can easily build your reports as per our KPI’s. This post will exactly explain the same.

Log%20Reports

Log Reports

SCPI already has a lot of Logging & Monitoring Capabilities within the application. For example , you can customize your monitoring tiles to view the corresponding KPIs like how many messages have been processed through your CPI tenant in last 1 hour for up to last 30 days or 90 days or even beyond? How many messages have failed or are in processing? Why a message have been failed? How many total artifacts/Iflows have been deployed? ..etc etc

Yes , SCPI will provide monitoring capabilities ..But

  • Data it provides is more technical .. Need little SCPI experience to see  those details.
  • We can’t create custom KPI’s (Explained below) . Need to go with existing capabilities
  • Graphical reports are not possible.

We can create our own application in BTP with detailed SCPI logs data /our own KPI’s/Graphical reports ..etc

Advantages Of Having Monitoring Tool:

  • We can Easily Monitor and Understand all CPI related Integrations.
  • Easy Tracking. No need to Login to CPI
  • Can easily Monitor performance Bottlenecks over the period.
  • Track No.of Times of Each Iflow running over the time and If it is increasing we can take necessary actions by adding required resources.
  • Build your own Custom KPI’s easily.

Architecture :

Here we are building an web application using python and python libraries (Dash, Panda, Flask ..ect ). This code we are deploying into cloud foundry environment using CLI interface.

Architecture Diagram of SCPI Log reports in BTP

Step1: Getting Data From SCPI

Two Approaches 

  1. We can directly call SCPI ODATA API’s and get the required KPI data.
  2. We can create CPI Iflow to get the required KPI data and convert this Iflow as API (Endpoint Call)

Approach#1: Call Direct SCPI ODATA API’s

SCPI provide ODATA API’s and using these API’s we can get required details from CPI tenant. For more details check Link Cloud Integration ODATA API

Ex: Below code directly calls ODATA API and get the required results.

#Calling SCPI Direct ODATA APIs
url = "https://<<CPI>>-tmn.hci.int.sap.eu2.hana.ondemand.com/"
Username=<<username>>
Password=<<password>>
base_url = url+"api/v1/MessageProcessingLogs?$inlinecount=allpages&$filter=Status eq 'FAILED' and LogStart gt datetime'2022-09-01T00:00:00' and LogEnd lt datetime'2022-09-20T00:00:00'"
r = requests.get(base_url , auth=(Username,Password),headers={"Accept":"application/json"})
#print(r.text)

Approach#2: Create CPI IFlow to get the required KPI data and convert this IFlow as API

In this approach we need to create a CPI Iflow to get the required KPI data.

CPI%20IFlow

CPI IFlow

We can call this API directly in our code now

# Calling the CPI IFlow End Point
url = "https://<<CPI>>-iflmap.hcisb.int.sap.eu2.hana.ondemand.com/http/CPIREPORT"
Username=<<username>>
Password=<<password>>
data = '{"StartTime": "2022-09-14T15:00:00","EndTime": "2022-09-20T16:00:00"}'
print (data)
r = requests.post(url , data, auth=(Username,Password),headers={"Accept":"application/json"})
#print (r.text)

 

Step2: Create Your Web Application

Here i used Python language to build my web application..BTP allows to create you application in our other known languages as well.

In my example i am using Python DASH template and creating some reporting tables.

Web%20Application%20in%20Python

Web Application in Python

Step3: Create Required Files For Deployment

In order to deploy this app to SAP BTP we need 4 other files along with our python files.

  1. Procfile
  2. manifest.yaml
  3. requirements.txt
  4. runtime.txt

Step4: Deploy Code into BTP Using Cloud Foundry CLI

Now we need to deploy all our code into BTP using Cloud Foundry CLI. In order to deploy we need cloud foundry should be installed in our machine.

Latest version can be found in : Cloud Foundry

Installation Steps: Cloud Foundry Installation

Login Steps: Cloud Foundry Login

Login

Login

Once you login Successfully then Push your application into BTP

Pushing%20Application%20Into%20Cloud%20Foundry

Pushing Application Into Cloud Foundry

Step5: Check and Open Your Application In BTP Cockpit

Once the application successfully deployed we can see an entry in BTP with status STARTED

Application%20Started%20in%20BTP%20Cockpit%20and%20Ready%20to%20Use

Application Started in BTP Cockpit and Ready to Use

Now our application is Up and Running….

Web%20Application%20running%20in%20BTP

Web Application running in BTP

Below KPI’s are taken as my use cases:

KPI#1: Get Success/ Failure / Discarded count

This Scenario Report we can see Above.

KPI#2: Get Time Taken To Execute IFlows Over The Time

Total%20Time%20Taken

Total Time Taken

KPI#3: Get Failed IFlows With Error Details

Failed%20IFlows%20and%20Error%20Message

Failed IFlows and Error Message

Conclusion:

I covered few KPI’s in this blog but we can create or build many KPI’s by taking Data and these are useful for real time monitoring of your Integrations.

Thanks, for reading it till the end.


  • Hope you find that helpful! Let me know your thoughts on this in the comments section.
  • Don’t forget to share this article with your friends or colleagues.
  • Feel free to connect with me on any of the platforms below!

Siva Selagala

 

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Yogananda Muthaiah
      Yogananda Muthaiah

      Well described Siva Selagala !!

      Author's profile photo Martin Pankraz
      Martin Pankraz

      Hi Siva Selagala,

      thanks for sharing. How do you deal with monitoring needs regarding outages? Isn't external monitoring always superior because you monitor goes down with the service you are monitoring? At least you would need to deploy the app in a different BTP region to cater for that.

      I described it this way.

      KR

      Martin

      Author's profile photo Siva Selagala
      Siva Selagala
      Blog Post Author

      Hi Martin Pankraz ,

      Thank you for your valuable comment. Yes, In an outage scenario neither BTP nor any other applications hosted in BTP won't work.

      I can separate outages into 2 ways ..

      1. Planned  : In planned scenario customers are notified few weeks before

      2. UnPlanned : I hope you are talking about this scenario

      Outages we can see very rarely in the current cloud world ...  Also, SAP fallows proper procedure (Transparent , Faster Communication)  in terms of communicating these to customer.

      In my opinion this scenario is less priority (but can't avoid..! ).

       

      Thanks

      Siva S

      Author's profile photo Martin Pankraz
      Martin Pankraz

      Indeed. The post would profit from adding the SAP-Microsoft co-developed materials for your scenario 1. Your colleagues framed it as "intelligent routing" and published as Discovery Center Mission and SAP sample.

      I was referring mostly to your scenario 2 yes. Communication is esstential as you said but also concious decisions on HA strategy. Hence I published dedicated posts on this for SAP Cloud Integration. Get started here.

      Thanks for your comment!

      KR

      Martin

      Author's profile photo Santhosini K
      Santhosini K

      Well articulated!

      Author's profile photo Swarupa G
      Swarupa G

      Hello Siva Selagala,

      Truly Apprecitaed , thank you for blog post.