From 50628497260bd467068b23906947952fe1056595 Mon Sep 17 00:00:00 2001 From: David Martin Date: Mon, 10 Jun 2024 15:24:25 +0100 Subject: [PATCH] Add gateway.listeners.allowedRoutes.namespaces.from field --- METRICS.md | 2 +- config/default/custom-resource-state.yaml | 1 + config/examples/dashboards/gateways.json | 3 +++ config/examples/dashboards/gateways.yaml | 2 +- config/examples/kube-prometheus/bundle.yaml | 8 ++++++-- src/dashboards/gateways.jsonnet | 3 +++ 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/METRICS.md b/METRICS.md index c48d6fb..408aedb 100644 --- a/METRICS.md +++ b/METRICS.md @@ -39,7 +39,7 @@ gatewayapi_gateway_deleted{namespace="",name=""} 1690879977 Per [Listener](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io%2fv1beta1.Listener) information, Gauge ```promql -gatewayapi_gateway_listener_info{namespace="",name="",listener_name="",port="",protocol="",hostname="","tls_mode"=""} 1 +gatewayapi_gateway_listener_info{namespace="",name="",listener_name="",port="",protocol="",hostname="","tls_mode"="","allowed_routes_namespaces_from"=""} 1 ``` ### gatewayapi_gateway_status diff --git a/config/default/custom-resource-state.yaml b/config/default/custom-resource-state.yaml index 45fde4e..f43d5a2 100644 --- a/config/default/custom-resource-state.yaml +++ b/config/default/custom-resource-state.yaml @@ -53,6 +53,7 @@ spec: protocol: ["protocol"] hostname: ["hostname"] tls_mode: ["tls","mode"] + allowed_routes_namespaces_from: ["allowedRoutes", "namespaces", "from"] - name: "status" help: "status condition" each: diff --git a/config/examples/dashboards/gateways.json b/config/examples/dashboards/gateways.json index 2d7db41..74b61cc 100644 --- a/config/examples/dashboards/gateways.json +++ b/config/examples/dashboards/gateways.json @@ -350,6 +350,7 @@ "port", "protocol", "tls_mode", + "allowed_routes_namespaces_from", "Value" ] } @@ -363,6 +364,7 @@ }, "indexByName": { "Value": 9, + "allowed_routes_namespaces_from": 10, "customresource_kind": 0, "customresource_version": 1, "hostname": 5, @@ -375,6 +377,7 @@ }, "renameByName": { "Value": "", + "allowed_routes_namespaces_from": "Allowed Routes NS", "customresource_kind": "Kind", "customresource_version": "Version", "hostname": "Hostname", diff --git a/config/examples/dashboards/gateways.yaml b/config/examples/dashboards/gateways.yaml index 0a9880b..80b2ad2 100644 --- a/config/examples/dashboards/gateways.yaml +++ b/config/examples/dashboards/gateways.yaml @@ -7,4 +7,4 @@ spec: matchLabels: dashboards: "grafana" json: > - {"editable":false,"links":[{"asDropdown":false,"includeVars":true,"keepTime":true,"tags":["gateway-api-state"],"targetBlank":false,"title":"Gateway Dashboards","type":"dashboards"}],"panels":[{"gridPos":{"h":1,"w":24,"x":0,"y":0},"id":1,"title":"Gateways","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of Gateways across all namespaces","gridPos":{"h":3,"w":2,"x":0,"y":1},"id":2,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_gateway_info{name=~\"$gateway\"})","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Number of Gateways not in an Accepted and Programmed state","gridPos":{"h":3,"w":2,"x":2,"y":1},"id":3,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count((gatewayapi_gateway_status{name=~\"$gateway\",type=\"Accepted\"} == 0) or (gatewayapi_gateway_status{name=~\"$gateway\",type=\"Programmed\"} == 0)) or vector(0)","instant":true}],"title":"Unhealthy","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Created At"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"Kind"},"properties":[{"id":"custom.width","value":"108"}]},{"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":"98"}]},{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.width","value":"125"}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":1},"id":4,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_gateway_created{name=~\"$gateway\"} * on(name, namespace, instance) group_right gatewayapi_gateway_info{name=~\"$gateway\"}","format":"table","instant":true,"range":false}],"title":"Gateways","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["customresource_version","gatewayclass_name","name","namespace","Value"]}}},{"id":"calculateField","options":{"alias":"Created At","binary":{"left":"Value","operator":"*","reducer":"sum","right":"1000"},"mode":"binary","reduce":{"reducer":"sum"},"replaceFields":false}},{"id":"organize","options":{"excludeByName":{"Value":true,"customresource_kind":true},"indexByName":{},"renameByName":{"Value":"Created","customresource_kind":"Kind","customresource_version":"Version","gatewayclass_name":"GatewayClass","name":"Name","namespace":"Namespace"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Created At"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"Kind"},"properties":[{"id":"custom.width","value":"108"}]},{"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":"94"}]},{"matcher":{"id":"byName","options":"Listener Name"},"properties":[{"id":"custom.width","value":"112"}]},{"matcher":{"id":"byName","options":"Hostname"},"properties":[{"id":"custom.width","value":"163"}]},{"matcher":{"id":"byName","options":"Port"},"properties":[{"id":"custom.width","value":"59"}]},{"matcher":{"id":"byName","options":"Protocol"},"properties":[{"id":"custom.width","value":"77"}]},{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.width","value":"91"}]}]},"gridPos":{"h":6,"w":10,"x":14,"y":1},"id":5,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_gateway_listener_info{name=~\"$gateway\"}","format":"table","instant":true,"range":false}],"title":"Gateway Listeners","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["customresource_version","hostname","listener_name","name","namespace","port","protocol","tls_mode","Value"]}}},{"id":"organize","options":{"excludeByName":{"Value":true},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total Gateways with an Accepted state of True","gridPos":{"h":3,"w":2,"x":0,"y":4},"id":6,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_gateway_status{name=~\"$gateway\",type=\"Accepted\"} > 0)","instant":true}],"title":"Accepted","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total Gateways with a Programmed state of True","gridPos":{"h":3,"w":2,"x":2,"y":4},"id":7,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_gateway_status{name=~\"$gateway\",type=\"Programmed\"} > 0)","instant":true}],"title":"Programmed","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of listeners across all Gateways","gridPos":{"h":3,"w":2,"x":0,"y":7},"id":8,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_gateway_listener_info{name=~\"$gateway\"})","instant":true}],"title":"Listeners","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of attached routes across all listeners","gridPos":{"h":3,"w":2,"x":2,"y":7},"id":9,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"sum(gatewayapi_gateway_status_listener_attached_routes{name=~\"$gateway\"})","instant":true}],"title":"Att. Routes","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Created At"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"Kind"},"properties":[{"id":"custom.width","value":"108"}]},{"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":"94"}]},{"matcher":{"id":"byName","options":"Listener Name"},"properties":[{"id":"custom.width","value":"119"}]},{"matcher":{"id":"byName","options":"Hostname"},"properties":[{"id":"custom.width","value":"163"}]},{"matcher":{"id":"byName","options":"Port"},"properties":[{"id":"custom.width","value":"59"}]},{"matcher":{"id":"byName","options":"Protocol"},"properties":[{"id":"custom.width","value":"104"}]},{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.width","value":"136"}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":7},"id":10,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_gateway_status_address_info{name=~\"$gateway\"}","format":"table","instant":true,"range":false}],"title":"Gateway Status Addresses","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["customresource_version","name","namespace","type","value"]}}},{"id":"organize","options":{"excludeByName":{"Value":true},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode","type":"Address Type","value":"Address Value"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Created At"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"Kind"},"properties":[{"id":"custom.width","value":"113"}]},{"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":"88"}]},{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.width","value":"167"}]},{"matcher":{"id":"byName","options":"Listener Name"},"properties":[{"id":"custom.width","value":"167"}]},{"matcher":{"id":"byName","options":"# Attached Routes"},"properties":[{"id":"custom.width","value":"137"}]}]},"gridPos":{"h":6,"w":10,"x":14,"y":7},"id":11,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_gateway_status_listener_attached_routes{name=~\"$gateway\"}","format":"table","instant":true,"range":false}],"title":"Gateway Listener Status - Attached Routes","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["customresource_version","listener_name","name","namespace","Value"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"HTTPRoute Details","url":"/d/gatewayapihttproutes/gateway-api-state-httproutes?var-httproute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":13},"id":12,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_httproute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"HTTPRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"GRPCRoute Details","url":"/d/gatewayapigrpcroutes/gateway-api-state-grpcroutes?var-grpcroute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":14,"y":13},"id":13,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_grpcroute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"GRPCRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"TLSRoute Details","url":"/d/gatewayapitlsroutes/gateway-api-state-tlsroutes?var-tlsroute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":19},"id":14,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_tlsroute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"TLSRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"TCPRoute Details","url":"/d/gatewayapitcproutes/gateway-api-state-tcproutes?var-tcproute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":14,"y":19},"id":15,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_tcproute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"TCPRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"UDPRoute Details","url":"/d/gatewayapiudproutes/gateway-api-state-udproutes?var-udproute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":25},"id":16,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_udproute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"UDPRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"}],"schemaVersion":36,"style":"dark","tags":["gateway-api","gateway-api-state"],"templating":{"list":[{"label":"Data Source","name":"datasource","query":"prometheus","type":"datasource"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"Gateway","multi":true,"name":"gateway","query":{"query":"label_values(gatewayapi_gateway_info, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"}]},"time":{"from":"now-1h","to":"now"},"timezone":"utc","title":"Gateway API State / Gateways","uid":"gatewayapigateways"} + {"editable":false,"links":[{"asDropdown":false,"includeVars":true,"keepTime":true,"tags":["gateway-api-state"],"targetBlank":false,"title":"Gateway Dashboards","type":"dashboards"}],"panels":[{"gridPos":{"h":1,"w":24,"x":0,"y":0},"id":1,"title":"Gateways","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of Gateways across all namespaces","gridPos":{"h":3,"w":2,"x":0,"y":1},"id":2,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_gateway_info{name=~\"$gateway\"})","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Number of Gateways not in an Accepted and Programmed state","gridPos":{"h":3,"w":2,"x":2,"y":1},"id":3,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count((gatewayapi_gateway_status{name=~\"$gateway\",type=\"Accepted\"} == 0) or (gatewayapi_gateway_status{name=~\"$gateway\",type=\"Programmed\"} == 0)) or vector(0)","instant":true}],"title":"Unhealthy","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Created At"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"Kind"},"properties":[{"id":"custom.width","value":"108"}]},{"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":"98"}]},{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.width","value":"125"}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":1},"id":4,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_gateway_created{name=~\"$gateway\"} * on(name, namespace, instance) group_right gatewayapi_gateway_info{name=~\"$gateway\"}","format":"table","instant":true,"range":false}],"title":"Gateways","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["customresource_version","gatewayclass_name","name","namespace","Value"]}}},{"id":"calculateField","options":{"alias":"Created At","binary":{"left":"Value","operator":"*","reducer":"sum","right":"1000"},"mode":"binary","reduce":{"reducer":"sum"},"replaceFields":false}},{"id":"organize","options":{"excludeByName":{"Value":true,"customresource_kind":true},"indexByName":{},"renameByName":{"Value":"Created","customresource_kind":"Kind","customresource_version":"Version","gatewayclass_name":"GatewayClass","name":"Name","namespace":"Namespace"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Created At"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"Kind"},"properties":[{"id":"custom.width","value":"108"}]},{"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":"94"}]},{"matcher":{"id":"byName","options":"Listener Name"},"properties":[{"id":"custom.width","value":"112"}]},{"matcher":{"id":"byName","options":"Hostname"},"properties":[{"id":"custom.width","value":"163"}]},{"matcher":{"id":"byName","options":"Port"},"properties":[{"id":"custom.width","value":"59"}]},{"matcher":{"id":"byName","options":"Protocol"},"properties":[{"id":"custom.width","value":"77"}]},{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.width","value":"91"}]}]},"gridPos":{"h":6,"w":10,"x":14,"y":1},"id":5,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_gateway_listener_info{name=~\"$gateway\"}","format":"table","instant":true,"range":false}],"title":"Gateway Listeners","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["customresource_version","hostname","listener_name","name","namespace","port","protocol","tls_mode","allowed_routes_namespaces_from","Value"]}}},{"id":"organize","options":{"excludeByName":{"Value":true},"indexByName":{"Value":9,"allowed_routes_namespaces_from":10,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"","allowed_routes_namespaces_from":"Allowed Routes NS","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total Gateways with an Accepted state of True","gridPos":{"h":3,"w":2,"x":0,"y":4},"id":6,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_gateway_status{name=~\"$gateway\",type=\"Accepted\"} > 0)","instant":true}],"title":"Accepted","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total Gateways with a Programmed state of True","gridPos":{"h":3,"w":2,"x":2,"y":4},"id":7,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_gateway_status{name=~\"$gateway\",type=\"Programmed\"} > 0)","instant":true}],"title":"Programmed","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of listeners across all Gateways","gridPos":{"h":3,"w":2,"x":0,"y":7},"id":8,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_gateway_listener_info{name=~\"$gateway\"})","instant":true}],"title":"Listeners","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of attached routes across all listeners","gridPos":{"h":3,"w":2,"x":2,"y":7},"id":9,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"sum(gatewayapi_gateway_status_listener_attached_routes{name=~\"$gateway\"})","instant":true}],"title":"Att. Routes","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Created At"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"Kind"},"properties":[{"id":"custom.width","value":"108"}]},{"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":"94"}]},{"matcher":{"id":"byName","options":"Listener Name"},"properties":[{"id":"custom.width","value":"119"}]},{"matcher":{"id":"byName","options":"Hostname"},"properties":[{"id":"custom.width","value":"163"}]},{"matcher":{"id":"byName","options":"Port"},"properties":[{"id":"custom.width","value":"59"}]},{"matcher":{"id":"byName","options":"Protocol"},"properties":[{"id":"custom.width","value":"104"}]},{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.width","value":"136"}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":7},"id":10,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_gateway_status_address_info{name=~\"$gateway\"}","format":"table","instant":true,"range":false}],"title":"Gateway Status Addresses","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["customresource_version","name","namespace","type","value"]}}},{"id":"organize","options":{"excludeByName":{"Value":true},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode","type":"Address Type","value":"Address Value"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Created At"},"properties":[{"id":"unit","value":"dateTimeAsIso"}]},{"matcher":{"id":"byName","options":"Kind"},"properties":[{"id":"custom.width","value":"113"}]},{"matcher":{"id":"byName","options":"Version"},"properties":[{"id":"custom.width","value":"88"}]},{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.width","value":"167"}]},{"matcher":{"id":"byName","options":"Listener Name"},"properties":[{"id":"custom.width","value":"167"}]},{"matcher":{"id":"byName","options":"# Attached Routes"},"properties":[{"id":"custom.width","value":"137"}]}]},"gridPos":{"h":6,"w":10,"x":14,"y":7},"id":11,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_gateway_status_listener_attached_routes{name=~\"$gateway\"}","format":"table","instant":true,"range":false}],"title":"Gateway Listener Status - Attached Routes","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["customresource_version","listener_name","name","namespace","Value"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"HTTPRoute Details","url":"/d/gatewayapihttproutes/gateway-api-state-httproutes?var-httproute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":13},"id":12,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_httproute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"HTTPRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"GRPCRoute Details","url":"/d/gatewayapigrpcroutes/gateway-api-state-grpcroutes?var-grpcroute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":14,"y":13},"id":13,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_grpcroute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"GRPCRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"TLSRoute Details","url":"/d/gatewayapitlsroutes/gateway-api-state-tlsroutes?var-tlsroute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":19},"id":14,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_tlsroute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"TLSRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"TCPRoute Details","url":"/d/gatewayapitcproutes/gateway-api-state-tcproutes?var-tcproute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":14,"y":19},"id":15,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_tcproute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"TCPRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Name"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"UDPRoute Details","url":"/d/gatewayapiudproutes/gateway-api-state-udproutes?var-udproute=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":25},"id":16,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_udproute_parent_info{parent_kind=\"Gateway\",parent_name=~\"${gateway}\"}","format":"table","instant":true,"range":false}],"title":"UDPRoutes (by Gateway)","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","namespace","parent_name"]}}},{"id":"organize","options":{"excludeByName":{"Value":false},"indexByName":{"Value":9,"customresource_kind":0,"customresource_version":1,"hostname":5,"listener_name":4,"name":2,"namespace":3,"port":6,"protocol":7,"tls_mode":8},"renameByName":{"Value":"# Attached Routes","customresource_kind":"Kind","customresource_version":"Version","hostname":"Hostname","listener_name":"Listener Name","name":"Name","namespace":"Namespace","parent_kind":"","parent_name":"Gateway","port":"Port","prometheus":"","protocol":"Protocol","tls_mode":"TLS Mode"}}}],"type":"table"}],"schemaVersion":36,"style":"dark","tags":["gateway-api","gateway-api-state"],"templating":{"list":[{"label":"Data Source","name":"datasource","query":"prometheus","type":"datasource"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"Gateway","multi":true,"name":"gateway","query":{"query":"label_values(gatewayapi_gateway_info, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"}]},"time":{"from":"now-1h","to":"now"},"timezone":"utc","title":"Gateway API State / Gateways","uid":"gatewayapigateways"} diff --git a/config/examples/kube-prometheus/bundle.yaml b/config/examples/kube-prometheus/bundle.yaml index b3c456d..d601485 100644 --- a/config/examples/kube-prometheus/bundle.yaml +++ b/config/examples/kube-prometheus/bundle.yaml @@ -1038,6 +1038,7 @@ data: protocol: ["protocol"] hostname: ["hostname"] tls_mode: ["tls","mode"] + allowed_routes_namespaces_from: ["allowedRoutes", "namespaces", "from"] - name: "status" help: "status condition" each: @@ -38672,6 +38673,7 @@ data: "port", "protocol", "tls_mode", + "allowed_routes_namespaces_from", "Value" ] } @@ -38685,6 +38687,7 @@ data: }, "indexByName": { "Value": 9, + "allowed_routes_namespaces_from": 10, "customresource_kind": 0, "customresource_version": 1, "hostname": 5, @@ -38697,6 +38700,7 @@ data: }, "renameByName": { "Value": "", + "allowed_routes_namespaces_from": "Allowed Routes NS", "customresource_kind": "Kind", "customresource_version": "Version", "hostname": "Hostname", @@ -39706,7 +39710,7 @@ data: } kind: ConfigMap metadata: - name: grafana-gateways-6465t79fc4 + name: grafana-gateways-dh56k7246b namespace: monitoring --- @@ -44585,7 +44589,7 @@ spec: name: grafana-gatewayclasses - configMap: defaultMode: 420 - name: grafana-gateways-6465t79fc4 + name: grafana-gateways-dh56k7246b name: grafana-gateways - configMap: defaultMode: 420 diff --git a/src/dashboards/gateways.jsonnet b/src/dashboards/gateways.jsonnet index a1d4924..f6712d6 100644 --- a/src/dashboards/gateways.jsonnet +++ b/src/dashboards/gateways.jsonnet @@ -89,6 +89,7 @@ gwapi.dashboard('Gateways', 'gatewayapigateways', [ 'port', 'protocol', 'tls_mode', + 'allowed_routes_namespaces_from', 'Value', ], }, @@ -109,6 +110,7 @@ gwapi.dashboard('Gateways', 'gatewayapigateways', [ port: 6, protocol: 7, tls_mode: 8, + allowed_routes_namespaces_from: 10 }, renameByName: { Value: '', @@ -122,6 +124,7 @@ gwapi.dashboard('Gateways', 'gatewayapigateways', [ prometheus: '', protocol: 'Protocol', tls_mode: 'TLS Mode', + allowed_routes_namespaces_from: 'Allowed Routes NS' }, }), ]),