<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Set up alerts for Prometheus metrics > 原文:[https://docs.gitlab.com/ee/operations/metrics/alerts.html](https://docs.gitlab.com/ee/operations/metrics/alerts.html) * [Managed Prometheus instances](#managed-prometheus-instances) * [External Prometheus instances](#external-prometheus-instances) * [Trigger actions from alerts](#trigger-actions-from-alerts-ultimate) # Set up alerts for Prometheus metrics[](#set-up-alerts-for-prometheus-metrics "Permalink") 在[為 CI / CD 環境配置指標](index.html)后,您可以根據實例的位置為 Prometheus 指標設置警報,并在環境性能超出您設置的范圍時[觸發警報操作](#trigger-actions-from-alerts-ultimate)以通知您的團隊. ## Managed Prometheus instances[](#managed-prometheus-instances "Permalink") 在[GitLab Ultimate](https://about.gitlab.com/pricing/) 11.2 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/6590)了[自定義指標](index.html#adding-custom-metrics) ,在 11.3 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/6590)了[圖書館指標](../../user/project/integrations/prometheus_library/metrics.html) . 對于使用自動配置的托管 Prometheus 實例,您可以直接在[指標儀表板中](index.html) [配置指標警報](index.html#adding-custom-metrics) . 設置警報: 1. 在您的項目中,導航到 **操作>指標** , 2. 確定要為其創建警報的指標,然后單擊**省略號** 指標右上角的圖標. 3. Choose **Alerts**. 4. 設置閾值和運算符. 5. 單擊**添加**以保存并激活警報. [![Adding an alert](https://img.kancloud.cn/9e/56/9e567ce989fde8f22d6c18faf220ba80_998x694.png)](../../user/project/integrations/img/prometheus_alert.png) 要刪除警報,請在警報圖標上返回所需的指標,然后單擊" **刪除"** . ## External Prometheus instances[](#external-prometheus-instances "Permalink") 版本歷史 * 在[GitLab Ultimate](https://about.gitlab.com/pricing/) 11.8 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/9258) . * 在 12.10 中[移至](https://gitlab.com/gitlab-org/gitlab/-/issues/42640) [GitLab Core](https://about.gitlab.com/pricing/) . 對于手動配置的 Prometheus 服務器,GitLab 提供了一個通知端點,用于 Prometheus Webhooks. 如果啟用了手動配置,則會將" **警報"**部分添加到 **設置>集成> Prometheus** . 本部分包含您需要的**URL**和**授權密鑰** . **重置密鑰**按鈕將使密鑰無效并生成一個新密鑰. [![Prometheus service configuration of Alerts](https://img.kancloud.cn/a2/68/a268ad35583d4774b2a218af30b9f7cd_1665x373.png)](../../user/project/integrations/img/prometheus_service_alerts.png) 要發送 GitLab 警報通知,請將**URL**和**授權密鑰**復制到 Prometheus Alertmanager 配置的[`webhook_configs`](https://s0prometheus0io.icopy.site/docs/alerting/latest/configuration/)部分: ``` receivers: name: gitlab webhook_configs: - http_config: bearer_token: 9e1cbfcd546896a9ea8be557caf13a76 send_resolved: true url: http://192.168.178.31:3001/root/manual_prometheus/prometheus/alerts/notify.json ... ``` 為了使 GitLab 將警報與[環境](../../ci/environments/index.html)相關聯,您必須在 Prometheus 中設置的警報上配置`gitlab_environment_name`標簽. 此值應與您在 GitLab 中的環境名稱匹配. **Note:** In GitLab versions 13.1 and greater, you can configure your manually configured Prometheus server to use the [Generic alerts integration](../../user/project/integrations/generic_alerts.html). ## Trigger actions from alerts[](#trigger-actions-from-alerts-ultimate "Permalink") 版本歷史 * 在[GitLab Ultimate](https://about.gitlab.com/pricing/) 11.11 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/4925) . * [從 GitLab Ultimate 12.5 起](https://gitlab.com/gitlab-org/gitlab/-/issues/13401) ,當 GitLab 收到恢復警報時,它將自動關閉相關問題. 警報可用于觸發操作,例如自動打開問題(自`13.1`默認禁用). 要配置操作: 1. 導航到您項目的 **設置>操作>事件** . 2. 啟用該選項以創建問題. 3. 選擇要從中創建問題的[問題模板](../../user/project/description_templates.html) . 4. (可選)選擇是否將電子郵件通知發送給項目的開發人員. 5. Click **保存更改**. 啟用后,當觸發包含包含從[警報有效負載中](https://s0prometheus0io.icopy.site/docs/alerting/latest/configuration/)提取的值的警報時,GitLab 會自動打開一個問題: * 問題作者: `GitLab Alert Bot` * 問題標題:從`annotations/title` , `annotations/summary`或`labels/alertname` * 警報`Summary` :屬性列表 * `starts_at` :通過`startsAt`警報的開始時間 * `full_query` :從`generatorURL`提取的警報查詢 * 從`annotations/*`提取的附加注釋的可選列表 * Alert [GFM](../../user/markdown.html) :來自`annotations/gitlab_incident_markdown` GitLab 風味`annotations/gitlab_incident_markdown` 當 GitLab 收到**Recovery Alert 時** ,它將關閉相關問題. 該操作記錄為關于該問題的系統消息,表明該操作已由 GitLab Alert 機器人自動關閉. 要進一步自定義問題,您可以在所選問題模板中添加標簽,提及或任何其他受支持的[快速操作](../../user/project/quick_actions.html) ,該操作適用于所有事件. 要將快速操作或其他信息限制為僅特定類型的警報,請使用`annotations/gitlab_incident_markdown`字段. 從[版本 12.2 開始](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/63373) ,GitLab 會使用`incident`標簽自動標記每個事件問題. 如果標簽尚不存在,則會自動創建. 如果度量標準超過警報閾值超過 5 分鐘,則 GitLab 會向該項目的所有[維護者和所有者](../../user/permissions.html#project-members-permissions)發送電子郵件.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看