Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log & Monitor
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[Istio] Research tracing in Istio

Posted on October 20, 2021January 17, 2022 By nim No Comments on [Istio] Research tracing in Istio

https://istio.io/latest/docs/tasks/observability/distributed-tracing/configurability/telemetry-api/#configuring-workload-specific-tracing-behavior

Khi các bạn cài istio thì mặc định là tracing sẽ được enable giữa workload có inject istio-proxy và giữa ingress gateway với workload có inject istio-proxy

ở đây chúng ta thấy 2Spans

Contents

  • 1. Disable Tracing
    • 1.1 Disable tracing a particular workload by Telemetry
    • 1.2 Disable tracing Global.
    • 1.3) Disable tracing istio by envoy
      • 1.3.1) ingress-gateway
        • 1.3.1.1) End-User access ingress-gateway
        • 1.3.1.2) workload injected istio-proxy and access ingress-gateway
        • 1.3.1.3) workload injected istio-proxy and access service
      • 1.3.2) a particular workload
  • 2) Configure tracing using MeshConfig and Pod annotations (update Fri, 24 Dec, 2021)
    • 2.1) MeshConfig in Operator-Istio
    • 2.2) Pod annotations

1. Disable Tracing

1.1 Disable tracing a particular workload by Telemetry

apiVersion: telemetry.istio.io/v1alpha1
kind: Telemetry
metadata:
  labels:
    app.kubernetes.io/instance: tracing-istio
  name: tracing-disable
  namespace: default
spec:
  selector:
    matchLabels:
      app: httpbin
  tracing:
    - disableSpanReporting: true

Giờ bạn quay lại ui jaeger ko con thấy hiện thị tracing nữa.

Bạn thấy kind Telemetry. Chỉ có version istio lớn hơn 1.10.4 mới có CustomResourceDefinition Telemetry

1.2 Disable tracing Global.

edit configmap istio
enableTracing: false

Cái này mình dùng cho istio ver 1.9 trở vể trước.
nhưng mà cách này hơi thốn.

1.3) Disable tracing istio by envoy

https://github.com/istio/istio/issues/10875
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
https://github.com/istio/istio/issues/26973
https://github.com/istio/istio/issues/18169
https://github.com/istio/istio/issues/34772 -> only run istio ver 1.10

1.3.1) ingress-gateway

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  annotations:
  name: disabled-tracing-gateway
  namespace: istio-system
spec:
  configPatches:
  - applyTo: NETWORK_FILTER
    match:
      context: GATEWAY
      listener:
        filterChain:
          filter:
            name: envoy.http_connection_manager
    patch:
      operation: MERGE
      value:
        typedConfig:
          '@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          # preserve_external_request_id: true
          generate_request_id: false
1.3.1.1) End-User access ingress-gateway

Nghĩ là mình mở 1 browser truy cập web

Khi lên Jaeger thì ko xuất hiện tracing của case này
Mới mô hình kết nối như này thì ko thấy có tracing ơ jaeger
1.3.1.2) workload injected istio-proxy and access ingress-gateway

ở case này thì mình dùng 1 workload đã injected istio-proxy và thực curl vào url
while true; do curl -sS fleetman-webapp-1.nimtechnology.com/ip; echo; sleep 1; done

Dashboard này thể hiện trên kiali
Thể hiện trên jaeger

vẫn thấy tracing ở case này

1.3.1.3) workload injected istio-proxy and access service

ở case này thì mình dùng 1 workload đã injected istio-proxy và thực curl vào service
while true; do curl -sS httpbin-1.default.svc.cluster.local/ip; echo; sleep 1; done

ảnh trên kiali
Tracing trên jaeger vẫn hiện

1.3.2) a particular workload

comming soon

2) Configure tracing using MeshConfig and Pod annotations (update Fri, 24 Dec, 2021)

https://istio.io/latest/docs/tasks/observability/distributed-tracing/mesh-and-proxy-config/

Để cấu các thông số tracing như ý bạn muốn thì có 2 cách:
– Cấu hình trong file operator -> gen manifest và apply
– Cấu hình trong annotation của từng workload.

2.1) MeshConfig in Operator-Istio

cat <<'EOF' > tracing.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  meshConfig:
    enableTracing: true
    defaultConfig:
      tracing:
        sampling: 10
        custom_tags:
          my_tag_header:
            header:
              name: host
EOF

2.2) Pod annotations

apiVersion: apps/v1
kind: Deployment
metadata:
  name: sleep
spec:
  ...
  template:
    metadata:
      ...
      annotations:
        proxy.istio.io/config: |
          tracing:
            sampling: 10
            custom_tags:
              my_tag_header:
                header:
                  name: host
    spec:
      ...

Hoặc bạn cũng có thể config như sau:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: sleep
spec:
  ...
  template:
    metadata:
      ...
      annotations:
        proxy.istio.io/config: "{'tracing' : { 'sampling': 100 } }"
    spec:
      ...

Mình thì ko chuyên về tracing lắm, nên mình sẽ giải thích thông số mà mình có ứng dụng và mình hiểu:

sampling: 10
+ cái này đơn vị là %.
+ Nếu bạn có 100 call vào service của bạn. Nó random chọn ra 10call trong 100call để lấy mâũ (sampling) rồi generate tracing
https://dimitr.im/distributed-tracing-istio-jaeger
Mình có case ntn:
app đó dev cũng có tracing trong app và bình thường chưa inject istio thì trace_id có độ dài là 10 ký tự.
Nhưng khi mình inject istio thì trace_id mà app show là lại có độ dài 15 ký tự
–> bị lệnh về trace_id.
Để sử lý case này thì đại ca của mình config sampling: 100 cho istio gen tracing 100%
thì trace_id của app show ra trờ về độ dài là 10 ký tự.

Isito-EnvoyFilter, Uncategorized

Post navigation

Previous Post: [Istio] Explain MutatingWebhookConfiguration to auto-injected istio-proxy.
Next Post: [Istio] OMG – Metric of an Istiod pod had 2 versions. Why???

More Related Articles

[istio] Discover route TCP in Cluster Istio Isito-EnvoyFilter
[Prometheus/Kiali] Setting Prometheus or Kiali for multi-cluster Istio mode. Isito-EnvoyFilter
[GRPC] Checking GPRC Port by fullstorydev/grpcurl Coding
[Case dị – istio] Những case khó đỡ khiến chúng ra suy nghĩ là istio có chạy được hay ko? Isito-EnvoyFilter
[Istio] Fix lỗi validationController khi sử dụng istio-operator [revision] cài đặt istio. Isito-EnvoyFilter
[Istio] Workload injected Istio that can’t connect Database(Redis, PostgreSQL) – excludeOutboundPorts or excludeIPRanges Isito-EnvoyFilter

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Prometheus/Grafana] Install Prometheus and Grafana on ubuntu. March 27, 2023
  • [Kong Gateway] WebSocket connection failed March 26, 2023
  • [Nextcloud] Can’t download files to have a size bigger than 2Gi on NextCloud – RaspBerry March 24, 2023
  • [Datadog] Using DataDog to monitor all services on kubernetes March 19, 2023
  • [Metrics Server] Failed to make webhook authorizer request: the server could not find the requested resource March 17, 2023

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
    • NextCloud
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • MetalLB
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2023 NimTechnology.