-
Notifications
You must be signed in to change notification settings - Fork 258
docs(srv): add how to create alerts for srv ressources MTA-5503 #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6bd81e6
docs(srv): add how to create alerts for srv ressources MTA-5503
SamyOubouaziz d6500b1
docs(srv): update
SamyOubouaziz 9bed741
docs(srv): update
SamyOubouaziz c191f35
docs(srv): update
SamyOubouaziz da60bc6
docs(srv): update
SamyOubouaziz 882307d
docs(srv): update
SamyOubouaziz 5444f4b
Apply suggestions from code review
SamyOubouaziz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
pages/serverless-containers/how-to/configure-alerts-containers.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| --- | ||
| meta: | ||
| title: How to add alerts to a container | ||
| description: Learn how to add monitoring alerts to Serverless Containers with Scaleway. | ||
| content: | ||
| h1: How to add alerts to a container | ||
| paragraph: Learn how to add monitoring alerts to Serverless Containers with Scaleway. | ||
| tags: containers alerts grafana threshold monitoring cockpit | ||
| dates: | ||
| validation: 2025-02-10 | ||
| posted: 2025-02-10 | ||
| categories: | ||
| - serverless | ||
| --- | ||
|
|
||
| This page shows you how to configure alerts for Scaleway Serverless Containers using Scaleway Cockpit and Grafana. | ||
|
|
||
| <Macro id="requirements" /> | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - Scaleway resources you can monitor | ||
| - [Created Grafana credentials](/cockpit/how-to/retrieve-grafana-credentials/) with the **Editor** role | ||
| - [Enabled](/cockpit/how-to/enable-alert-manager/) the alert manager | ||
| - [Created](/cockpit/how-to/add-contact-points/) at least one contact point | ||
| - Selected the **Scaleway Alerting** alert manager in Grafana | ||
|
|
||
| 1. [Log in to Grafana](/cockpit/how-to/access-grafana-and-managed-dashboards/) using your credentials. | ||
| 2. Click the **Toggle menu** then click **Alerting**. | ||
| 3. Click **Alert rules** and **+ New alert rule**. | ||
| 4. Scroll down to the **Define query and alert condition** section and click **Switch to data source-managed alert rule**. | ||
| <Message type="important"> | ||
| This allows you to configure alert rules managed by the data source of your choice, instead of using Grafana's managed alert rules. | ||
| </Message> | ||
|
|
||
| 5. Type in a name for your alert. | ||
| 6. Select the data source you want to configure alerts for. For the sake of this documentation, we are choosing the **Scaleway Metrics** data source. | ||
| 7. In the Metrics browser drop-down, select the metric you want to configure an alert for. Refer to the table below for details on each alert for Serverless Containers. | ||
|
|
||
| **AnyContainerError** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10s | ||
|
|
||
| Summary | ||
|
|
||
| : Container `{{ $labels.resource_name }}` is in error. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `serverless_container_status{status="error"} == 1` | ||
|
|
||
| Description | ||
|
|
||
| : Container `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is in error. Check the console to find out the error message. | ||
|
|
||
| **ContainerError** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10s | ||
|
|
||
| Summary | ||
|
|
||
| : Container `{{ $labels.resource_name }}` is in error. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `serverless_container_status{status="error",resource_id="your-container-id-here"} == 1` | ||
|
|
||
| Description | ||
|
|
||
| : Container `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is in error. Check the console to find out the error message. | ||
|
|
||
| **AnyContainerHighCPUUsage** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10m | ||
|
|
||
| Summary | ||
|
|
||
| : High CPU usage for container `{{ $labels.resource_name }}`. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `serverless_container_cpu_usage_ratio > 90` | ||
|
|
||
| Description | ||
|
|
||
| : Container `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is using more than `{{ printf "%.0f" $value }}`% of its available CPU since 10m. | ||
|
|
||
| **ContainerHighCPUUsage** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10m | ||
|
|
||
| Summary | ||
|
|
||
| : High CPU usage for container `{{ $labels.resource_name }}`. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `serverless_container_cpu_usage_ratio{resource_id="your-container-id-here"} > 90` | ||
|
|
||
| Description | ||
|
|
||
| : Container `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is using more than `{{ printf "%.0f" $value }}`% of its available CPU since 10m. | ||
|
|
||
| **AnyContainerHighMemoryUsage** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10m | ||
|
|
||
| Summary | ||
|
|
||
| : High memory usage for container `{{ $labels.resource_name }}`. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `(serverless_container_memory_usage_bytes / serverless_container_memory_limit_bytes) * 100 > 90` | ||
|
|
||
| Description | ||
|
|
||
| : Container `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is using more than `{{ printf "%.0f" $value }}`% of its available RAM since 10m. | ||
|
|
||
| **ContainerHighMemoryUsage** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10m | ||
|
|
||
| Summary | ||
|
|
||
| : High memory usage for container `{{ $labels.resource_name }}`. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `(serverless_container_memory_usage_bytes{resource_id="your-container-id-here"} / serverless_container_memory_limit_bytes{resource_id="your-container-id-here"}) * 100 > 90` | ||
|
|
||
| Description | ||
|
|
||
| : Container `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is using more than `{{ printf "%.0f" $value }}`% of its available RAM since 10m. | ||
|
|
||
| 8. Select labels that apply to the metric you have selected in the previous step, to target your desired resources and fine-tune your alert. | ||
| 9. Select one or more values for your labels. | ||
| 10. Click **Use query** to generate your alert based on the conditions you have defined. | ||
| 11. Select a folder to store your rule, or create a new one. Folders allow you to easily manage your different rules. | ||
| 12. Select an evaluation group to add your rule to. Rules within the same group are evaluated sequentially over the same time interval. | ||
| 13. In the **Set alert evaluation behavior** field, configure the amount of time during which the alert can be in breach of the condition(s) you have defined until it triggers. | ||
| <Message type="note"> | ||
| For example, if you wish to be alerted after your alert has been in breach of the condition for 2 minutes without interruption, type `2` and select `minutes` in the drop-down. | ||
| </Message> | ||
| 14. Optionally, add a summary and a description. | ||
| 15. Click **Save rule** at the top right corner of your screen to save your alert. Once your alert meets the requirements you have configured, you will receive an email to inform you that your alert has triggered. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
pages/serverless-functions/how-to/configure-alerts-function.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| --- | ||
| meta: | ||
| title: How to add alerts to a function | ||
| description: Learn how to add monitoring alerts to Serverless Functions with Scaleway. | ||
| content: | ||
| h1: How to add alerts to a function | ||
| paragraph: Learn how to add monitoring alerts to Serverless Functions with Scaleway. | ||
| tags: functions alerts grafana threshold monitoring cockpit | ||
| dates: | ||
| validation: 2025-02-10 | ||
| posted: 2025-02-10 | ||
| categories: | ||
| - serverless | ||
| --- | ||
|
|
||
| This page shows you how to configure alerts for Scaleway Serverless Functions using Scaleway Cockpit and Grafana. | ||
|
|
||
| <Macro id="requirements" /> | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - Scaleway resources you can monitor | ||
| - [Created Grafana credentials](/cockpit/how-to/retrieve-grafana-credentials/) with the **Editor** role | ||
| - [Enabled](/cockpit/how-to/enable-alert-manager/) the alert manager | ||
| - [Created](/cockpit/how-to/add-contact-points/) at least one contact point | ||
| - Selected the **Scaleway Alerting** alert manager in Grafana | ||
|
|
||
| 1. [Log in to Grafana](/cockpit/how-to/access-grafana-and-managed-dashboards/) using your credentials. | ||
| 2. Click the **Toggle menu** then click **Alerting**. | ||
| 3. Click **Alert rules** and **+ New alert rule**. | ||
| 4. Scroll down to the **Define query and alert condition** section and click **Switch to data source-managed alert rule**. | ||
| <Message type="important"> | ||
| This allows you to configure alert rules managed by the data source of your choice, instead of using Grafana's managed alert rules. | ||
| </Message> | ||
|
|
||
| 5. Type in a name for your alert. | ||
| 6. Select the data source you want to configure alerts for. For the sake of this documentation, we are choosing the **Scaleway Metrics** data source. | ||
| 7. In the Metrics browser drop-down, select the metric you want to configure an alert for. Refer to the table below for details on each alert for Serverless Functions. | ||
|
|
||
| **AnyFunctionError** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10s | ||
|
|
||
| Summary | ||
|
|
||
| : Function `{{ $labels.resource_name }}` is in error. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `serverless_function_status{status="error"} == 1` | ||
|
|
||
| Description | ||
|
|
||
| : Function `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is in error. Check the console to find out the error message. | ||
|
|
||
| **FunctionError** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10s | ||
|
|
||
| Summary | ||
|
|
||
| : Function `{{ $labels.resource_name }}` is in error. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `serverless_function_status{status="error",resource_id="your-function-id-here"} == 1` | ||
|
|
||
| Description | ||
|
|
||
| : Function `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is in error. Check the console to find out the error message. | ||
|
|
||
| **AnyFunctionHighCPUUsage** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10m | ||
|
|
||
| Summary | ||
|
|
||
| : High CPU usage for function `{{ $labels.resource_name }}`. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `serverless_function_cpu_usage_ratio > 90` | ||
|
|
||
| Description | ||
|
|
||
| : Function `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is using more than `{{ printf "%.0f" $value }}`% of its available CPU since 10m. | ||
|
|
||
| **FunctionHighCPUUsage** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10m | ||
|
|
||
| Summary | ||
|
|
||
| : High CPU usage for function `{{ $labels.resource_name }}`. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `serverless_function_cpu_usage_ratio{resource_id="your-function-id-here"} > 90` | ||
|
|
||
| Description | ||
|
|
||
| : Function `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is using more than `{{ printf "%.0f" $value }}`% of its available CPU since 10m. | ||
|
|
||
| **AnyFunctionHighMemoryUsage** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10m | ||
|
|
||
| Summary | ||
|
|
||
| : High memory usage for function `{{ $labels.resource_name }}`. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `(serverless_function_memory_usage_bytes / serverless_function_memory_limit_bytes) * 100 > 90` | ||
|
|
||
| Description | ||
|
|
||
| : Function `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is using more than `{{ printf "%.0f" $value }}`% of its available RAM since 10m. | ||
|
|
||
| **FunctionHighMemoryUsage** | ||
|
|
||
| Pending period | ||
|
|
||
| : 10m | ||
|
|
||
| Summary | ||
|
|
||
| : High memory usage for function `{{ $labels.resource_name }}`. | ||
|
|
||
| Query and alert condition | ||
|
|
||
| : `(serverless_function_memory_usage_bytes{resource_id="your-container-id-here"} / serverless_function_memory_limit_bytes{resource_id="your-container-id-here"}) * 100 > 90` | ||
|
|
||
| Description | ||
|
|
||
| : Function `{{ $labels.resource_name }}` with ID `{{ $labels.resource_id }}` is using more than `{{ printf "%.0f" $value }}`% of its available RAM since 10m. | ||
|
|
||
| 8. Select labels that apply to the metric you have selected in the previous step, to target your desired resources and fine-tune your alert. | ||
| 9. Select one or more values for your labels. | ||
| 10. Click **Use query** to generate your alert based on the conditions you have defined. | ||
| 11. Select a folder to store your rule, or create a new one. Folders allow you to easily manage your different rules. | ||
| 12. Select an evaluation group to add your rule to. Rules within the same group are evaluated sequentially over the same time interval. | ||
| 13. In the **Set alert evaluation behavior** field, configure the amount of time during which the alert can be in breach of the condition(s) you have defined until it triggers. | ||
| <Message type="note"> | ||
| For example, if you wish to be alerted after your alert has been in breach of the condition for 2 minutes without interruption, type `2` and select `minutes` in the drop-down. | ||
| </Message> | ||
| 14. Optionally, add a summary and a description. | ||
| 15. Click **Save rule** at the top right corner of your screen to save your alert. Once your alert meets the requirements you have configured, you will receive an email to inform you that your alert has triggered. | ||
SamyOubouaziz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.