Due to the usage of GO, I’m currently using “WebApp for Containers” in AppService to host a custom Linux container. GO doesn’t currently have an Azure Application Insights SDK which is supported by Microsoft, thus I have been trying to find a method to collect the container stdout logs into Application Insights, so that I can extract Metrics from the logs. What would be a way to capture the stdout container logs into Azure Application Insights?
I have tried the following: Added the instrumentation key to the container environment variables. Enabled Application Insights integration in portal.
Can Web App for Containers - Container Logs be ingested into Azure Application Insights?
You can find the standard output container logs in the App Insights Console Logs where you can send them to Azure Monitor.
Go to your Azure App Service > Monitoring > Diagnostic Settings
Add the diagnostic setting where you can choose the types of logs that should be sent to the appropriate destination resource like Azure Log Analytics Workspace (App Insights), Storage accounts, etc.
If it is container apps, then it will contain both console and system logs which can be transferred to the below following options such as Log Analytics Workspace, Storage account.
Refer to this MS Doc1 and Doc2 for more information on migrating the logs to Application Insights.