You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Submit a daemon job that collects metrics in an endless loop. The daemon job queries the Metrics API every 10 seconds
22
+
* Submit a daemon job that collects metrics in an endless loop. The daemon job queries the Metrics API every 30 seconds
21
23
```
22
24
$ ibmcloud ce jobrun submit \
23
25
--job metrics-collector \
24
-
--env INTERVAL=10
26
+
--env INTERVAL=30
25
27
```
26
28
27
29
@@ -57,6 +59,81 @@ One can use the environment variable `COLLECT_DISKUSAGE=true` to also collect th
57
59
58
60
Once your IBM Cloud Code Engine project has detected a corresponding IBM Cloud Logs instance, which is configured to receive platform logs, you can consume the resource metrics in IBM Cloud Logs. Use the filter `metric:instance-resources` to filter for log lines that print resource metrics for each detected IBM Cloud Code Engine instance that is running in a project.
59
61
62
+
### Custom dashboard
63
+
64
+
Follow the steps below to create a custom dashboard in your IBM Cloud Logs instance, to gain insights into resource consumption metrics.
* Navigate to the "Custom dashboards" view, hover of the "New" button, and click "Import dashboard"
71
+
72
+

73
+
74
+
* In the "Import" modal, select the file [./setup/dashboard-code_engine_resource_consumption_metrics.json](./setup/dashboard-code_engine_resource_consumption_metrics.json) located in this repository, and click "Import"
* Filter only log lines related collected istio-proxy logs, by filtering for the following query
92
+
```
93
+
app:"codeengine" AND message.metric:"instance-resources"
94
+
```
95
+
96
+

97
+
98
+
* In the left bar, click "Add Filter" and add the following filters
99
+
*`Application`
100
+
*`App`
101
+
*`Label.Project`
102
+
*`Message.Component_name`
103
+
104
+

105
+
106
+
* In the top-right corner, click on "Columns" and configure the following columns:
107
+
*`Timestamp`
108
+
*`label.Project`
109
+
*`message.component_type`
110
+
*`message.component_name`
111
+
*`message.message`
112
+
*`Text`
113
+
114
+

115
+
116
+
* Once applied adjust the column widths appropriately
117
+
118
+
* In the top-right corner, select `1-line` as view mode
119
+
120
+

121
+
122
+
* In the graph title it says "**Count** all grouped by **Severity**". Click on `Severity` and select `message.component_name` instead. Furthermore, select `Max` as aggregation metric and choose `message.memory.usage` as aggregation field
123
+
124
+

125
+
126
+
* Save the view
127
+
128
+

129
+
130
+
* Utilize the custom logs view to drill into HTTP requests
Along with a human readable message, like `Captured metrics of app instance 'load-generator-00001-deployment-677d5b7754-ktcf6': 3m vCPU, 109 MB memory, 50 MB ephemeral storage`, each log line passes specific resource utilization details in a structured way allowing to apply advanced filters on them.
0 commit comments