Skip to content

Commit

Permalink
Links back to target kind
Browse files Browse the repository at this point in the history
  • Loading branch information
Ygnas committed Oct 24, 2023
1 parent 195aa00 commit 964d15e
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 24 deletions.
89 changes: 82 additions & 7 deletions config/examples/dashboards/policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"type": "prometheus",
"uid": "$datasource"
},
"expr": "count(gatewayapi_tlspolicy_status)",
"expr": "count(gatewayapi_tlspolicy_status{name=~\"${tlspolicy}\"})",
"instant": true
}
],
Expand All @@ -72,7 +72,7 @@
"type": "prometheus",
"uid": "$datasource"
},
"expr": "count(gatewayapi_tlspolicy_status{type=\"Ready\"})",
"expr": "count(gatewayapi_tlspolicy_status{type=\"Ready\", name=~\"${tlspolicy}\"})",
"instant": true
}
],
Expand All @@ -84,6 +84,31 @@
"type": "prometheus",
"uid": "$datasource"
},
"fieldConfig": {
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Target Kind"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-text"
},
{
"id": "links",
"value": [
{
"title": "TLSPolicy Details",
"url": "/d/gatewayapigateways/gateway-api-state-gateways?var-tlspolicy=${__value.text}"
}
]
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 10,
Expand All @@ -98,7 +123,7 @@
"type": "prometheus",
"uid": "$datasource"
},
"expr": "gatewayapi_tlspolicy_target_info",
"expr": "gatewayapi_tlspolicy_target_info{name=~\"${tlspolicy}\"}",
"format": "table",
"instant": true,
"range": false
Expand Down Expand Up @@ -162,7 +187,7 @@
"type": "prometheus",
"uid": "$datasource"
},
"expr": "count(gatewayapi_ratelimitpolicy_status)",
"expr": "count(gatewayapi_ratelimitpolicy_status{name=~\"${ratelimitpolicy}\"})",
"instant": true
}
],
Expand All @@ -189,7 +214,7 @@
"type": "prometheus",
"uid": "$datasource"
},
"expr": "count(gatewayapi_ratelimitpolicy_status{type=\"Available\"})",
"expr": "count(gatewayapi_ratelimitpolicy_status{type=\"Available\", name=~\"${ratelimitpolicy}\"})",
"instant": true
}
],
Expand All @@ -201,6 +226,31 @@
"type": "prometheus",
"uid": "$datasource"
},
"fieldConfig": {
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Target Kind"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-text"
},
{
"id": "links",
"value": [
{
"title": "RateLimitPolicy Details",
"url": "/d/gatewayapihttproutes/gateway-api-state-httproutes?var-ratelimitpolicy=${__value.text}"
}
]
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 10,
Expand All @@ -215,7 +265,7 @@
"type": "prometheus",
"uid": "$datasource"
},
"expr": "gatewayapi_ratelimitpolicy_target_info",
"expr": "gatewayapi_ratelimitpolicy_target_info{name=~\"${ratelimitpolicy}\"}",
"format": "table",
"instant": true,
"range": false
Expand Down Expand Up @@ -264,6 +314,31 @@
"type": "prometheus",
"uid": "$datasource"
},
"fieldConfig": {
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Target Kind"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-text"
},
{
"id": "links",
"value": [
{
"title": "BackendTLSPolicy Details",
"url": "/d/gatewayapipolicies/gateway-api-state-policies?var-backendtlspolicy=${__value.text}"
}
]
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 10,
Expand All @@ -278,7 +353,7 @@
"type": "prometheus",
"uid": "$datasource"
},
"expr": "gatewayapi_backendtlspolicy_target_info",
"expr": "gatewayapi_backendtlspolicy_target_info{name=~\"${backendtlspolicy}\"}",
"format": "table",
"instant": true,
"range": false
Expand Down
2 changes: 1 addition & 1 deletion config/examples/dashboards/policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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":"TLSPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of TLSPolicy across all clusters","gridPos":{"h":3,"w":2,"x":0,"y":1},"id":2,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_tlspolicy_status)","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total TLSPolicy with an Ready 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_tlspolicy_status{type=\"Ready\"})","instant":true}],"title":"Ready","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":1},"id":4,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_tlspolicy_target_info","format":"table","instant":true,"range":false}],"title":"TLSPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"},{"gridPos":{"h":1,"w":24,"x":0,"y":2},"id":5,"title":"RateLimitPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of RateLimitPolicy across all clusters","gridPos":{"h":3,"w":2,"x":0,"y":3},"id":6,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_ratelimitpolicy_status)","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total RateLimitPolicy with an Available state","gridPos":{"h":3,"w":2,"x":2,"y":3},"id":7,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_ratelimitpolicy_status{type=\"Available\"})","instant":true}],"title":"Available","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":7},"id":8,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_ratelimitpolicy_target_info","format":"table","instant":true,"range":false}],"title":"RateLimitPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"},{"gridPos":{"h":1,"w":24,"x":0,"y":8},"id":9,"title":"BackendTLSPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":9},"id":10,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_backendtlspolicy_target_info","format":"table","instant":true,"range":false}],"title":"BackendTLSPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"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":"TLSPolicy","multi":true,"name":"tlspolicy","query":{"query":"label_values(gatewayapi_tlspolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"RateLimitPolicy","multi":true,"name":"ratelimitpolicy","query":{"query":"label_values(gatewayapi_ratelimitpolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"BackendTLSPolicy","multi":true,"name":"backendtlspolicy","query":{"query":"label_values(gatewayapi_backendtlspolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"}]},"time":{"from":"now-1h","to":"now"},"timezone":"utc","title":"Gateway API State / Policies","uid":"gatewayapipolicies"}
{"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":"TLSPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of TLSPolicy across all clusters","gridPos":{"h":3,"w":2,"x":0,"y":1},"id":2,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_tlspolicy_status{name=~\"${tlspolicy}\"})","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total TLSPolicy with an Ready 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_tlspolicy_status{type=\"Ready\", name=~\"${tlspolicy}\"})","instant":true}],"title":"Ready","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Target Kind"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"TLSPolicy Details","url":"/d/gatewayapigateways/gateway-api-state-gateways?var-tlspolicy=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":1},"id":4,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_tlspolicy_target_info{name=~\"${tlspolicy}\"}","format":"table","instant":true,"range":false}],"title":"TLSPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"},{"gridPos":{"h":1,"w":24,"x":0,"y":2},"id":5,"title":"RateLimitPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of RateLimitPolicy across all clusters","gridPos":{"h":3,"w":2,"x":0,"y":3},"id":6,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_ratelimitpolicy_status{name=~\"${ratelimitpolicy}\"})","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total RateLimitPolicy with an Available state","gridPos":{"h":3,"w":2,"x":2,"y":3},"id":7,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_ratelimitpolicy_status{type=\"Available\", name=~\"${ratelimitpolicy}\"})","instant":true}],"title":"Available","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Target Kind"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"RateLimitPolicy Details","url":"/d/gatewayapihttproutes/gateway-api-state-httproutes?var-ratelimitpolicy=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":7},"id":8,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_ratelimitpolicy_target_info{name=~\"${ratelimitpolicy}\"}","format":"table","instant":true,"range":false}],"title":"RateLimitPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"},{"gridPos":{"h":1,"w":24,"x":0,"y":8},"id":9,"title":"BackendTLSPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"fieldConfig":{"overrides":[{"matcher":{"id":"byName","options":"Target Kind"},"properties":[{"id":"custom.displayMode","value":"color-text"},{"id":"links","value":[{"title":"BackendTLSPolicy Details","url":"/d/gatewayapipolicies/gateway-api-state-policies?var-backendtlspolicy=${__value.text}"}]}]}]},"gridPos":{"h":6,"w":10,"x":4,"y":9},"id":10,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_backendtlspolicy_target_info{name=~\"${backendtlspolicy}\"}","format":"table","instant":true,"range":false}],"title":"BackendTLSPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"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":"TLSPolicy","multi":true,"name":"tlspolicy","query":{"query":"label_values(gatewayapi_tlspolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"RateLimitPolicy","multi":true,"name":"ratelimitpolicy","query":{"query":"label_values(gatewayapi_ratelimitpolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"BackendTLSPolicy","multi":true,"name":"backendtlspolicy","query":{"query":"label_values(gatewayapi_backendtlspolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"}]},"time":{"from":"now-1h","to":"now"},"timezone":"utc","title":"Gateway API State / Policies","uid":"gatewayapipolicies"}
Loading

0 comments on commit 964d15e

Please sign in to comment.