From c99b40d4b97a448ebe7fe0678b566c49e399ab8c Mon Sep 17 00:00:00 2001 From: sami Date: Tue, 16 Sep 2025 11:35:52 +0600 Subject: [PATCH 1/7] Add 'platform-grafana-dashboards' as dependency of 'ace' chart. Signed-off-by: sami --- charts/ace/Chart.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/ace/Chart.yaml b/charts/ace/Chart.yaml index d0dc124d5..089139005 100644 --- a/charts/ace/Chart.yaml +++ b/charts/ace/Chart.yaml @@ -64,3 +64,7 @@ dependencies: repository: file://../platform-grafana-dashboards condition: platform-grafana-dashboards.enabled version: v2025.10.17 +- name: platform-grafana-dashboards + repository: file://../platform-grafana-dashboards + condition: platform-grafana-dashboards.enabled + version: v2025.10.17 From 9c0da0f96d1b7377425b096d0117c9d227857b15 Mon Sep 17 00:00:00 2001 From: sami Date: Thu, 30 Oct 2025 10:59:58 +0600 Subject: [PATCH 2/7] Add values.platform-grafana-dashboard.enabled Signed-off-by: sami --- charts/ace/README.md | 1 + charts/ace/values.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/charts/ace/README.md b/charts/ace/README.md index c467e779b..ceb8212dc 100644 --- a/charts/ace/README.md +++ b/charts/ace/README.md @@ -62,6 +62,7 @@ The following table lists the configurable parameters of the `ace` chart and the | openfga.datastoreURI | | "" | | pgoutbox.enabled | | false | | outbox-syncer.enabled | | false | +| platform-grafana-dashboards.enabled | | false | | global.nameOverride | | "ace" | | global.fullnameOverride | | "" | | global.platform.host | | appscode.ninja | diff --git a/charts/ace/values.yaml b/charts/ace/values.yaml index b1dfb7742..7d71271cf 100644 --- a/charts/ace/values.yaml +++ b/charts/ace/values.yaml @@ -88,6 +88,9 @@ pgoutbox: outbox-syncer: enabled: false +platform-grafana-dashboards: + enabled: false + # ------------- global: From 804aa1170a8fccbbd9d8358b821f8eb16a1c5c8e Mon Sep 17 00:00:00 2001 From: sami Date: Mon, 20 Oct 2025 14:08:56 +0600 Subject: [PATCH 3/7] Add OpenfgaDataStoreMetrics type to allow enabling datastore metrics Signed-off-by: sami --- apis/installer/v1alpha1/openfga_types.go | 29 +++++++++++-------- .../v1alpha1/zz_generated.deepcopy.go | 16 ++++++++++ charts/ace/values.openapiv3_schema.yaml | 8 +++++ 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/apis/installer/v1alpha1/openfga_types.go b/apis/installer/v1alpha1/openfga_types.go index 642fed17e..edf763937 100644 --- a/apis/installer/v1alpha1/openfga_types.go +++ b/apis/installer/v1alpha1/openfga_types.go @@ -175,18 +175,23 @@ type OpenfgaTrace struct { } type OpenfgaDatastore struct { - Engine string `json:"engine"` - Uri *string `json:"uri"` - UriSecret *string `json:"uriSecret"` - MaxCacheSize *string `json:"maxCacheSize"` - MaxOpenConns *string `json:"maxOpenConns"` - MaxIdleConns *string `json:"maxIdleConns"` - ConnMaxIdleTime *string `json:"connMaxIdleTime"` - ConnMaxLifetime *string `json:"connMaxLifetime"` - ApplyMigrations bool `json:"applyMigrations"` - WaitForMigrations bool `json:"waitForMigrations"` - MigrationType string `json:"migrationType"` - Migrations OpenfgaMigrations `json:"migrations"` + Engine string `json:"engine"` + Uri *string `json:"uri"` + UriSecret *string `json:"uriSecret"` + MaxCacheSize *string `json:"maxCacheSize"` + MaxOpenConns *string `json:"maxOpenConns"` + MaxIdleConns *string `json:"maxIdleConns"` + ConnMaxIdleTime *string `json:"connMaxIdleTime"` + ConnMaxLifetime *string `json:"connMaxLifetime"` + ApplyMigrations bool `json:"applyMigrations"` + WaitForMigrations bool `json:"waitForMigrations"` + MigrationType string `json:"migrationType"` + Metrics OpenfgaDatastoreMetrics `json:"metrics"` + Migrations OpenfgaMigrations `json:"migrations"` +} + +type OpenfgaDatastoreMetrics struct { + Enabled bool `json:"enabled"` } type OpenfgaMigrations struct { diff --git a/apis/installer/v1alpha1/zz_generated.deepcopy.go b/apis/installer/v1alpha1/zz_generated.deepcopy.go index 0410da623..9bfd2b82c 100644 --- a/apis/installer/v1alpha1/zz_generated.deepcopy.go +++ b/apis/installer/v1alpha1/zz_generated.deepcopy.go @@ -7531,6 +7531,7 @@ func (in *OpenfgaDatastore) DeepCopyInto(out *OpenfgaDatastore) { *out = new(string) **out = **in } + out.Metrics = in.Metrics in.Migrations.DeepCopyInto(&out.Migrations) } @@ -7544,6 +7545,21 @@ func (in *OpenfgaDatastore) DeepCopy() *OpenfgaDatastore { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenfgaDatastoreMetrics) DeepCopyInto(out *OpenfgaDatastoreMetrics) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenfgaDatastoreMetrics. +func (in *OpenfgaDatastoreMetrics) DeepCopy() *OpenfgaDatastoreMetrics { + if in == nil { + return nil + } + out := new(OpenfgaDatastoreMetrics) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpenfgaGrpc) DeepCopyInto(out *OpenfgaGrpc) { *out = *in diff --git a/charts/ace/values.openapiv3_schema.yaml b/charts/ace/values.openapiv3_schema.yaml index 67049f9bd..b318d8290 100644 --- a/charts/ace/values.openapiv3_schema.yaml +++ b/charts/ace/values.openapiv3_schema.yaml @@ -10774,6 +10774,13 @@ properties: type: string maxOpenConns: type: string + metrics: + properties: + enabled: + type: boolean + required: + - enabled + type: object migrationType: type: string migrations: @@ -10842,6 +10849,7 @@ properties: - maxCacheSize - maxIdleConns - maxOpenConns + - metrics - migrationType - migrations - uri From 6fb2a8619f42d2d82a548a907da96de9ad52a25a Mon Sep 17 00:00:00 2001 From: sami Date: Tue, 14 Oct 2025 12:02:00 +0600 Subject: [PATCH 4/7] Add OpenFGA Grafana dashboards Signed-off-by: sami --- charts/ace/Chart.lock | 7 +- charts/platform-grafana-dashboards/README.md | 4 +- .../dashboards/openfga/dashboard.json | 1346 +++++++++++++++++ .../data/resources.yaml | 3 + .../platform-grafana-dashboards/values.yaml | 1 + 5 files changed, 1357 insertions(+), 4 deletions(-) create mode 100644 charts/platform-grafana-dashboards/dashboards/openfga/dashboard.json diff --git a/charts/ace/Chart.lock b/charts/ace/Chart.lock index 18aa2b417..54d782a55 100644 --- a/charts/ace/Chart.lock +++ b/charts/ace/Chart.lock @@ -35,5 +35,8 @@ dependencies: - name: outbox-syncer repository: file://../outbox-syncer version: v2025.10.31 -digest: sha256:710a8f44dee2870601dfbdb39e763622bb8261c04d5c1870f79e24cf1c499f5d -generated: "2025-10-31T17:40:34.018692629Z" +- name: platform-grafana-dashboards + repository: file://../platform-grafana-dashboards + version: v2025.10.17 +digest: sha256:45929f046dd2f5c0bdeba06d48912bffb0e2454310756e279a56435d36e88c57 +generated: "2025-10-24T11:47:23.289959808+06:00" diff --git a/charts/platform-grafana-dashboards/README.md b/charts/platform-grafana-dashboards/README.md index 450ec6656..e6ac0eae4 100644 --- a/charts/platform-grafana-dashboards/README.md +++ b/charts/platform-grafana-dashboards/README.md @@ -49,7 +49,7 @@ The following table lists the configurable parameters of the `platform-grafana-d |---------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | nameOverride | Overrides name template | "" | | fullnameOverride | Overrides fullname template | "" | -| resources | List of Platform resources for which dashboards will be applied | ["nats"] | +| resources | List of Platform resources for which dashboards will be applied | ["nats","openfga"] | | dashboard.folderID | ID of Grafana folder where these dashboards will be applied | 0 | | dashboard.overwrite | If true, dashboard with matching uid will be overwritten | true | | dashboard.templatize.title | If true, datasource will be prefixed to dashboard name | false | @@ -82,7 +82,7 @@ The following table lists the configurable parameters of the `platform-grafana-d Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: ```bash -$ helm upgrade -i platform-grafana-dashboards appscode/platform-grafana-dashboards -n ace --create-namespace --version=v2025.10.17 --set resources=["nats"] +$ helm upgrade -i platform-grafana-dashboards appscode/platform-grafana-dashboards -n ace --create-namespace --version=v2025.10.17 --set resources=["nats","openfga"] ``` Alternatively, a YAML file that specifies the values for the parameters can be provided while diff --git a/charts/platform-grafana-dashboards/dashboards/openfga/dashboard.json b/charts/platform-grafana-dashboards/dashboards/openfga/dashboard.json new file mode 100644 index 000000000..072297cfd --- /dev/null +++ b/charts/platform-grafana-dashboards/dashboards/openfga/dashboard.json @@ -0,0 +1,1346 @@ +{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}} +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 19, + "panels": [], + "title": "Server Metrics", + "type": "row" + }, + { + "datasource": "${datasource}", + "description": "The 90th percentile request duration of an RPC, grouped by 'grpc_service' and 'grpc_method'.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 26, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "histogram_quantile(0.9, sum by(le, grpc_method, grpc_service) (rate(grpc_server_handling_seconds_bucket{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\", grpc_type=\"unary\", grpc_service=\"openfga.v1.OpenFGAService\"}[2m])))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": true, + "key": "Q-52ee0e33-980f-4a19-9821-39530de9f304-0", + "legendFormat": "{{`{{grpc_service}}/{{grpc_method}}`}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "p90 Request Duration by Method", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "description": "The 50th percentile request duration of an RPC, grouped by 'grpc_service' and 'grpc_method'.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 1 + }, + "id": 17, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "histogram_quantile(0.5, sum by(le, grpc_method, grpc_service) (rate(grpc_server_handling_seconds_bucket{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\", grpc_type=\"unary\", grpc_service=\"openfga.v1.OpenFGAService\"}[2m])))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": true, + "key": "Q-52ee0e33-980f-4a19-9821-39530de9f304-0", + "legendFormat": "{{`{{grpc_service}}/{{grpc_method}}`}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "p50 Request Duration by Method", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "description": "Percentage of hits to the in-memory Check API cache", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Check Cache Hit Ratio", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "dashed+area" + } + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "dark-red", + "value": 0 + }, + { + "color": "#EAB839", + "value": 30 + }, + { + "color": "green", + "value": 70 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 6, + "x": 18, + "y": 1 + }, + "id": 25, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "editorMode": "code", + "expr": "(sum(increase(openfga_check_cache_hit_count{namespace=\"$namespace\", pod=~\"$pod\", service=\"$service\"}[1m]))\n /\nsum(increase(openfga_check_cache_total_count{namespace=\"$namespace\", pod=~\"$pod\", service=\"$service\"}[1m])))* 100", + "hide": false, + "instant": false, + "legendFormat": "Check Cache hit ratio", + "range": true, + "refId": "A" + } + ], + "title": "Check Cache Hit Ratio", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 8 + }, + "id": 24, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "disableTextWrap": false, + "editorMode": "code", + "expr": "sum by(grpc_code, grpc_method) (rate(grpc_server_handled_total{namespace=\"$namespace\", pod=~\"$pod\", grpc_service=\"openfga.v1.OpenFGAService\"}[1m]))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Status Code Count per Method", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "description": "The number of requests per second (aggregated over a 1m interval) per method.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 23, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "editorMode": "code", + "expr": "sum(rate(grpc_server_started_total{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\",grpc_service=\"openfga.v1.OpenFGAService\"}[1m])) by (grpc_method)\n", + "legendFormat": "{{`openfga.v1.OpenFGAService/{{grpc_method}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "RPS per Method", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "description": "The 99th percentile request duration of an RPC, grouped by 'grpc_service' and 'grpc_method'.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 6, + "x": 12, + "y": 9 + }, + "id": 21, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "histogram_quantile(0.99, sum by(le, grpc_method, grpc_service) (rate(grpc_server_handling_seconds_bucket{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\", grpc_type=\"unary\", grpc_service=\"openfga.v1.OpenFGAService\"}[2m])))", + "instant": true, + "key": "Q-52ee0e33-980f-4a19-9821-39530de9f304-0", + "legendFormat": "{{`{{grpc_service}}/{{grpc_method}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "p99 Request Duration by Method", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 16 + }, + "id": 27, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "go_sql_open_connections{namespace=\"$namespace\", pod=~\"$pod\", service=\"$service\"}", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "SQL Open Connections", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": "${datasource}", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "go_sql_max_open_connections{namespace=\"$namespace\", pod=~\"$pod\", service=\"$service\"}", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "SQL Max Open Connections", + "range": true, + "refId": "B", + "useBackend": false + }, + { + "datasource": "${datasource}", + "disableTextWrap": false, + "editorMode": "builder", + "expr": "go_sql_in_use_connections{namespace=\"$namespace\", pod=~\"$pod\", service=\"$service\"}", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "SQL In Use Connections", + "range": true, + "refId": "C", + "useBackend": false + } + ], + "title": "SQL metrics", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 4, + "panels": [], + "title": "Go Runtime Metrics", + "type": "row" + }, + { + "datasource": "${datasource}", + "description": "The number of goroutines reported by the Go runtime.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 25 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "go_goroutines{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\"}", + "legendFormat": "Goroutines (Count)", + "range": true, + "refId": "A" + }, + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "irate(go_goroutines{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\"}[2m])", + "hide": false, + "legendFormat": "Goroutine (Derivative)", + "range": true, + "refId": "B" + } + ], + "title": "Goroutines", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 25 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "go_gc_duration_seconds{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\", quantile=\"0.5\"}", + "legendFormat": "p50", + "range": true, + "refId": "A" + }, + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "go_gc_duration_seconds{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\", quantile=\"0.75\"}", + "hide": false, + "legendFormat": "p75", + "range": true, + "refId": "B" + }, + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "go_gc_duration_seconds{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\", quantile=\"1\"}", + "hide": false, + "legendFormat": "p100", + "range": true, + "refId": "C" + } + ], + "title": "Go GC Duration", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 25 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "go_memstats_heap_alloc_bytes{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\"}", + "legendFormat": "{{`{{label_name}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Heap Memory Usage", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "description": "The number of heap allocations (mallocs) as a rate (malloc/sec).", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "displayName": "malloc/sec", + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 33 + }, + "id": 16, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "rate(go_memstats_mallocs_total{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\"}[2m])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Memory Allocation Rate (malloc/sec)", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "description": "Shows the number of heap allocations (as a byte/sec rate).", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 33 + }, + "id": 14, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": "${datasource}", + "editorMode": "builder", + "expr": "rate(go_memstats_alloc_bytes_total{namespace=\"$namespace\", pod=~\"$pod\", job=\"openfga\"}[2m])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Heap Allocation Rate (bytes/sec)", + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": "\".+\"", + "current": { + "selected": false, + "text": "demo", + "value": "demo" + }, + "datasource": "${datasource}", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": "Namespace", + "multi": false, + "name": "namespace", + "options": [], + {{- if $shared }} + "query": "label_values(kube_namespace_created,namespace)", + "type": "query", + {{- else }} + "query": {{ $.Values.app.namespace | quote }}, + "type": "constant", + {{- end }} + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "ace-openfga", + "value": "ace-openfga" + }, + "datasource": "${datasource}", + "definition": "label_values(go_goroutines{namespace=~\"$namespace\",job=\"openfga\"},service)", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": "Service", + "multi": false, + "name": "service", + "options": [], + "query": "label_values(go_goroutines{namespace=~\"$namespace\",job=\"openfga\"},service)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "openfga-0", + "value": "openfga-0" + }, + "datasource": "${datasource}", + "definition": "label_values(grpc_server_handled_total{namespace=~\"$namespace\",grpc_service=\"openfga.v1.OpenFGAService\"},pod)", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "Pod", + "multi": true, + "name": "pod", + "options": [], + "query": "label_values(grpc_server_handled_total{namespace=~\"$namespace\",grpc_service=\"openfga.v1.OpenFGAService\"},pod)", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "OpenFGA Dashboard", + "uid": "6s3pLp04z", + "version": 2, + "weekStart": "" +} diff --git a/charts/platform-grafana-dashboards/data/resources.yaml b/charts/platform-grafana-dashboards/data/resources.yaml index 41aa4bcd4..f3f1d7339 100644 --- a/charts/platform-grafana-dashboards/data/resources.yaml +++ b/charts/platform-grafana-dashboards/data/resources.yaml @@ -1,3 +1,6 @@ nats: kind: NATS resource: natsclusters +openfga: + kind: OpenFGA + resource: openfga diff --git a/charts/platform-grafana-dashboards/values.yaml b/charts/platform-grafana-dashboards/values.yaml index c501bc413..35e2d5307 100644 --- a/charts/platform-grafana-dashboards/values.yaml +++ b/charts/platform-grafana-dashboards/values.yaml @@ -10,6 +10,7 @@ fullnameOverride: "" # List of Platform resources for which dashboards will be applied resources: # +doc-gen:break - nats + - openfga dashboard: # ID of Grafana folder where these dashboards will be applied From af798c64598a52ba95c0092c0baa62a1ee9895ca Mon Sep 17 00:00:00 2001 From: sami Date: Fri, 24 Oct 2025 17:04:10 +0600 Subject: [PATCH 5/7] Add "openfga" and "authorization" tags to the openfga dashboard Signed-off-by: sami --- .../dashboards/nats/jetstream_dashboard.json | 4 ++-- .../dashboards/nats/nats_dashboard.json | 4 ++-- .../dashboards/openfga/dashboard.json | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/charts/platform-grafana-dashboards/dashboards/nats/jetstream_dashboard.json b/charts/platform-grafana-dashboards/dashboards/nats/jetstream_dashboard.json index 1e4b69d81..a661b8cb4 100644 --- a/charts/platform-grafana-dashboards/dashboards/nats/jetstream_dashboard.json +++ b/charts/platform-grafana-dashboards/dashboards/nats/jetstream_dashboard.json @@ -1133,8 +1133,8 @@ "allValue": "\".+\"", "current": { "selected": false, - "text": "demo", - "value": "demo" + "text": "{{ .Release.Namespace }}", + "value": "{{ .Release.Namespace }}" }, "datasource": "${datasource}", "description": null, diff --git a/charts/platform-grafana-dashboards/dashboards/nats/nats_dashboard.json b/charts/platform-grafana-dashboards/dashboards/nats/nats_dashboard.json index 3a775404c..12155535f 100644 --- a/charts/platform-grafana-dashboards/dashboards/nats/nats_dashboard.json +++ b/charts/platform-grafana-dashboards/dashboards/nats/nats_dashboard.json @@ -928,8 +928,8 @@ "allValue": "\".+\"", "current": { "selected": false, - "text": "demo", - "value": "demo" + "text": "{{ .Release.Namespace }}", + "value": "{{ .Release.Namespace }}" }, "datasource": "${datasource}", "description": null, diff --git a/charts/platform-grafana-dashboards/dashboards/openfga/dashboard.json b/charts/platform-grafana-dashboards/dashboards/openfga/dashboard.json index 072297cfd..e2acbf620 100644 --- a/charts/platform-grafana-dashboards/dashboards/openfga/dashboard.json +++ b/charts/platform-grafana-dashboards/dashboards/openfga/dashboard.json @@ -1218,7 +1218,10 @@ ], "refresh": "5s", "schemaVersion": 39, - "tags": [], + "tags": [ + "openfga", + "authorization" + ], "templating": { "list": [ { @@ -1246,8 +1249,8 @@ "allValue": "\".+\"", "current": { "selected": false, - "text": "demo", - "value": "demo" + "text": "{{ .Release.Namespace }}", + "value": "{{ .Release.Namespace }}" }, "datasource": "${datasource}", "description": null, From 6ec4a50650c8827218ef36af607236bb2a23a5c1 Mon Sep 17 00:00:00 2001 From: sami Date: Mon, 27 Oct 2025 14:33:18 +0600 Subject: [PATCH 6/7] hack to make the 'TestDefaultValues/Openfga' test pass Signed-off-by: sami --- apis/installer/v1alpha1/openfga_types.go | 26 +++++++++---------- .../v1alpha1/zz_generated.deepcopy.go | 6 ++++- charts/ace/values.openapiv3_schema.yaml | 1 - 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/apis/installer/v1alpha1/openfga_types.go b/apis/installer/v1alpha1/openfga_types.go index edf763937..fcd99862f 100644 --- a/apis/installer/v1alpha1/openfga_types.go +++ b/apis/installer/v1alpha1/openfga_types.go @@ -175,19 +175,19 @@ type OpenfgaTrace struct { } type OpenfgaDatastore struct { - Engine string `json:"engine"` - Uri *string `json:"uri"` - UriSecret *string `json:"uriSecret"` - MaxCacheSize *string `json:"maxCacheSize"` - MaxOpenConns *string `json:"maxOpenConns"` - MaxIdleConns *string `json:"maxIdleConns"` - ConnMaxIdleTime *string `json:"connMaxIdleTime"` - ConnMaxLifetime *string `json:"connMaxLifetime"` - ApplyMigrations bool `json:"applyMigrations"` - WaitForMigrations bool `json:"waitForMigrations"` - MigrationType string `json:"migrationType"` - Metrics OpenfgaDatastoreMetrics `json:"metrics"` - Migrations OpenfgaMigrations `json:"migrations"` + Engine string `json:"engine"` + Uri *string `json:"uri"` + UriSecret *string `json:"uriSecret"` + MaxCacheSize *string `json:"maxCacheSize"` + MaxOpenConns *string `json:"maxOpenConns"` + MaxIdleConns *string `json:"maxIdleConns"` + ConnMaxIdleTime *string `json:"connMaxIdleTime"` + ConnMaxLifetime *string `json:"connMaxLifetime"` + ApplyMigrations bool `json:"applyMigrations"` + WaitForMigrations bool `json:"waitForMigrations"` + MigrationType string `json:"migrationType"` + Metrics *OpenfgaDatastoreMetrics `json:"metrics,omitempty"` + Migrations OpenfgaMigrations `json:"migrations"` } type OpenfgaDatastoreMetrics struct { diff --git a/apis/installer/v1alpha1/zz_generated.deepcopy.go b/apis/installer/v1alpha1/zz_generated.deepcopy.go index 9bfd2b82c..23f1ecaad 100644 --- a/apis/installer/v1alpha1/zz_generated.deepcopy.go +++ b/apis/installer/v1alpha1/zz_generated.deepcopy.go @@ -7531,7 +7531,11 @@ func (in *OpenfgaDatastore) DeepCopyInto(out *OpenfgaDatastore) { *out = new(string) **out = **in } - out.Metrics = in.Metrics + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = new(OpenfgaDatastoreMetrics) + **out = **in + } in.Migrations.DeepCopyInto(&out.Migrations) } diff --git a/charts/ace/values.openapiv3_schema.yaml b/charts/ace/values.openapiv3_schema.yaml index b318d8290..46175b2af 100644 --- a/charts/ace/values.openapiv3_schema.yaml +++ b/charts/ace/values.openapiv3_schema.yaml @@ -10849,7 +10849,6 @@ properties: - maxCacheSize - maxIdleConns - maxOpenConns - - metrics - migrationType - migrations - uri From 435dacec680603b500fa1311dba6fb7b3bd3cf40 Mon Sep 17 00:00:00 2001 From: sami Date: Thu, 30 Oct 2025 11:25:00 +0600 Subject: [PATCH 7/7] Temporarily remove the platform-grafana-dashboards.enabled flag Signed-off-by: sami --- charts/ace/README.md | 1 - charts/ace/values.yaml | 3 --- 2 files changed, 4 deletions(-) diff --git a/charts/ace/README.md b/charts/ace/README.md index ceb8212dc..c467e779b 100644 --- a/charts/ace/README.md +++ b/charts/ace/README.md @@ -62,7 +62,6 @@ The following table lists the configurable parameters of the `ace` chart and the | openfga.datastoreURI | | "" | | pgoutbox.enabled | | false | | outbox-syncer.enabled | | false | -| platform-grafana-dashboards.enabled | | false | | global.nameOverride | | "ace" | | global.fullnameOverride | | "" | | global.platform.host | | appscode.ninja | diff --git a/charts/ace/values.yaml b/charts/ace/values.yaml index 7d71271cf..b1dfb7742 100644 --- a/charts/ace/values.yaml +++ b/charts/ace/values.yaml @@ -88,9 +88,6 @@ pgoutbox: outbox-syncer: enabled: false -platform-grafana-dashboards: - enabled: false - # ------------- global: