From 8166704922062cd53b33c8cb8c58454a700efc2a Mon Sep 17 00:00:00 2001 From: Vicente Ferrara <47219931+vicentefb@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:59:17 -0800 Subject: [PATCH] Removed reflector metric usage (#4056) * removed reflector metric usage * remove dashboard * removed doc references * reverted vendor code changes --- build/grafana/dashboard-goclient-caches.yaml | 574 ------------------- pkg/metrics/kubernetes_client.go | 1 - site/content/en/docs/Guides/metrics.md | 7 - 3 files changed, 582 deletions(-) delete mode 100644 build/grafana/dashboard-goclient-caches.yaml diff --git a/build/grafana/dashboard-goclient-caches.yaml b/build/grafana/dashboard-goclient-caches.yaml deleted file mode 100644 index 0f668610d5..0000000000 --- a/build/grafana/dashboard-goclient-caches.yaml +++ /dev/null @@ -1,574 +0,0 @@ ---- -# Copyright 2019 Google LLC All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# configs map used by grafana -apiVersion: v1 -kind: ConfigMap -metadata: - name: agones-goclient-caches - namespace: metrics - labels: - grafana_dashboard: '1' -data: - dashboard-agones-goclient-caches.json: |- - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 7, - "links": [], - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 9, - "w": 4, - "x": 0, - "y": 0 - }, - "id": 4, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "$$hashKey": "object:5575", - "name": "value to text", - "value": 1 - }, - { - "$$hashKey": "object:5576", - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "$$hashKey": "object:5432", - "expr": "agones_k8s_client_cache_last_resource_version", - "format": "time_series", - "instant": true, - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Last resource version", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "$$hashKey": "object:5578", - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "gridPos": { - "h": 9, - "w": 10, - "x": 4, - "y": 0 - }, - "id": 8, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "$$hashKey": "object:6208", - "expr": "sum(rate(agones_k8s_client_cache_list_items_sum[5m]) / rate(agones_k8s_client_cache_list_items_count[5m]))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "list items", - "refId": "A" - }, - { - "$$hashKey": "object:6270", - "expr": "sum(rate(agones_k8s_client_cache_watch_events_sum[5m]) / rate(agones_k8s_client_cache_watch_events_count[5m]))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "watch events", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Cache items rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:6309", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:6310", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "gridPos": { - "h": 9, - "w": 10, - "x": 14, - "y": 0 - }, - "id": 9, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "$$hashKey": "object:6208", - "expr": "sum(agones_k8s_client_cache_list_items_sum / agones_k8s_client_cache_list_items_count)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "list items", - "refId": "A" - }, - { - "$$hashKey": "object:6270", - "expr": "sum(agones_k8s_client_cache_watch_events_sum / agones_k8s_client_cache_watch_events_count)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "watch events", - "refId": "B" - }, - { - "$$hashKey": "object:6551", - "expr": "", - "format": "time_series", - "intervalFactor": 1, - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Cache avg items per operations", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:6309", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:6310", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "gridPos": { - "h": 9, - "w": 14, - "x": 0, - "y": 9 - }, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "$$hashKey": "object:5637", - "expr": "sum(rate(agones_k8s_client_cache_list_duration_seconds_sum[5m]) / rate(agones_k8s_client_cache_list_duration_seconds_count[5m]))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "list", - "refId": "A" - }, - { - "$$hashKey": "object:5785", - "expr": "sum(rate(agones_k8s_client_cache_watch_duration_seconds_sum[5m]) / rate(agones_k8s_client_cache_watch_duration_seconds_count[5m]))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "watch", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Avg List/Watch requests duration", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:5813", - "format": "s", - "label": null, - "logBase": 10, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:5814", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "gridPos": { - "h": 9, - "w": 10, - "x": 14, - "y": 9 - }, - "id": 2, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(agones_k8s_client_cache_list_total[1m]))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "list", - "refId": "A" - }, - { - "expr": "sum(rate(agones_k8s_client_cache_watches_total[1m]))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "watch", - "refId": "B" - }, - { - "expr": "sum(rate(agones_k8s_client_cache_short_watches_total[1m]))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "short watch", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Caches operations rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ops", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "10s", - "schemaVersion": 16, - "style": "dark", - "tags": [ - "controller", - "agones", - "client-go" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "Agones Controller go-client caches", - "uid": "IcQY6i_iz", - "version": 6 - } diff --git a/pkg/metrics/kubernetes_client.go b/pkg/metrics/kubernetes_client.go index 4a5591dd1c..149f8fed6f 100644 --- a/pkg/metrics/kubernetes_client.go +++ b/pkg/metrics/kubernetes_client.go @@ -196,7 +196,6 @@ func (c *clientGoMetricAdapter) Register() { RequestLatency: c, RequestResult: c, }) - cache.SetReflectorMetricsProvider(c) workqueue.SetProvider(c) } diff --git a/site/content/en/docs/Guides/metrics.md b/site/content/en/docs/Guides/metrics.md index 3fcd799730..feadda52c8 100644 --- a/site/content/en/docs/Guides/metrics.md +++ b/site/content/en/docs/Guides/metrics.md @@ -68,11 +68,6 @@ Follow the [Google Cloud Monitoring installation steps](#google-cloud-monitoring | agones_gameserver_state_duration | The distribution of gameserver state duration in seconds. Note: this metric could have some missing samples by design. Do not use the `_total` counter as the real value for state changes. | histogram | | agones_k8s_client_http_request_total | The total of HTTP requests to the Kubernetes API by status code | counter | | agones_k8s_client_http_request_duration_seconds | The distribution of HTTP requests latencies to the Kubernetes API by status code | histogram | -| agones_k8s_client_cache_list_total | The total number of list operations for client-go caches | counter | -| agones_k8s_client_cache_list_duration_seconds | Duration of a Kubernetes list API call in seconds | histogram | -| agones_k8s_client_cache_list_items | Count of items in a list from the Kubernetes API | histogram | -| agones_k8s_client_cache_watches_total | The total number of watch operations for client-go caches | counter | -| agones_k8s_client_cache_last_resource_version | Last resource version from the Kubernetes API | gauge | | agones_k8s_client_workqueue_depth | Current depth of the work queue | gauge | | agones_k8s_client_workqueue_latency_seconds | How long an item stays in the work queue | histogram | | agones_k8s_client_workqueue_items_total | Total number of items added to the work queue | counter | @@ -110,8 +105,6 @@ We provide a set of useful [Grafana](https://grafana.com/) dashboards to monitor - {{< ghlink href="/build/grafana/dashboard-goclient-requests.yaml" branch="main" >}}Agones Controller go-client requests{{< /ghlink >}} displays Agones Controller Kubernetes API consumption. -- {{< ghlink href="/build/grafana/dashboard-goclient-caches.yaml" branch="main" >}}Agones Controller go-client caches{{< /ghlink >}} displays Agones Controller Kubernetes Watches/Lists operations used. - - {{< ghlink href="/build/grafana/dashboard-goclient-workqueues.yaml" branch="main" >}}Agones Controller go-client workqueues{{< /ghlink >}} displays Agones Controller workqueue processing time and rates. - {{< ghlink href="/build/grafana/dashboard-apiserver-requests.yaml" branch="main" >}}Agones Controller API Server requests{{< /ghlink >}} displays your current API server request rate, errors rate and request latencies with optional CustomResourceDefinition filtering by Types: fleets, gameserversets, gameservers, gameserverallocations.