Monitor Azure Spring Cloud App Ingress Request Log
Published Apr 24 2022 08:22 PM 1,968 Views
Microsoft

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 

 

Hanli_Ren_0-1650616767843.png

Hanli_Ren_1-1650616794553.png

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

Hanli_Ren_2-1650616833595.png

 

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"

Hanli_Ren_0-1650616946138.png

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

Hanli_Ren_1-1650617026499.png

 

 

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.

Hanli_Ren_2-1650617327306.png

 

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

Hanli_Ren_3-1650617373945.png

Hanli_Ren_5-1650617463245.png

 

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 

Hanli_Ren_6-1650617561445.png

 

 

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.

Hanli_Ren_7-1650617652577.png


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.

Hanli_Ren_8-1650617721715.png

 

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.

Hanli_Ren_9-1650617766225.png

 


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.

Hanli_Ren_10-1650617838605.png

 

Co-Authors
Version history
Last update:
‎Apr 22 2022 01:57 AM
Updated by: