Monitor app lifecycle events using Azure Activity log and Azure Service Health
Note
The Basic, Standard, and Enterprise plans will be deprecated starting from mid-March, 2025, with a 3 year retirement period. We recommend transitioning to Azure Container Apps. For more information, see the Azure Spring Apps retirement announcement.
The Standard consumption and dedicated plan will be deprecated starting September 30, 2024, with a complete shutdown after six months. We recommend transitioning to Azure Container Apps.
This article shows you how to monitor app lifecycle events and set up alerts with Azure Activity log and Azure Service Health.
Azure Spring Apps provides built-in tools to monitor the status and health of your applications. App lifecycle events help you understand any changes that were made to your applications so you can take action as necessary.
Prerequisites
- An Azure subscription. If you don't have an Azure subscription, create a Trial before you begin.
- A deployed Azure Spring Apps service instance and at least one application already created in your service instance. For more information, see Quickstart: Deploy your first Spring Boot app in Azure Spring Apps.
Monitor app lifecycle events triggered by users in Azure Activity logs
Azure Activity logs contain resource events emitted by operations taken on the resources in your subscription. The following details for application lifecycle events (such as start, stop, and restart) are added into Azure Activity Logs:
- The time the operation occurred.
- The status of the operation.
- Which instance(s) are created when you start your app.
- Which instance(s) are deleted when you stop your app.
- Which instance(s) are deleted and created when you restart your app.
To see the affected instances when you restart your app, navigate to your Azure Spring Apps instance in the Azure portal and select Activity log in the navigation pane.
Monitor app lifecycle events in Azure Service Health
Azure Resource Health helps you diagnose and get support for issues that may affect the availability of your service. These issues include service incidents, planned maintenance periods, and regional outages. Application restarting events are added into Azure Service Health. They include both unexpected incidents (for example, an unplanned app crash) and scheduled actions (for example, planned maintenance).
Monitor unplanned app lifecycle events
When your app is restarted because of unplanned events, your Azure Spring Apps instance shows a status of degraded in the Resource health section of the Azure portal. Degraded means that your resource detected a potential loss in performance, although it's still available for use. Examples of unplanned events include app crash, health check failure, and system outage.
On the Azure Home page, select Service Health and then select Resource Health.
In Health history, you can find the latest status, the root cause, and affected instances.
Monitor planned app lifecycle events
Your app may be restarted during platform maintenance. You can receive a maintenance notification in advance from the Planned maintenance page of Azure Service Health.
When platform maintenance happens, your Azure Spring Apps instance shows a status of degraded. If restarting is needed during platform maintenance, Azure Spring Apps performs a rolling update to incrementally update your applications. Rolling updates are designed to update your workloads without downtime. You can find the latest status in the health history page.
Note
Currently, Azure Spring Apps performs one regular planned maintenance to upgrade the underlying Kubernetes version every 2-4 months. For a detailed maintenance timeline, check the notifications on the Azure Service Health page.
Set up alerts
You can set up alerts for app lifecycle events. Service health notifications are also stored in the Azure activity log. The activity log stores a large volume of information, so there's a separate user interface to make it easier to view and set up alerts on service health notifications.
The following list describes the key steps needed to set up an alert:
- Set up an action group with the actions to take when an alert is triggered. Example action types include sending a voice call, SMS, email; or triggering various types of automated actions. Various alerts may use the same action group or different action groups depending on the user's requirements.
- Set up alert rules. The alerts use action groups to notify users that an alert for some specific app lifecycle event has been triggered.
Set up alerts on Activity log
Use the following steps to create an activity log alert rule in the Azure portal:
Navigate to your Azure Spring Apps instance and select Activity log in the navigation pane.
Select any log to open its detail pane and then select New alert rule.
By default, alerts are scoped to the current subscription. Select the Scope tab to select a different subscription.
Select the Condition tab. Select Signal name to configure the criteria for the condition.
Select the Actions tab. Add action groups to be applied to the alert rule.
Select Review + create and then select Create.
Set up alerts to monitor app lifecycle events in Azure Service Health
Use the following steps to create an alert rule for service health notifications in the Azure portal.
On the Azure Home page, select Service Health and then select Resource health in the navigation pane.
Select Add resource health alert.
Select the Scope tab. Specify the resources to be applied to the alert rule.
Select the Condition tab. Define the criteria to trigger the alert rule.
Select the Actions tab. Add action groups to be applied to the alert rule.
Select Review + create and then select Create.
Set up alerts to monitor the planned maintenance notification
Use the following steps to create an alert rule for planned maintenance notifications in the Azure portal: