kubernetes / ingress-nginx

Ingress-NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
17.27k stars 8.21k forks source link

ingress-nginx Grafana dashboard not working #10464

Closed junha-ahn closed 11 months ago

junha-ahn commented 11 months ago

What happened:

Dashboard

image

https://github.com/kubernetes/ingress-nginx/blob/main/deploy/grafana/dashboards/nginx.json

image

https://github.com/kubernetes/ingress-nginx/blob/main/deploy/grafana/dashboards/request-handling-performance.json

Prometheus Query

When I query single metric without any label, Then Metric values come out. grafana graph not coming out.

Because of incorrect ingress object setting? Or I use baremetal Nginx (hostnetwork:True)?

nginx_ingress_controller_request_duration_seconds_bucket

image image

nginx_ingress_controller_response_size_sum

image image


NGINX Ingress controller version

You can see

ingress-nginx-4.8.0 (baremetal, hostNetwork:True)

# nginx_ingress_controller_build_info

{build="6d3a6b6a33ddc3d40f00be262c60057a71393be7", container="controller", controller_class="k8s.io/ingress-nginx", controller_namespace="default", controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h", endpoint="metrics", instance="10.0.91.45:10254", job="development-ingress-nginx-controller-metrics", namespace="default", pod="development-ingress-nginx-controller-6b6cc54666-zt49h", release="v1.8.2", repository="https://github.com/kubernetes/ingress-nginx", service="development-ingress-nginx-controller-metrics"}

How was the ingress-nginx-controller installed:

  1. Edit values.yaml
  2. and generate ingress-nginx.yaml from it (helm template ...)
  3. And we deployed ingress-nginx.yaml (with ArgoCD)

Kubernetes version (use kubectl version):

$ kubectl version
Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.4-eks-2d98532

Environment:

AWS EKS (configured by Terraform)

Others

I installed kube-prometheus-stack chart (latest)

resource "helm_release" "kube-prometheus" {
  depends_on = [
    helm_release.mysql-exporter,
    kubernetes_config_map.grafana-dashboards-custom
  ]

  chart      = "kube-prometheus-stack"
  name       = "prometheus"
  namespace  = "monitoring"
  repository = "https://prometheus-community.github.io/helm-charts"

  values = [
    "${file("${path.module}/../kubernetes/prometheus/kube_prometheus_custom_values.yaml")}"
  ]
}

kube-monitoring.tf

    additionalScrapeConfigs:
      - job_name: "nginx-controller"
        static_configs:
          - targets: ["development-ingress-nginx-controller-metrics.default:10254"]

And You can see the options kube_prometheus_custom_values.yaml

// <grafana-url>/api/health/ returns....
{
  "commit": "8e428858dd",
  "database": "ok",
  "version": "10.1.2"
}
# prometheus_build_info

{
  branch="HEAD", 
  container="prometheus", 
  version="2.47.0"
}

image

Get nginx /metrics

And I think, my nginx-ingress service-monitor provides a different metric than the one shown in docs: exposed-metrics.

$ kubectl port-forward svc/development-ingress-nginx-controller-metrics 10254:10254
Click This ``` # HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles. # TYPE go_gc_duration_seconds summary go_gc_duration_seconds{quantile="0"} 4.3334e-05 go_gc_duration_seconds{quantile="0.25"} 5.8191e-05 go_gc_duration_seconds{quantile="0.5"} 7.2759e-05 go_gc_duration_seconds{quantile="0.75"} 9.6036e-05 go_gc_duration_seconds{quantile="1"} 0.00064438 go_gc_duration_seconds_sum 0.133902568 go_gc_duration_seconds_count 1125 # HELP go_goroutines Number of goroutines that currently exist. # TYPE go_goroutines gauge go_goroutines 96 # HELP go_info Information about the Go environment. # TYPE go_info gauge go_info{version="go1.21.1"} 1 # HELP go_memstats_alloc_bytes Number of bytes allocated and still in use. # TYPE go_memstats_alloc_bytes gauge go_memstats_alloc_bytes 1.1619128e+07 # HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed. # TYPE go_memstats_alloc_bytes_total counter go_memstats_alloc_bytes_total 7.697844376e+09 # HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table. # TYPE go_memstats_buck_hash_sys_bytes gauge go_memstats_buck_hash_sys_bytes 1.719941e+06 # HELP go_memstats_frees_total Total number of frees. # TYPE go_memstats_frees_total counter go_memstats_frees_total 5.7257548e+07 # HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata. # TYPE go_memstats_gc_sys_bytes gauge go_memstats_gc_sys_bytes 4.978816e+06 # HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and still in use. # TYPE go_memstats_heap_alloc_bytes gauge go_memstats_heap_alloc_bytes 1.1619128e+07 # HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used. # TYPE go_memstats_heap_idle_bytes gauge go_memstats_heap_idle_bytes 1.261568e+07 # HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use. # TYPE go_memstats_heap_inuse_bytes gauge go_memstats_heap_inuse_bytes 1.4712832e+07 # HELP go_memstats_heap_objects Number of allocated objects. # TYPE go_memstats_heap_objects gauge go_memstats_heap_objects 61962 # HELP go_memstats_heap_released_bytes Number of heap bytes released to OS. # TYPE go_memstats_heap_released_bytes gauge go_memstats_heap_released_bytes 7.790592e+06 # HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system. # TYPE go_memstats_heap_sys_bytes gauge go_memstats_heap_sys_bytes 2.7328512e+07 # HELP go_memstats_last_gc_time_seconds Number of seconds since 1970 of last garbage collection. # TYPE go_memstats_last_gc_time_seconds gauge go_memstats_last_gc_time_seconds 1.6960822106306791e+09 # HELP go_memstats_lookups_total Total number of pointer lookups. # TYPE go_memstats_lookups_total counter go_memstats_lookups_total 0 # HELP go_memstats_mallocs_total Total number of mallocs. # TYPE go_memstats_mallocs_total counter go_memstats_mallocs_total 5.731951e+07 # HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures. # TYPE go_memstats_mcache_inuse_bytes gauge go_memstats_mcache_inuse_bytes 2400 # HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system. # TYPE go_memstats_mcache_sys_bytes gauge go_memstats_mcache_sys_bytes 15600 # HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures. # TYPE go_memstats_mspan_inuse_bytes gauge go_memstats_mspan_inuse_bytes 206136 # HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system. # TYPE go_memstats_mspan_sys_bytes gauge go_memstats_mspan_sys_bytes 309624 # HELP go_memstats_next_gc_bytes Number of heap bytes when next garbage collection will take place. # TYPE go_memstats_next_gc_bytes gauge go_memstats_next_gc_bytes 1.7977264e+07 # HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations. # TYPE go_memstats_other_sys_bytes gauge go_memstats_other_sys_bytes 681883 # HELP go_memstats_stack_inuse_bytes Number of bytes in use by the stack allocator. # TYPE go_memstats_stack_inuse_bytes gauge go_memstats_stack_inuse_bytes 2.031616e+06 # HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator. # TYPE go_memstats_stack_sys_bytes gauge go_memstats_stack_sys_bytes 2.031616e+06 # HELP go_memstats_sys_bytes Number of bytes obtained from system. # TYPE go_memstats_sys_bytes gauge go_memstats_sys_bytes 3.7065992e+07 # HELP go_threads Number of OS threads created. # TYPE go_threads gauge go_threads 10 # HELP nginx_ingress_controller_build_info A metric with a constant '1' labeled with information about the build. # TYPE nginx_ingress_controller_build_info gauge nginx_ingress_controller_build_info{build="6d3a6b6a33ddc3d40f00be262c60057a71393be7",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",release="v1.8.2",repository="https://github.com/kubernetes/ingress-nginx"} 1 # HELP nginx_ingress_controller_bytes_sent DEPRECATED The number of bytes sent to a client # TYPE nginx_ingress_controller_bytes_sent histogram nginx_ingress_controller_bytes_sent_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="10"} 0 nginx_ingress_controller_bytes_sent_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="100"} 0 nginx_ingress_controller_bytes_sent_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="1000"} 2 nginx_ingress_controller_bytes_sent_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="10000"} 2 nginx_ingress_controller_bytes_sent_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="100000"} 2 nginx_ingress_controller_bytes_sent_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="1e+06"} 2 nginx_ingress_controller_bytes_sent_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="1e+07"} 2 nginx_ingress_controller_bytes_sent_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="+Inf"} 2 nginx_ingress_controller_bytes_sent_sum{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 644 nginx_ingress_controller_bytes_sent_count{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 2 # HELP nginx_ingress_controller_config_hash Running configuration hash actually running # TYPE nginx_ingress_controller_config_hash gauge nginx_ingress_controller_config_hash{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 1.2049227008866445e+19 # HELP nginx_ingress_controller_config_last_reload_successful Whether the last configuration reload attempt was successful # TYPE nginx_ingress_controller_config_last_reload_successful gauge nginx_ingress_controller_config_last_reload_successful{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 1 # HELP nginx_ingress_controller_config_last_reload_successful_timestamp_seconds Timestamp of the last successful configuration reload. # TYPE nginx_ingress_controller_config_last_reload_successful_timestamp_seconds gauge nginx_ingress_controller_config_last_reload_successful_timestamp_seconds{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 1.696081911e+09 # HELP nginx_ingress_controller_leader_election_status Gauge reporting status of the leader election, 0 indicates follower, 1 indicates leader. 'name' is the string used to identify the lease # TYPE nginx_ingress_controller_leader_election_status gauge nginx_ingress_controller_leader_election_status{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",name="development-ingress-nginx-leader"} 1 # HELP nginx_ingress_controller_nginx_process_connections current number of client connections with state {active, reading, writing, waiting} # TYPE nginx_ingress_controller_nginx_process_connections gauge nginx_ingress_controller_nginx_process_connections{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",state="active"} 1 nginx_ingress_controller_nginx_process_connections{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",state="reading"} 0 nginx_ingress_controller_nginx_process_connections{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",state="waiting"} 0 nginx_ingress_controller_nginx_process_connections{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",state="writing"} 1 # HELP nginx_ingress_controller_nginx_process_connections_total total number of connections with state {accepted, handled} # TYPE nginx_ingress_controller_nginx_process_connections_total counter nginx_ingress_controller_nginx_process_connections_total{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",state="accepted"} 8857 nginx_ingress_controller_nginx_process_connections_total{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",state="handled"} 8857 # HELP nginx_ingress_controller_nginx_process_cpu_seconds_total Cpu usage in seconds # TYPE nginx_ingress_controller_nginx_process_cpu_seconds_total counter nginx_ingress_controller_nginx_process_cpu_seconds_total{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 22.299999999999986 # HELP nginx_ingress_controller_nginx_process_num_procs number of processes # TYPE nginx_ingress_controller_nginx_process_num_procs gauge nginx_ingress_controller_nginx_process_num_procs{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 6 # HELP nginx_ingress_controller_nginx_process_oldest_start_time_seconds start time in seconds since 1970/01/01 # TYPE nginx_ingress_controller_nginx_process_oldest_start_time_seconds gauge nginx_ingress_controller_nginx_process_oldest_start_time_seconds{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 1.696049694e+09 # HELP nginx_ingress_controller_nginx_process_read_bytes_total number of bytes read # TYPE nginx_ingress_controller_nginx_process_read_bytes_total counter nginx_ingress_controller_nginx_process_read_bytes_total{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 3.15392e+06 # HELP nginx_ingress_controller_nginx_process_requests_total total number of client requests # TYPE nginx_ingress_controller_nginx_process_requests_total counter nginx_ingress_controller_nginx_process_requests_total{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 9923 # HELP nginx_ingress_controller_nginx_process_resident_memory_bytes number of bytes of memory in use # TYPE nginx_ingress_controller_nginx_process_resident_memory_bytes gauge nginx_ingress_controller_nginx_process_resident_memory_bytes{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 2.1614592e+08 # HELP nginx_ingress_controller_nginx_process_virtual_memory_bytes number of bytes of memory in use # TYPE nginx_ingress_controller_nginx_process_virtual_memory_bytes gauge nginx_ingress_controller_nginx_process_virtual_memory_bytes{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 1.928769536e+09 # HELP nginx_ingress_controller_nginx_process_write_bytes_total number of bytes written # TYPE nginx_ingress_controller_nginx_process_write_bytes_total counter nginx_ingress_controller_nginx_process_write_bytes_total{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 737280 # HELP nginx_ingress_controller_orphan_ingress Gauge reporting status of ingress orphanity, 1 indicates orphaned ingress.\n 'namespace' is the string used to identify namespace of ingress, 'ingress' for ingress name and 'type' for 'no-service' or 'no-endpoint' of orphanity # TYPE nginx_ingress_controller_orphan_ingress gauge nginx_ingress_controller_orphan_ingress{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",ingress="development-ticketing-application",namespace="default",type="no-endpoint"} 0 nginx_ingress_controller_orphan_ingress{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",ingress="development-ticketing-application",namespace="default",type="no-service"} 0 nginx_ingress_controller_orphan_ingress{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",ingress="prometheus-remote-write",namespace="monitoring",type="no-endpoint"} 0 nginx_ingress_controller_orphan_ingress{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",ingress="prometheus-remote-write",namespace="monitoring",type="no-service"} 0 # HELP nginx_ingress_controller_request_duration_seconds The request processing time in milliseconds # TYPE nginx_ingress_controller_request_duration_seconds histogram nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="0.005"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="0.01"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="0.025"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="0.05"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="0.1"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="0.25"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="0.5"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="1"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="2.5"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="5"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="10"} 2 nginx_ingress_controller_request_duration_seconds_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="+Inf"} 2 nginx_ingress_controller_request_duration_seconds_sum{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 0 nginx_ingress_controller_request_duration_seconds_count{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 2 # HELP nginx_ingress_controller_request_size The request length (including request line, header, and request body) # TYPE nginx_ingress_controller_request_size histogram nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="10"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="20"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="30"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="40"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="50"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="60"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="70"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="80"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="90"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="100"} 0 nginx_ingress_controller_request_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="+Inf"} 2 nginx_ingress_controller_request_size_sum{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 460 nginx_ingress_controller_request_size_count{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 2 # HELP nginx_ingress_controller_requests The total number of client requests # TYPE nginx_ingress_controller_requests counter nginx_ingress_controller_requests{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 2 # HELP nginx_ingress_controller_response_size The response length (including request line, header, and request body) # TYPE nginx_ingress_controller_response_size histogram nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="10"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="20"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="30"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="40"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="50"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="60"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="70"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="80"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="90"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="100"} 0 nginx_ingress_controller_response_size_bucket{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308",le="+Inf"} 2 nginx_ingress_controller_response_size_sum{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 644 nginx_ingress_controller_response_size_count{canary="",controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h",host="_",ingress="development-ticketing-application",method="GET",namespace="default",path="/",service="development-ticketing-application",status="308"} 2 # HELP nginx_ingress_controller_ssl_certificate_info Hold all labels associated to a certificate # TYPE nginx_ingress_controller_ssl_certificate_info gauge nginx_ingress_controller_ssl_certificate_info{class="k8s.io/ingress-nginx",host="_",identifier="-88626344065711284511581595979522833225",issuer_common_name="Kubernetes Ingress Controller Fake Certificate",issuer_organization="Acme Co",namespace="",public_key_algorithm="RSA",secret_name="",serial_number="88626344065711284511581595979522833225"} 1 # HELP nginx_ingress_controller_ssl_expire_time_seconds Number of seconds since 1970 to the SSL Certificate expire.\n An example to check if this certificate will expire in 10 days is: "nginx_ingress_controller_ssl_expire_time_seconds < (time() + (10 * 24 * 3600))" # TYPE nginx_ingress_controller_ssl_expire_time_seconds gauge nginx_ingress_controller_ssl_expire_time_seconds{class="k8s.io/ingress-nginx",host="_",namespace="default",secret_name=""} 1.727585694e+09 # HELP nginx_ingress_controller_success Cumulative number of Ingress controller reload operations # TYPE nginx_ingress_controller_success counter nginx_ingress_controller_success{controller_class="k8s.io/ingress-nginx",controller_namespace="default",controller_pod="development-ingress-nginx-controller-6b6cc54666-zt49h"} 14 # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. # TYPE process_cpu_seconds_total counter process_cpu_seconds_total 62.13 # HELP process_max_fds Maximum number of open file descriptors. # TYPE process_max_fds gauge process_max_fds 1.048576e+06 # HELP process_open_fds Number of open file descriptors. # TYPE process_open_fds gauge process_open_fds 20 # HELP process_resident_memory_bytes Resident memory size in bytes. # TYPE process_resident_memory_bytes gauge process_resident_memory_bytes 5.7413632e+07 # HELP process_start_time_seconds Start time of the process since unix epoch in seconds. # TYPE process_start_time_seconds gauge process_start_time_seconds 1.69604969403e+09 # HELP process_virtual_memory_bytes Virtual memory size in bytes. # TYPE process_virtual_memory_bytes gauge process_virtual_memory_bytes 1.300279296e+09 # HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes. # TYPE process_virtual_memory_max_bytes gauge process_virtual_memory_max_bytes 1.8446744073709552e+19 # HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served. # TYPE promhttp_metric_handler_requests_in_flight gauge promhttp_metric_handler_requests_in_flight 1 # HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code. # TYPE promhttp_metric_handler_requests_total counter promhttp_metric_handler_requests_total{code="200"} 2158 promhttp_metric_handler_requests_total{code="500"} 0 promhttp_metric_handler_requests_total{code="503"} 0 ```
k8s-ci-robot commented 11 months ago

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
longwuyuan commented 11 months ago

/remove-kind bug

Its not easy to understand the co-relation between the query and the graph. One easy way to make progress is go into edit mode of the graph and look at the query there

junha-ahn commented 11 months ago

If I request /events or /abc.. Nginx-Ingress metric always says path="/"

No problem with it?

check my images above

longwuyuan commented 11 months ago

ok, now I understand your issue.

junha-ahn commented 11 months ago

If I added option metrics-per-host: false

Then It prints more information. good, but There is one more problem

Wildcard ingresses By default request metrics are labeled with the hostname. When you have a wildcard domain ingress, then there will be no metrics for that ingress (to prevent the metrics from exploding in cardinality). To get metrics in this case you need to run the ingress controller with --metrics-per-host=false (you will lose labeling by hostname, but still have labeling by ingress).

I requests a lot of path, But It never catch it

Why not catch all path??

image image

Ingress object

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: prometheus-remote-write
  namespace: monitoring
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /api/v1/write
    nginx.ingress.kubernetes.io/auth-type: basic
    nginx.ingress.kubernetes.io/auth-secret: remote-write-basic-auth
spec:
  rules:
  - http:
      paths:
      - path: /api/v1/write
        pathType: Exact
        backend:
          service:
            name: prometheus-kube-prometheus-prometheus
            port:
              number: 9090
  ingressClassName: nginx
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ include "ticketing-chart.fullname" . }}
  namespace: {{ .Values.namespace }}
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: {{ include "ticketing-chart.fullname" . }}
            port:
              number: {{ .Values.backend.port }}
  ingressClassName: nginx
junha-ahn commented 11 months ago

Closed this issue

If anyone get empty data on dashboard And ingress-ngnix setup like me (baremetal, hostnetwork true...) use metrics-per-host: false option to fix it

And I post new Issue about my new problem (above comment): https://github.com/kubernetes/ingress-nginx/issues/10465