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
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[Grafana/Prometheus/Istio] How does prometheus get istio metrics?

Posted on December 13, 2021December 14, 2021 By nim No Comments on [Grafana/Prometheus/Istio] How does prometheus get istio metrics?

Khi bạn cài đặt istio ở những version gần đây thì operator của istio ko con tích hợp luôn: grafana, kiali, prometheus,… Mà họ đã tách riêng thành các manifest riêng.

https://github.com/istio/istio/tree/master/samples/addons

Với istio thì họ có 2 option:
Option 1: Quick start
Option 2: Customizable install

Dưới đây là các metric mà scrape:

To gather metrics for the entire mesh, configure Prometheus to scrape:

  1. The control plane (istiod deployment)
  2. Ingress and Egress gateways
  3. The Envoy sidecar
  4. The user applications (if they expose Prometheus metrics)

To simplify the configuration of metrics, Istio offers two modes of operation.

Contents

Toggle
  • Option 1: Quick start
  • Option 2: Customizable install

Option 1: Quick start

Với option này thì là mặc định và theo mình nghĩ là nó sẽ collect khá nhiều metric.

Mình chắc có lý do hết, nếu resource của bạn dồi dào thì ngại j?

Họ cũng có nhắc chúng ta: “This will deploy Prometheus into your cluster. This is intended for demonstration only, and is not tuned for performance or security.”

Để làm rõ cách mà option này lấy metrics như thế nào thì họ có nói. Option này sẽ bị disable nếu bạn config như thế này trong operator.

enablePrometheusMerge: false

Giờ minh sẽ gen file manifest cho bạn coi.

Đầu tiền config map của istiod đã bị thay đổi
phần này thì chưa nói lên điều j?
bạn thấy là trong workload istio-ingressgateway đã bị xoá annotation
workload istiod cũng bị xoá annotation

To simplify configuration, Istio has the ability to control scraping entirely by prometheus.io annotations

Chắc các bạn làm nhiều về prometheus trên k8s thì cũng không xa lạ gì điều này.
TÓm lại: prometheus nhờ các annotation prometheus.io để colect metrics của istio và istio-ingressgateway

Trong target kubernetes-pods

Option 2: Customizable install

Các này thì try hard hơn:

Bạn sẽ sẽ tự đi config scrape_configs trong configmap của prometheus:

Đầu tiền mính xoá hết
Mình add thêm job_name

To scrape Istiod stats, the following example job can be added to scrape its http-monitoring port:

- job_name: 'istiod'
  kubernetes_sd_configs:
  - role: endpoints
    namespaces:
      names:
      - istio-system
  relabel_configs:
  - source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
    action: keep
    regex: istiod;http-monitoring

To scrape Envoy stats, including sidecar proxies and gateway proxies, the following job can be added to scrape ports that end with -envoy-prom:

- job_name: 'envoy-stats'
  metrics_path: /stats/prometheus
  kubernetes_sd_configs:
  - role: pod

  relabel_configs:
  - source_labels: [__meta_kubernetes_pod_container_port_name]
    action: keep
    regex: '.*-envoy-prom'
Target chỉ có 2 cái

Hiện giờ thấy traffic http phẩn hồi OK

Monitor TCP vẫn hiện nhé anh em.

Isito-EnvoyFilter

Post navigation

Previous Post: [Prometheus/Kiali] Setting Prometheus or Kiali for multi-cluster Istio mode.
Next Post: [Prometheus/Istio] Research about Recording Rules in Prometheus and reduce metrics of istio cluster.

More Related Articles

[kiali/istio] Fix issue Configured: configmaps “istio” not found Isito-EnvoyFilter
[Istio/OAuth2-Proxy] Authenticate applications on Kubernetes: Okta(OIDC), Istio, and OAuth2-Proxy integration. Isito-EnvoyFilter
[Istio] Change resource request and limit (RAM-CPU) for components of Istio Isito-EnvoyFilter
[Istio] Canary Upgrade Istio by Operator. This way is very easy!! Isito-EnvoyFilter
[Prometheus/Kiali] Setting Prometheus or Kiali for multi-cluster Istio mode. Isito-EnvoyFilter
[Istio] Authenticator KubeJWTAuthenticator at index 1 got error: failed to validate the JWT from cluster – When you update K8s version 1.20 to 1.21 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

  • [Azure] The subscription is not registered to use namespace ‘Microsoft.ContainerService’ May 8, 2025
  • [Azure] Insufficient regional vcpu quota left May 8, 2025
  • [WordPress] How to add a Dynamic watermark on WordPress. May 6, 2025
  • [vnet/Azure] VNet provisioning via Terraform. April 28, 2025
  • [tracetcp] How to perform a tracert command using a specific port. April 3, 2025

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • 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
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2025 NimTechnology.