Is there a way to get metrics or logs for container restarts? I want to create an alert in Azure Monitor when too frequent container alerts occur. I suspect this is a common scenario, but can't find it documented here.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the question! We are investigating and will update you shortly.
@ctaggart Azure container instances logs can be moved to Azure Monitor logs(Link).
I didn't find any Azure provided feature to move the container events to Azure monitor logs.
I reached out to the product team internally.
I will post here once i have an update.
@jakaruna-MSFT, I already enabled the container logs to go there. It is the container events that I'm interested in monitoring from Azure Monitor. Thanks for reaching out to the product team.
@ctaggart Currently monitoring ACI events via Azure monitor is not supported.
There is an excising feedback here which is asking for the Event grid notification when container terminates.
Please up vote that feedback or create a new one. Product teams will be looking at those feedback's and they will consider it after the discussion.
As a workaround, We can build a logic app or a function which queries the events periodically and updates those events in Azure monitor. Once the data is available in Azure monitor, we can setup alerts.
Which API would you use to query the events? Something in here?
https://docs.microsoft.com/en-us/rest/api/container-instances/container
List all containergroups using this.
For each container group make a get call using this which shows events. But we need to have some logic around so that we are not ingesting the same events again and again in Azure monitor.
Please follow this link to ingest the logs via HTTP to Azure monitor. Ingesting via HTTP is in preview now.
@ctaggart is there any update
I think you answered it ealier:
Currently monitoring ACI events via Azure monitor is not supported.
I think this issue can be closed. It would be nice to link to a feature request to support that.
@ctaggart Please add a feedback here. Then the community can upvote it.
I will also provide a Azure function which pulls the events and uploads to Azure monitor when i get some time.
I will close this out for now. If you need additional help please let me know and we can reopen and continue.
Allow monitoring of events from Azure Monitor
https://feedback.azure.com/forums/602224-azure-container-instances/suggestions/37114807-allow-monitoring-of-events-from-azure-monitor