Back to Portainer

Alerting

user/observability/alerting.md

1.23.221.0 KB
Original Source

Alerting

{% hint style="info" %} This section is only available in Portainer Business Edition and only accessible by administrator users. {% endhint %}

On the Alerting page you can configure alerts for events related to your environments and for Portainer itself. Alerts will display on the Alerting page and notifications can be sent via Slack or Microsoft Teams integration, via email, or by triggering a webhook.

To access Alerting once the feature is enabled under additional functionality, click on Alerting under Additional Functionality in the left menu.

<figure><figcaption></figcaption></figure>

Active Alerts

This tab shows any active alerts on your environments.

Field/OptionOverview
Alert NameThe name of the alert that has been triggered, along with the environments that triggered the alert (where relevant).
ActionsActions you can perform on the alert. You can click Silence to silence the alert.
State<p>The state of the active alert. This can be one of the following:
<strong>Active:</strong> The alert is currently active and firing.
<strong>Firing:</strong> The alert rule is currently firing and has triggered alerts.
<strong>Inactive:</strong> The alert rule is not currently firing and has not triggered alerts.
<strong>Pending:</strong> The alert rule is currently firing but has not yet triggered alerts.</p>
SeverityThe severity level of the alert. This will depend on the severity level selected on the corresponding rule (where configurable).
MessageThe message sent along with the alert.
SourceThe source of the alert.
InstanceThe instance that has sent the alert.
Started AtThe date and time the active alert began.
Last UpdatedThe date and time the alert status was last updated.
<figure><figcaption></figcaption></figure>

Silence an alert

You can choose to temporarily silence an alert, for example when you are aware of the issue and are working to resolve it but do not need ongoing notifications while you do. To silence an alert, click the Silence button in the Actions column then complete the form.

Field/OptionOverview
CommentSpecify a comment to associate with the silencing action.
Created ByThe user that silenced the alert. By default this contains your username.
DurationSelect the length of time to silence the alert, or choose Custom set a custom length using the Starts At and Ends At date selectors.
Starts AtThe start date and time of the silencing. This is based on the Duration selection above if using a preset option.
Ends AtThe end date and time of the silencing. This is based on the Duration selection above if using a preset option.
MatchersA list of the criteria this silencing action will match.
<figure><figcaption></figcaption></figure>

Once you're ready, click the Create Silence button.

Silenced Alerts

This tab lists any silenced alerts. Silenced alerts are active alerts that have been temporarily silenced and will not notify.

Field/OptionOverview
Alert RuleThe name of the rule that has been silenced.
StatusThe status of the silencing. The active status indicates the silence is currently active. The expired status indicates the silence is no longer active due to the Ends At time having passed.
ActionsClick the trash icon to remove the silencing. If the alert is still active it will return to Active Alerts.
CommentThe comment provided when silencing the alert.
Created ByThe user that created the silencing.
Starts AtThe start date and time of the silencing.
Ends AtThe end date and time of the silencing.
<figure><figcaption></figcaption></figure>

Rules

The rules tab is where you define the rules that can be used to trigger alerts.

{% hint style="info" %} At present the list of rules is limited. We plan to extend the available rules here in future releases. {% endhint %}

Field/OptionOverview
Alert RuleThe name of the alert rule, along with labels that determine the type of rule, environment types it applies to, and any Portainer version restrictions for the rule to function.
ActionsHere you can enable the rule using the toggle, and where relevant click Edit to customize the rule settings. Rules cannot be enabled if no alert manager instances are enabled.
DescriptionThe description of the rule.
SeverityThe severity level of the rule.
ThresholdThe threshold at which the rule will trigger. Depending on the rule this could be the number of consecutive failures or a specific value being reached or exceeded.
ConditionThe comparison operator used in the condition trigger, for example equals or greater than.
Duration (min)The period (in minutes) within which the condition and threshold must be true for the rule to be triggered. For rules where this isn't relevant, a dash is listed.
Created AtThe creation date and time of the rule.
<figure><figcaption></figcaption></figure>

Editing a rule

Some rules can be edited to suit your needs. To edit an editable rule, click the Edit button for the rule in the Actions column.

{% hint style="info" %} For system rules, some fields may be restricted from modification. {% endhint %}

The following fields are available:

Field/OptionOverview
NameThe name of the rule.
DescriptionThe description of the rule.
ThresholdThe threshold at which the rule will trigger. Depending on the rule this could be the number of consecutive failures or a specific value being reached or exceeded.
Condition operatorThe comparison operator used in the condition trigger, for example equals or greater than.
DurationThe period within which the condition and threshold must be true for the rule to be triggered. For rules where this isn't relevant, a dash is listed.
SeverityThe severity level of the rule.
EnabledWhen toggled on, the rule is enabled.
<figure><figcaption></figcaption></figure>

When you have made your changes, click Save Rule.

Settings

This tab lists the alert manager instances used for sending notifications and is where you configure those notifications.

{% hint style="info" %} At present only the internal instance is available. {% endhint %}

The following fields are displayed:

Field/OptionOverview
NameThe name of the alert manager instance.
StatusThe connection status of the alert manager instance.
EnabledWhether the instance is enabled.
ChannelsThe number of notification channels configured in the instance.
ActionsClick Test to test whether the instance is reachable. Click Edit to make changes to the instance configuration and to set up notifications.
<figure><figcaption></figcaption></figure>

Edit an instance

To edit an alert manager instance, click the Edit button for the instance in the Actions column. Here you can see the Name of the instance and enable or disable it through the toggle. You will also see any notification channels you have added listed here.

<figure><figcaption></figcaption></figure>

Add a notification channel

To add a notification channel to an alert manager instance, on the Settings tab click the Edit button next to the instance, then click the Add Channel button. In the New Channel section, complete the fields as required.

First select the Notification Type from the dropdown. Current options are:

The subsequent options will depend on the selected type.

<figure><figcaption></figcaption></figure>

Slack

The following options are available when configuring a Slack notification channel:

Field/OptionOverview
NameSpecify a name for your notification channel.
Webhook URLEnter the webhook URL for your Slack integration. You can learn more about how to configure this in the Slack API documentation.
<figure><figcaption></figcaption></figure>

When you have completed the configuration, click Save Settings.

Email

The following options are available when configuring an email notification channel:

Field/OptionOverview
NameSpecify a name for your notification channel.
SMTP ServerEnter the URL and port for your SMTP server. If no port is provided, the default of 587 will be used.
SMTP Auth UsernameEnter the username for authenticating with your SMTP server, if required.
SMTP Auth PasswordEnter the password for authenticating with your SMTP server, if required.
Require TLSIf your SMTP server requires TLS, toggle this option on.
To Email AddressEnter the email address you want to send notifications to.
From Email AddressEnter the email address that will appear as the sender for your notification emails.
<figure><figcaption></figcaption></figure>

When you have completed the configuration, click Save Settings.

Webhook

The following options are available when configuring a webhook notification channel:

Field/OptionOverview
NameSpecify a name for your notification channel.
Webhook URLEnter the URL for your webhook.
<figure><figcaption></figcaption></figure>

When you have completed the configuration, click Save Settings.

Microsoft Teams V2

The following options are available when configuring a Microsoft Teams V2 notification channel:

Field/OptionOverview
NameSpecify a name for your notification channel.
Webhook URLEnter the webhook URL for your Microsoft Teams integration. You can learn more about configuring Microsoft Teams webhooks in the Microsoft documentation.
<figure><figcaption></figcaption></figure>

When you have completed the configuration, click Save Settings.