From 38f0ba92fbad37395e1b091ad480d65c004dd16f Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 18 Mar 2019 16:44:38 +0800 Subject: [PATCH] zh: help/faq/metrics-and-logs/prometheus-application-metrics.md (#3729) * zh: help/faq/metrics-and-logs/prometheus-application-metrics.md * fixed: tu[p --- .../life-of-a-request.md | 0 .../prometheus-application-metrics.md | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+) rename content_zh/help/faq/{telemetry => metrics-and-logs}/life-of-a-request.md (100%) create mode 100644 content_zh/help/faq/metrics-and-logs/prometheus-application-metrics.md diff --git a/content_zh/help/faq/telemetry/life-of-a-request.md b/content_zh/help/faq/metrics-and-logs/life-of-a-request.md similarity index 100% rename from content_zh/help/faq/telemetry/life-of-a-request.md rename to content_zh/help/faq/metrics-and-logs/life-of-a-request.md diff --git a/content_zh/help/faq/metrics-and-logs/prometheus-application-metrics.md b/content_zh/help/faq/metrics-and-logs/prometheus-application-metrics.md new file mode 100644 index 0000000000..2c7fcd7d70 --- /dev/null +++ b/content_zh/help/faq/metrics-and-logs/prometheus-application-metrics.md @@ -0,0 +1,20 @@ +--- +title: 我能在 Istio 中使用 Prometheus 抓取应用指标么? +weight: 90 +--- + +可以。Istio 发行包中带有 [Prometheus 配置]({{< github_file >}}/install/kubernetes/helm/istio/charts/prometheus/templates/configmap.yaml),不论是否启用了双向 TLS,都可以借此配置来收集应用的指标数据。 + +在没有启用双向 TLS 的环境中,`kubernetes-pods` 任务会从 Pod 中收集应用的指标数据。如果 Istio 启用了双向 TLS,就由 `kubernetes-pods-istio-secure` 任务完成应用指标数据的收集工作。 + +两个 Job 都需要在欲抓取指标的应用 Pod 中加入如下注解: + +- `prometheus.io/scrape: "true"` +- `prometheus.io/path: ""` +- `prometheus.io/port: ""` + +一点说明: + +- 如果在 Citadel Pod 能够生成必要证书并分发给 Prometheus 之前启动了 Prometheus Pod,为了能够在双向 TLS 环境下抓取应用指标,必须重启 Prometheus Pod。 + +- 如果你的应用在一个单独的端口上开放 Prometheus 指标接口,这个端口需要加入 Service 和 Deployment 清单之中。