<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Monitoring NGINX Ingress Controller > 原文:[https://docs.gitlab.com/ee/user/project/integrations/prometheus_library/nginx_ingress.html](https://docs.gitlab.com/ee/user/project/integrations/prometheus_library/nginx_ingress.html) * [Requirements](#requirements) * [Metrics supported](#metrics-supported) * [Configuring NGINX Ingress monitoring](#configuring-nginx-ingress-monitoring) * [About managed NGINX Ingress deployments](#about-managed-nginx-ingress-deployments) * [Manually setting up NGINX Ingress for Prometheus monitoring](#manually-setting-up-nginx-ingress-for-prometheus-monitoring) * [Specifying the Environment label](#specifying-the-environment-label) # Monitoring NGINX Ingress Controller[](#monitoring-nginx-ingress-controller "Permalink") 在 GitLab 11.7 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/22133) . **注意:** 0.16.0 之前的 NGINX Ingress 版本提供了一個隨附的[VTS Prometheus 指標導出器](nginx_ingress_vts.html) ,該導出器導出的指標與內置指標不同. GitLab 支持自動檢測和監視 Kubernetes NGINX Ingress 控制器. 這是通過利用 Kubernetes NGINX Ingress 控制器[版本 0.16.0](https://github.com/kubernetes/ingress-nginx/blob/master/Changelog.md#0160)及更高[版本隨附](https://github.com/kubernetes/ingress-nginx/blob/master/Changelog.md#0160)的內置 Prometheus 指標來提供的. ## Requirements[](#requirements "Permalink") [Prometheus integration](../prometheus.html) must be active. ## Metrics supported[](#metrics-supported "Permalink") | Name | Query | | --- | --- | | 吞吐量(要求/秒) | `sum(label_replace(rate(nginx_ingress_controller_requests{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m]), "status_code", "${1}xx", "status", "(.)..")) by (status_code)` | | 延遲(毫秒) | `sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_sum{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) / sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_count{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) * 1000` | | HTTP 錯誤率(%) | `sum(rate(nginx_ingress_controller_requests{status=~"5.*",namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) / sum(rate(nginx_ingress_controller_requests{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) * 100` | ## Configuring NGINX Ingress monitoring[](#configuring-nginx-ingress-monitoring "Permalink") 如果您已經使用 GitLab 的[Kubernetes 集群集成](../../clusters/index.html#installing-applications)部署了 NGINX Ingress,則 Prometheus 將[自動對其進行監視](#about-managed-nginx-ingress-deployments) . 對于其他部署,需要根據您的安裝進行[一些配置](#manually-setting-up-nginx-ingress-for-prometheus-monitoring) : * NGINX Ingress 的版本應為 0.16.0 或更高,并啟用指標. * NGINX Ingress 應該標注為 Prometheus 監視. * Prometheus 應該配置為監視帶注釋的容器. ### About managed NGINX Ingress deployments[](#about-managed-nginx-ingress-deployments "Permalink") 使用[官方 Helm 圖表將](https://github.com/helm/charts/tree/master/stable/nginx-ingress) NGINX Ingress 部署到`gitlab-managed-apps`命名空間中. NGINX Ingress 將[通過 Load Balancer 的 Endpoint](../../../clusters/applications.html#ingress)在[外部訪問](../../../clusters/applications.html#ingress) . 通過設置以下內容,將 NGINX 配置為進行 Prometheus 監視: * `enable-vts-status: "true"` ,以導出 Prometheus 指標. * `prometheus.io/scrape: "true"` ,以啟用自動發現. * `prometheus.io/port: "10254"` ,以指定度量標準端口. 與 GitLab 部署的 Prometheus 服務結合使用時,將自動收集響應指標. ### Manually setting up NGINX Ingress for Prometheus monitoring[](#manually-setting-up-nginx-ingress-for-prometheus-monitoring "Permalink") [NGINX Ingress 的](https://github.com/kubernetes/ingress-nginx) 0.9.0 及更高版本具有對導出 Prometheus 指標的內置支持. 要啟用,必須傳遞 ConfigMap 設置: `enable-vts-status: "true"` . 啟用后,Prometheus 指標端點將開始在端口 10254 上運行. 接下來,需要對 Ingress 進行注釋,以進行 Prometheus 監視. 需要添加兩個新的注釋: * `prometheus.io/scrape: "true"` * `prometheus.io/port: "10254"` 管理這些設置取決于如何部署 NGINX Ingress. 如果您通過[官方 Helm 圖表](https://github.com/helm/charts/tree/master/stable/nginx-ingress)進行了部署,則可以使用`controller.stats.enabled`以及所需的注釋來啟用指標. 另外,也可以直接在[Kubernetes 儀表板中](https://github.com/kubernetes/dashboard)編輯 NGINX Ingress YML. ## Specifying the Environment label[](#specifying-the-environment-label "Permalink") 為了隔離并僅顯示給定環境的相關指標,GitLab 需要一種方法來檢測關聯了哪些標簽. 為此,GitLab 將搜索帶有適當標簽的指標. 在這種情況下, `ingress`標簽必須為`<CI_ENVIRONMENT_SLUG>` . 如果您使用[自動部署](../../../../topics/autodevops/stages.html#auto-deploy)來部署您的應用程序,則將自動使用此格式,并且無需您執行任何操作即可檢測到指標.
                  <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>

                              哎呀哎呀视频在线观看