When you need to use Log Service call statistics records to query and analyze collected function calls in real time and view the monitoring information in a visualized manner, you can import function call statistics to the log repository that you create in real time. You can view the status of function calls in real time through query analysis and chart display in Log Service to better control the service status of functions.
Due to the reconfiguration of the Function Compute console, the operation configurations related to the log dashboard have been unpublished in the new console. The features of the log dashboard described in this topic are only applicable to the old console.
We apologize for any inconvenience caused.
Operation
Collect and import logs
- Log on to the Function Compute console.
- In the top navigation bar, select the region where your Kubernetes cluster is deployed.
- In the left-side navigation pane, click Overview.
- In the Quick Access section on the Overview page, marked ① in the following figure, click Configure Log Dashboard, marked ② in the following figure.
- On the Configure Log Dashboard page, click Configure Log Analysis.
- In the Custom Log Analysis panel, perform the following operations:
- Select a project and a Logstore that reside in the region from the Log Project and Logstore drop-down lists.
- Select one or more services that you want to associate with the Logstore.
- Select Create new role from the Role Operation drop-down list and click Authorize.
- On the Role Templates page, verify the information and click Confirm Authorization Policy.
- In the Custom Log Analysis panel, click OK.
Query and analyze logs
Use dashboard charts and interpret metrics
Customize dashboards
-
Source analysis of user IP addresses
-
Access distribution within China
Execute the following query statement and select
map of China
as the chart type:operation:InvokeFunction | SELECT ip_to_province(IF(forwardedFor = '', ip, forwardedFor)) AS"Province", approx_distinct(IF(forwardedFor = '', ip, forwardedFor)) AS"Request"GROUP BY"Province"LIMIT 50
-
Access distribution worldwide
Execute the following query statement and select
world map
as the chart type:operation:InvokeFunction | SELECT ip_to_country(IF(forwardedFor = '', ip, forwardedFor)) AS"Country", approx_distinct(IF(forwardedFor = '', ip, forwardedFor)) AS"Request"GROUP BY"Country"LIMIT 50
-
Heatmap
Execute the following query statement and select
heatmap
as the chart type:operation:InvokeFunction | SELECT ip_to_geo(IF(forwardedFor = '', ip, forwardedFor)) AS geo, count(1) AS count GROUP BY geo order BY count desc LIMIT 30
-
-
User agent ratio
Execute the following query statement and select
pie chart
as the chart type:operation:InvokeFunction | SELECT userAgent, COUNT(userAgent) AS count GROUP BY userAgent ORDER BY count DESC LIMIT 20
- Top 20 URLs to HTTP functions
Execute the following query statement and select
table
as the chart type:operation:InvokeFunction and isHTTPTrigger:true | SELECT requestOriginalURI, COUNT(requestOriginalURI) AS count GROUP BY requestOriginalURI ORDER BY count LIMIT 20
Configure alert rules
You can add a DingTalk chatbot to help you monitor the health status of your functions. The chatbot uses alert rules in Log Service to monitor the health status of your functions. For more information, see Configure an alert rule.