入站 Istio 入口网关指标
Inbound Istio Ingress Gateway Metrics
我使用默认 IstioOperator
遥测配置部署了自定义 Istio Ingress Gateway 部署,没有 EnvoyFilter
修改统计数据。
当我通过以下方式查看普罗米修斯统计数据时:
kubectl exec -n web-ingress-gateway web-ingress-gateway-6966569988-876mp -c istio-proxy -- pilot-agent request GET /stats/prometheus | grep istio_requests_total
就是returns一堆
istio_requests_total{response_code="200",reporter="source",source_workload="web-ingress-gateway",source_workload_namespace="web-ingress-gateway",source_principal="unknown",source_app="web-ingress-gateway",source_version="unknown",source_cluster="redacted",destination_workload="redacted",destination_workload_namespace="redacted",destination_principal="unknown",destination_app="unknown",destination_version="unknown",destination_service="redacted",destination_service_name="redacted",destination_service_namespace="redacted",destination_cluster="redacted",request_protocol="http",response_flags="-",grpc_response_status="",connection_security_policy="unknown",source_canonical_service="web-ingress-gateway",destination_canonical_service="redacted",source_canonical_revision="latest",destination_canonical_revision="latest"} 28
...
似乎只有 reporter="source"
标签,但没有 reporter="destionation"
通常也出现在 sidecar 中。
有没有办法获取传入请求指标?
我关注了this doc。
但它并没有真正分解到我需要的细节,因为它只给了你 response_code_class
。
# TYPE envoy_http_outbound_0_0_0_0_9282_downstream_rq counter
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="1xx"} 0
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="2xx"} 1062279
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="3xx"} 130245
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="4xx"} 12532
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="5xx"} 578
Reporter: This identifies the reporter of the request. It is set to destination
if report is from a server Istio proxy and source
if report is from a client Istio proxy or a gateway.
这意味着带有 reporter="source"
的请求是从源 pod(在您的情况下是 web-ingress-gateway)发送的,并由 prometheus 在此 pod 中报告。
带有 reporter="destination"
的请求从另一个 pod 发送到您的情况下的目标 pod(即 web-ingress-gateway -> ),并在目标 pod 中如此报告。
如果您发出相同的命令,但发送到应用程序 pod(不是入口网关),您将看到带有 reporter="destination"
.
的请求
以Bookinfo应用为例,我们可以将请求从productpage
到details
pods
productpage
是源 pod,报告为 reporter="source"
details
是目标 pod,报告为 reporter="destination"
万一我误解了你的问题,而你想查看来自外部到你的入口网关的请求的指标——目前这是不可能的。 Ingress 仅以报告者为源发出指标 [source]
我使用默认 IstioOperator
遥测配置部署了自定义 Istio Ingress Gateway 部署,没有 EnvoyFilter
修改统计数据。
当我通过以下方式查看普罗米修斯统计数据时:
kubectl exec -n web-ingress-gateway web-ingress-gateway-6966569988-876mp -c istio-proxy -- pilot-agent request GET /stats/prometheus | grep istio_requests_total
就是returns一堆
istio_requests_total{response_code="200",reporter="source",source_workload="web-ingress-gateway",source_workload_namespace="web-ingress-gateway",source_principal="unknown",source_app="web-ingress-gateway",source_version="unknown",source_cluster="redacted",destination_workload="redacted",destination_workload_namespace="redacted",destination_principal="unknown",destination_app="unknown",destination_version="unknown",destination_service="redacted",destination_service_name="redacted",destination_service_namespace="redacted",destination_cluster="redacted",request_protocol="http",response_flags="-",grpc_response_status="",connection_security_policy="unknown",source_canonical_service="web-ingress-gateway",destination_canonical_service="redacted",source_canonical_revision="latest",destination_canonical_revision="latest"} 28
...
似乎只有 reporter="source"
标签,但没有 reporter="destionation"
通常也出现在 sidecar 中。
有没有办法获取传入请求指标?
我关注了this doc。
但它并没有真正分解到我需要的细节,因为它只给了你 response_code_class
。
# TYPE envoy_http_outbound_0_0_0_0_9282_downstream_rq counter
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="1xx"} 0
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="2xx"} 1062279
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="3xx"} 130245
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="4xx"} 12532
envoy_http_outbound_0_0_0_0_9282_downstream_rq{response_code_class="5xx"} 578
Reporter: This identifies the reporter of the request. It is set to
destination
if report is from a server Istio proxy andsource
if report is from a client Istio proxy or a gateway.
这意味着带有 reporter="source"
的请求是从源 pod(在您的情况下是 web-ingress-gateway)发送的,并由 prometheus 在此 pod 中报告。
带有 reporter="destination"
的请求从另一个 pod 发送到您的情况下的目标 pod(即 web-ingress-gateway -> ),并在目标 pod 中如此报告。
如果您发出相同的命令,但发送到应用程序 pod(不是入口网关),您将看到带有 reporter="destination"
.
以Bookinfo应用为例,我们可以将请求从productpage
到details
pods
productpage
是源 pod,报告为 reporter="source"
details
是目标 pod,报告为 reporter="destination"
万一我误解了你的问题,而你想查看来自外部到你的入口网关的请求的指标——目前这是不可能的。 Ingress 仅以报告者为源发出指标 [source]