Blog Post

Apps on Azure Blog
3 MIN READ

Monitor Azure Spring Cloud App Ingress Request Log

Hanli_Ren's avatar
Hanli_Ren
Icon for Microsoft rankMicrosoft
Apr 25, 2022

When using Azure Spring Cloud, sometimes we need to monitor a specific App's Ingress request log to investigation app performance issue.

 

Azure Spring Cloud platform provides AppPlatformIngressLogs to query Ingress request log for those Apps with endpoint enabled.

But for the Apps with endpoint disabled, since the traffic is not going through the platform load balancer, the ingress request log is not recorded. For such cases, to monitor the App access log, we can use Application Performance Monitoring (APM) tools like Application Insights.

 

In this blog, let's demonstrate how to use AppPlatformIngressLogs and Application Insights to monitor both types of request access log.

 

A Brief Description of the sample test Apps

In my test Azure Spring Cloud, I created two Apps, "hello" and "number-service".

All source code of the two test Apps can be found in: https://github.com/renhanli/AzureSpringCloud_accesslogtest 

 

The "hello" App has URL endpoint enabled. All the external incoming requests will only hit this "hello" App.

 

When this "hello" App receives a client request, it will:
1. Send an internal App to App call to "number-service", get a random number from it
2. Response the client with a message: "Got a random number xx from App number-service"

The "number-service" App disabled URL endpoint, it only expects internal App to App calls coming from the "hello" App.

 

 

Use AppPlatformIngressLogs to monitor App Ingress request log

We can use AppPlatformIngressLogs table to query all the ingress request log for those Apps with endpoint enabled.
The followings are the detailed steps of how to check the access log.

 

1. Make sure the App has endpoint enabled.

 

2. Enable "IngressLogs" in the "Diagnostic setting" Portal.

 

3. Send some http requests to the App's endpoint URL: https://<springcloud_name>-<app_name>.azuremicroservice.io 

 

4. Use the following query to check the Ingress request log.

AppPlatformIngressLogs 
| where TimeGenerated >= datetime(2022-04-20 06:00:00)
| where Host == "<springcloud-name>-<app-name>.azuremicroservices.io"
| project TimeGenerated, TimeLocal,Host, Request, Status, RequestTime
| order by TimeGenerated asc 

 

 

Use Application Insights to monitor App request log

For those App to App calls, since they are not travel through the platform load balancer, traffic are not recorded in AppPlatformIngressLogs.
But we can check the requests in APM tools like Application Insights.

 

1. Make sure we enabled the Application Insights for the Azure Spring Cloud service.


2. Go to Application Insights -> Performance portal to check the request log.

    We can select Role = <App-name> to check one specific App's access request log.

 

3. Pick the Samples requests to dig deeper, you can see more details about the Http(s) requests
    For example, I pick one of the requests sent to my "hello" App.
    We can see it made an internal call to "number-service" App's "/number/random" API to get a random number.

 


4. We can also use "Application map" to get an overview of the traffic between the Apps, Eureka servers and target outside the Azure Spring Cloud service.
    In this test, we can seeļ¼š

    - App "hello" is calling App "number-service".
    - Both Apps also need to register themselves to Eureka server. So both of them are also calling the Eureka.

 

Updated Apr 22, 2022
Version 1.0
No CommentsBe the first to comment