Manage alerts within your APM interface to monitor critical metrics and receive timely notifications about potential issues.

## Overview

Metric-based widgets in your [Application Performance Monitoring (APM)](https://coralogix.com/docs/user-guides/apm/getting-started/apm-onboarding-tutorial/index.md) dashboard are crucial for visualizing key performance indicators and data related to your software applications' performance, health, and availability. These widgets offer real-time insights into error rates, response times, and throughput metrics.

Create [metric alerts](https://coralogix.com/docs/user-guides/alerting/create-an-alert/metrics/threshold-alerts/index.md) directly from widgets in your [Service](https://coralogix.com/docs/user-guides/apm/features/service-catalog/index.md) and [Database](https://coralogix.com/docs/user-guides/apm/features/database-monitoring/index.md) catalogs within the APM interface. These alerts function like standard metric alerts but are conveniently auto-populated and correlated with the underlying query from a specific widget. You can keep the base query or modify it according to your needs. Once an alert is set up, it appears in your [Alert Management Screen](https://coralogix.com/docs/user-guides/alerting/introduction-to-alerts/index.md) with APM labels attached.

Manage triggered alert events from the Incidents card in the upper tier of your APM interface. The card displays if triggered events exist and their status. Select the status updates to view these events in your [Incidents Screen](https://coralogix.com/docs/user-guides/alerting/incidents/index.md) with APM labels attached.

### Auto-populated fields

The following fields are auto-populated when you set up an alert from the APM interface:

| Field            | Description                                                                                                                                                                                                                                                                          | Example                                                                                                                                                                           | Notes                                                                                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **PromQL query** | Automatically generated based on the query underlying the widget and chosen data source. Dimensions and active filters defined during the alert creation is considered part of the query.                                                                                            | \`avg_over_time(sum(increase(duration_ms_sum{span_kind=~"SPAN_KIND_CONSUMER                                                                                                       | SPAN_KIND_SERVER", service_name=~"my-app"}[900])) / sum(increase(duration_ms_count{span_kind=~"SPAN_KIND_CONSUMER |
| **Labels**       | Labels will be used in [Alerts](https://coralogix.com/docs/user-guides/alerting/introduction-to-alerts/index.md) or [Incidents](https://coralogix.com/docs/user-guides/alerting/incidents/index.md) or to filter all alerts and incidents by service or widget name across services. | Service Catalog: `product:apm-service-catalog`, `serviceName:<service name>` Database Catalog: `product:apm-db-catalog`, `apm-db-catalog.databaseName:<db.system>.<db.namespace>` | Should not be modified. If a label is modified, there will be no correlation between an incident and its service. |

Note

Besides setting up alerts from the APM widgets, you can also include service or database catalog labels when creating [alerts](https://coralogix.com/docs/user-guides/alerting/introduction-to-alerts/index.md) outside the APM scope. These alerts will be classified as APM alerts and displayed accordingly in the relevant APM section of the Coralogix UI.

## Required permissions

Users with the following permissions can view and/or manage alerts.

| Resource        | Action         | Description                      |
| --------------- | -------------- | -------------------------------- |
| `metric.alerts` | `ReadConfig`   | View alert settings              |
| `metric.alerts` | `ReadConfig`   | View incident settings           |
| `metric.alerts` | `UpdateConfig` | Create and modify alert settings |

Learn more about roles and permissions [here](https://coralogix.com/docs/user-guides/aaa/access-control/permissions/index.md).

## Create alerts

1. Navigate to **APM**, then **Service Catalog** or **Databases** in your Coralogix toolbar.
1. Select a service or database to view its Overview or Operation widgets.
1. Select the widget to use as the basis for your alert. Select the ellipsis and then **Create Alert**. If the widget has static metric categories (such as `successes` and `errors`), choose the category to be queried.
1. This opens a metric alert side modal that is auto-populated and correlated with the selected service, widget, and metric category selected. Define the remaining conditions and notification settings for a [Metric alert](https://coralogix.com/docs/user-guides/alerting/create-an-alert/metrics/threshold-alerts/index.md) or [Anomaly Detection alert](https://coralogix.com/docs/user-guides/alerting/create-an-alert/metrics/anomaly-detection-alerts/index.md). See the use cases below for more information on the alert definition setup.
1. After defining alert and notification settings, select **Create Alert** in the upper-right-hand corner.

## Use cases

### Successful transactions & errors

This widget presents successful transactions and errors per minute over a selected time-picker interval. The interval produces aggregations every 60 seconds. In this case, you can create an alert for the service’s errors. A PromQL query is automatically generated based on the query underlying the widget and chosen data source.

The alert defined checks whether `service <>` has `more than` `100` errors for over `80%` of `10 minutes`. Every minute, the Coralogix alert mechanism looks at the last 10 minutes of query aggregations (produced every 60 seconds) to determine how many aggregations have breached the 100-value threshold. If this threshold is breached 8 out of 10 times, the alert is triggered and an incident is recorded.

### Apdex score

The widget presents the [Apdex score](https://coralogix.com/docs/user-guides/apm/features/apdex-score/index.md) for a service every 60 seconds for 15 minutes. A PromQL query is automatically generated based on the query underlying the widget.

The alert defined will check whether the Apdex score of `service <>` is `less than` `70%` for over `50%` of `10 minutes`. Every minute, the Coralogix alert mechanism will look at the last 10 minutes of query aggregations (produced every 60 seconds) to determine how many aggregations are less than the 0.7 threshold. If this threshold is breached more than 5 out of 10 times, the alert is triggered and an incident is recorded.

## Manage incidents

### View incidents by service

The Incidents column in the Service Catalog and Databases page displays incidents status for all existing services. The following indications are available:

- Red bell: The service has at least 1 triggered incident.
- Blue bell: The service has acknowledged or resolved incident(s) only.
- No indication: No alerts or incidents are configured for the service.

Note

If you have defined an alert and still see no incidents, try increasing the timeframe.

To inspect incidents:

1. Hover on the bell icon to display the number of triggered, acknowledged or resolved incidents per service.
1. Select the bell icon for the service to display the [Incidents](https://coralogix.com/docs/user-guides/alerting/incidents/index.md) page with service-related incidents filtered by the service.

### No triggered incidents

If you have set up alerts but no [incidents](https://coralogix.com/docs/user-guides/alerting/incidents/index.md) have been triggered, the Incidents card displays this status.

### Triggered incidents

If [incidents](https://coralogix.com/docs/user-guides/alerting/incidents/index.md) exist for the alerts you’ve set up, the Incidents card will present the number of events that have been triggered and acknowledged.

## Next steps

When an alert fires, use [Comparison mode](https://coralogix.com/docs/user-guides/apm/features/comparison-mode/index.md) to put current behavior side-by-side with a healthy baseline.

## Support

**Need help?**

Our customer success team is available 24/7 via in-app chat or email at [support@coralogix.com](mailto:support@coralogix.com) to assist with setup and any questions.
