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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Monitoring NGINX Ingress Controller with VTS metrics > 原文:[https://docs.gitlab.com/ee/user/project/integrations/prometheus_library/nginx_ingress_vts.html](https://docs.gitlab.com/ee/user/project/integrations/prometheus_library/nginx_ingress_vts.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 with VTS metrics[](#monitoring-nginx-ingress-controller-with-vts-metrics "Permalink") 在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13438) . **注意:** [NGINX Ingress 版本 0.16](nginx_ingress.html)及更高[版本](nginx_ingress.html)具有內置的 Prometheus 度量標準,該度量標準與基于 VTS 的度量標準不同. GitLab 支持自動檢測和監視 Kubernetes NGINX Ingress 控制器. 這是通過利用[版本 0.9.0](https://github.com/kubernetes/ingress-nginx/blob/master/Changelog.md#09-beta1)至[0.15.x 中](https://github.com/kubernetes/ingress-nginx/blob/master/Changelog.md#0150)隨附的 VTS Prometheus 度量標準導出程序來[提供的](https://github.com/kubernetes/ingress-nginx/blob/master/Changelog.md#0150) . ## Requirements[](#requirements "Permalink") [Prometheus 集成](../prometheus.html)必須處于活動狀態. ## Metrics supported[](#metrics-supported "Permalink") | Name | Query | | --- | --- | | 吞吐量(要求/秒) | `sum(rate(nginx_upstream_responses_total{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[2m])) by (status_code)` | | 延遲(毫秒) | `avg(nginx_upstream_response_msecs_avg{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"})` | | HTTP 錯誤率(%) | `sum(rate(nginx_upstream_responses_total{status_code="5xx", upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[2m])) / sum(rate(nginx_upstream_responses_total{upstream=~"%{kube_namespace}-%{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.9.0 或更高版本,并啟用指標. * NGINX Ingress 應該標注為 Prometheus 監視. * Prometheus 應該配置為監視帶注釋的容器. ### About managed NGINX Ingress deployments[](#about-managed-nginx-ingress-deployments "Permalink") NGINX Ingress is deployed into the `gitlab-managed-apps` namespace, using the [official Helm chart](https://github.com/helm/charts/tree/master/stable/nginx-ingress). NGINX Ingress will be [externally reachable via the Load Balancer’s Endpoint](../../../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 YAML. ## Specifying the Environment label[](#specifying-the-environment-label "Permalink") 為了隔離并僅顯示給定環境的相關指標,GitLab 需要一種方法來檢測關聯了哪些標簽. 為此,GitLab 將搜索帶有適當標簽的指標. 在這種情況下, `upstream`標簽的格式必須為`<KUBE_NAMESPACE>-<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>

                              哎呀哎呀视频在线观看