How to monitor container app metrics in azure
I'm new to the azure environment and wondering how it's possible to monitor an azure container app? Currently I've deployed a nodejs application by running a container app and I know how to query some logs by using the protocols section.
What I'm really looking into is how to get metrics like incoming requests or vcpu usage but I don't know how to get those metrics using azure monitoring.
How can I access those values?
It is possible to add Azure application insights SDK to your nodejs project. It will monitor your app activity like incoming/outcoming requests, database operations and etc. Also there is an option to add automatic metrics gathering:
See this documentation link for details.
let appInsights = require("applicationinsights");
appInsights.setup("<instrumentation_key>")
.setAutoDependencyCorrelation(true)
.setAutoCollectRequests(true)
.setAutoCollectPerformance(true, true)
.setAutoCollectExceptions(true)
.setAutoCollectDependencies(true)
.setAutoCollectConsole(true)
.setUseDiskRetryCaching(true)
.setSendLiveMetrics(true)
.start();