Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Prometheus to collect application log data of SAP ABAP

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to use Prometheus to collect SAP ABAP application log data". In daily operation, I believe many people have doubts about how to use Prometheus to collect SAP ABAP application log data. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the questions of "how to use Prometheus to collect SAP ABAP application log data". Next, please follow the editor to study!

Prometheus is an open source system monitoring and alarm framework. It was inspired by Google's borgmon monitoring system, created by former google employees working at SoundCloud in 2012, developed as a community open source project, and officially released in 2015. In 2016, Prometheus officially joined Cloud Native Computing Foundation, making it a project second only to Kubernetes in popularity.

We can use the powerful monitoring function of Prometheus to collect the logs of applications running on the SAP ABAP Netweaver server. Take the SAP CRM Fiori application My Opportunity as an example, suppose I have developed a custom log function to record the details of all users' read operations to Opportunity, including requestor, request date and request time in a database table.

Then I want to use Prometheus to periodically query the Netweaver server to monitor the number of read requests it serves. Here are the concrete steps.

(1) create an enhancement in the BAdI definition CRM_OPPORTUNITY_ODATA_BD of the OData service implementation behind the CRM My Opportunity.

Because all read requests are finally processed by the method SORT_AND_FILTER_OPPT_TABLE, we implement diary recording in this method:

(2) the transaction code SICF creates a new service node:

Read out the number of entries in the database log table with SELECT COUNT (*) and return them to the consumer by HTTP.

(3) in the configuration file prometheus.yml of Prometheus server, add a Netweaver HTTP service created by crawling step 2 on a regular basis:

Line 26 metrics_path is the service path created in the SICF transaction code, and line 28 means that it is fetched every 2 seconds. Line 33 is the hostname of the Netweaver server.

Start the Prometheus server:

Use the My Opportunity application on Fiori UI to trigger a read request:

You can see that the log table is filled with data:

When localhost:9090 accesses the UI console of Prometheus, you can see the number of read requests collected:

When you switch to the Graph panel, you can see the changing trend of read requests within a specified time interval. For example, the following figure means that the number of read requests has increased linearly in the past five minutes.

At this point, the study on "how to use Prometheus to collect SAP ABAP application log data" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report