<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之旅 廣告
                # Prometheus integration > 原文:[https://docs.gitlab.com/ee/user/project/integrations/prometheus.html](https://docs.gitlab.com/ee/user/project/integrations/prometheus.html) * [Enabling Prometheus Integration](#enabling-prometheus-integration) * [Managed Prometheus on Kubernetes](#managed-prometheus-on-kubernetes) * [Requirements](#requirements) * [Getting started](#getting-started) * [About managed Prometheus deployments](#about-managed-prometheus-deployments) * [Manual configuration of Prometheus](#manual-configuration-of-prometheus) * [Requirements](#requirements-1) * [Getting started](#getting-started-1) * [Configuration in GitLab](#configuration-in-gitlab) * [Thanos configuration in GitLab](#thanos-configuration-in-gitlab) * [Precedence with multiple Prometheus configurations](#precedence-with-multiple-prometheus-configurations) * [Determining the performance impact of a merge](#determining-the-performance-impact-of-a-merge) # Prometheus integration[](#prometheus-integration "Permalink") 在 GitLab 9.0 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/8935) . GitLab 提供與[Prometheus 的](https://s0prometheus0io.icopy.site)強大集成,可直接在 GitLab 中監視您的應用程序的關鍵指標. 從 Prometheus 檢索每個環境的度量,然后在 GitLab 界面中顯示. [![Environment Dashboard](https://img.kancloud.cn/e0/a5/e0a5f2b56e5f80c22e1f9870e5951e6d_1000x339.png)](img/prometheus_dashboard.png) 有兩種方法可以設置 Prometheus 集成,具體取決于應用程序的運行位置: * 對于在 Kubernetes 上的部署,GitLab 可以自動[部署和管理 Prometheus](#managed-prometheus-on-kubernetes) . * 對于其他部署目標,只需[指定 Prometheus 服務器](#manual-configuration-of-prometheus) . 啟用后,GitLab 將自動從[度量標準庫](prometheus_library/index.html)中的已知服務中檢測度量[標準](prometheus_library/index.html) . 您還可以[添加自己的指標](../../../operations/metrics/index.html#adding-custom-metrics)并創建[自定義儀表板](../../../operations/metrics/dashboards/index.html) . ## Enabling Prometheus Integration[](#enabling-prometheus-integration "Permalink") ### Managed Prometheus on Kubernetes[](#managed-prometheus-on-kubernetes "Permalink") 在 GitLab 10.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28916) . GitLab 可以在[連接的 Kubernetes 集群](../clusters/index.html)上無縫部署和管理 Prometheus,從而使對應用程序的監視變得容易. #### Requirements[](#requirements "Permalink") * A [connected Kubernetes cluster](../clusters/index.html) #### Getting started[](#getting-started "Permalink") 擁有連接的 Kubernetes 集群后,只需單擊即可輕松部署托管的 Prometheus. 1. 轉到**操作> Kubernetes**頁面以查看已連接的集群 2. 選擇您要部署 Prometheus 的集群 3. 單擊**安裝**按鈕以將 Prometheus 部署到群集 [![Managed Prometheus Deploy](https://img.kancloud.cn/fb/4e/fb4ecc4341a59a5d6c44403808d82e9f_860x50.png)](img/prometheus_deploy.png) #### About managed Prometheus deployments[](#about-managed-prometheus-deployments "Permalink") 使用[官方 Helm 圖表](https://github.com/helm/charts/tree/master/stable/prometheus)將 Prometheus 部署到`gitlab-managed-apps`命名空間中. Prometheus 僅可在集群中訪問,并且 GitLab 通過[Kubernetes API 進行](https://kubernetes.io/docs/concepts/overview/kubernetes-api/)通信. Prometheus 服務器將[自動檢測和監視](https://s0prometheus0io.icopy.site/docs/prometheus/latest/configuration/configuration/)節點,吊艙和端點. 要配置 Prometheus 監視的資源,只需設置以下[Kubernetes 批注](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) : * `prometheus.io/scrape`為`true`以啟用對資源的監視. * `prometheus.io/port`定義度量標準端點的端口. * `prometheus.io/path`來定義度量標準端點的路徑. 默認為`/metrics` . CPU 和內存使用情況受到監視,但是需要使用[命名約定](prometheus_library/kubernetes.html#specifying-the-environment)來確定環境. 如果您使用的是[Auto DevOps](../../../topics/autodevops/index.html) ,則會自動處理. 由 GitLab 部署到群集的[NGINX Ingress](../clusters/index.html#installing-applications)會自動添加注釋,以進行監視,以提供關鍵的響應指標:延遲,吞吐量和錯誤率. ### Manual configuration of Prometheus[](#manual-configuration-of-prometheus "Permalink") #### Requirements[](#requirements-1 "Permalink") 與 Prometheus 集成需要滿足以下條件: 1. GitLab 9.0 或更高版本 2. 必須將 Prometheus 配置為收集[支持的指標之一](prometheus_library/index.html) 3. Each metric must be have a label to indicate the environment 4. GitLab 必須與 Prometheus 服務器具有網絡連接 #### Getting started[](#getting-started-1 "Permalink") 安裝和配置 Prometheus 來監視應用程序非常簡單. 1. [Install Prometheus](https://s0prometheus0io.icopy.site/docs/prometheus/latest/installation/) 2. 設置[受支持的監視目標之一](prometheus_library/index.html) 3. 配置 Prometheus 服務器以[收集其指標](https://s0prometheus0io.icopy.site/docs/prometheus/latest/configuration/configuration/) #### Configuration in GitLab[](#configuration-in-gitlab "Permalink") GitLab 中 Prometheus 集成的實際配置非常簡單. 您只需要與您要集成的 Prometheus 服務器的域名或 IP 地址. 如果 Prometheus 資源由 Google 的身份識別代理(IAP)保護,則可以傳遞其他信息,例如客戶端 ID 和服務帳戶憑據,GitLab 可以使用這些信息來訪問資源. 有關從服務帳戶進行身份驗證的更多信息,請參見 Google 的" [從服務帳戶](https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_a_service_account)進行[身份驗證"](https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_a_service_account)文檔. 1. 導航至位于的" [集成"頁面](overview.html#accessing-integrations) **設置>集成** . 2. 單擊**Prometheus**服務. 3. 對于**API URL** ,請提供服務器的域名或 IP 地址,例如`http://prometheus.example.com/`或`http://192.0.2.1/` . 4. (可選)在**Google IAP Audience Client ID 中** ,提供受 Google IAP 保護的 Prometheus OAuth Client 的 Client ID. 5. (可選)在**Google IAP 服務帳戶 JSON 中** ,提供被授權訪問 Prometheus 資源的服務帳戶憑據文件的內容. 6. Click **保存更改**. [![Configure Prometheus Service](https://img.kancloud.cn/19/fe/19fe69c7d62ca87b70f82b0a04bd3913_681x512.png)](img/prometheus_manual_configuration_v13_2.png) #### Thanos configuration in GitLab[](#thanos-configuration-in-gitlab "Permalink") 您可以使用 GitLab 將[Thanos](https://thanos.io/)配置為 Prometheus 的替代品. 您將需要與之集成的 Thanos 服務器的域名或 IP 地址. 1. 導航到" [集成"頁面](overview.html#accessing-integrations) . 2. 單擊**Prometheus**服務. 3. 提供服務器的域名或 IP 地址,例如`http://thanos.example.com/`或`http://192.0.2.1/` . 4. Click **保存更改**. ### Precedence with multiple Prometheus configurations[](#precedence-with-multiple-prometheus-configurations "Permalink") 盡管可以同時啟用 Prometheus 的[手動配置](#manual-configuration-of-prometheus)和[自動配置](#managed-prometheus-on-kubernetes) ,但僅使用其中之一: * 如果您已[在 Kubernetes 上](#managed-prometheus-on-kubernetes)啟用了[Prometheus 手動配置](#manual-configuration-of-prometheus)和[托管的 Prometheus](#managed-prometheus-on-kubernetes) ,則手動配置優先,并用于從[儀表板](../../../operations/metrics/dashboards/index.html#defining-custom-dashboards-per-project)和[自定義指標](../../../operations/metrics/index.html#adding-custom-metrics)運行查詢. * 如果您已在**不同**級別(項目,組,實例)的 Kubernetes 集群上安裝了托管的 Prometheus 應用程序,則集群的優先級中將描述[優先級的順序](../../instance/clusters/index.html#cluster-precedence) . * If you have managed Prometheus applications installed on multiple Kubernetes clusters at the **same** level, the Prometheus application of a cluster with a matching [environment scope](../../../ci/environments/index.html#scoping-environments-with-specs) is used. ## Determining the performance impact of a merge[](#determining-the-performance-impact-of-a-merge "Permalink") 版本歷史 * 在 GitLab 9.2 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/10408) . * GitLab 9.3 添加了 30 分鐘平均值的[數字比較](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/27439) . 開發人員可以在合并請求工作流程中查看其更改對性能的影響. **Note:** Requires [Kubernetes](prometheus_library/kubernetes.html) metrics. 將源分支部署到環境后,將出現迷你圖和平均內存消耗的數值比較. 在迷你圖上,圓點指示部署當前更改的時間,前后最多顯示 30 分鐘的性能數據. 比較結果顯示了部署前后 30 分鐘平均值之間的差異. 部署每個提交后,將更新此信息. 合并并重新部署目標分支后,指標將切換為顯示此修訂版已部署到的新環境. 性能數據將在 Prometheus 服務器上持久保存的時間內可用. [![Merge Request with Performance Impact](https://img.kancloud.cn/9d/78/9d785deb208266d79726e22cd247fbb7_1940x664.png)](img/merge_request_performance.png)
                  <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>

                              哎呀哎呀视频在线观看