diff --git a/k8s/prometheus/prometheus.yaml b/k8s/prometheus/prometheus.yaml index a3637b4..037694c 100644 --- a/k8s/prometheus/prometheus.yaml +++ b/k8s/prometheus/prometheus.yaml @@ -175,3 +175,35 @@ scrape_configs: target_label: container - target_label: service replacement: librechat + + # --- Kong gateways ------------------------------------------------------ + # Every dataplane pod the Kong operator creates declares a container port + # named `metrics` (8100) and carries the gateway-name label, so no + # annotation is needed on the pods themselves — which matters because the + # operator owns that pod template, not us. Keeping on the port NAME rather + # than a number also drops the init containers, which declare no port. + # + # The RED series (kong_http_requests_total, kong_*_latency_ms, + # kong_bandwidth_bytes) only appear once the gateway has the `prometheus` + # KongPlugin bound; without it the endpoint still answers, but with node + # and shared-dict metrics only. + - job_name: kong-gateways + kubernetes_sd_configs: + - role: pod + relabel_configs: + - source_labels: [__meta_kubernetes_pod_label_gateway_networking_k8s_io_gateway_name] + action: keep + regex: .+ + - source_labels: [__meta_kubernetes_pod_container_port_name] + action: keep + regex: metrics + - source_labels: [__meta_kubernetes_pod_label_gateway_networking_k8s_io_gateway_name] + target_label: gateway + - source_labels: [__meta_kubernetes_namespace] + target_label: namespace + - source_labels: [__meta_kubernetes_pod_name] + target_label: pod + - source_labels: [__meta_kubernetes_pod_container_name] + target_label: container + - source_labels: [__meta_kubernetes_pod_node_name] + target_label: node