apiVersion: v1 kind: ConfigMap metadata: name: grafana-dashboard-fission namespace: grafana data: fission-overview.json: | { "title": "Fission — Operator Overview", "uid": "fission-overview", "tags": ["fission"], "timezone": "browser", "refresh": "30s", "time": { "from": "now-24h", "to": "now" }, "templating": { "list": [ { "name": "namespace", "type": "query", "datasource": { "type": "postgres", "uid": "fission-pg" }, "query": "SELECT DISTINCT namespace FROM invocations ORDER BY 1", "includeAll": true, "multi": true, "label": "Namespace", "current": { "text": "All", "value": "$__all" } } ] }, "panels": [ { "id": 1, "title": "Вызовы в час", "type": "timeseries", "gridPos": { "x": 0, "y": 0, "w": 16, "h": 8 }, "datasource": { "type": "postgres", "uid": "fission-pg" }, "targets": [ { "rawSql": "SELECT date_trunc('hour', started_at) AS time, count(*) AS value, namespace FROM invocations WHERE started_at BETWEEN $__timeFrom() AND $__timeTo() AND ('$namespace' = '$__all' OR namespace = ANY(string_to_array('$namespace', ','))) GROUP BY 1, namespace ORDER BY 1", "format": "time_series", "refId": "A" } ] }, { "id": 2, "title": "Успех vs Ошибки", "type": "piechart", "gridPos": { "x": 16, "y": 0, "w": 8, "h": 8 }, "datasource": { "type": "postgres", "uid": "fission-pg" }, "targets": [ { "rawSql": "SELECT CASE WHEN status_code >= 200 AND status_code < 300 THEN 'success' ELSE 'error' END AS metric, count(*) AS value FROM invocations WHERE started_at BETWEEN $__timeFrom() AND $__timeTo() AND ('$namespace' = '$__all' OR namespace = ANY(string_to_array('$namespace', ','))) GROUP BY 1", "format": "table", "refId": "A" } ] }, { "id": 3, "title": "Топ функций по вызовам", "type": "bargauge", "gridPos": { "x": 0, "y": 8, "w": 12, "h": 8 }, "datasource": { "type": "postgres", "uid": "fission-pg" }, "targets": [ { "rawSql": "SELECT function_name AS metric, count(*) AS value FROM invocations WHERE started_at BETWEEN $__timeFrom() AND $__timeTo() AND ('$namespace' = '$__all' OR namespace = ANY(string_to_array('$namespace', ','))) GROUP BY 1 ORDER BY 2 DESC LIMIT 10", "format": "table", "refId": "A" } ] }, { "id": 4, "title": "Средняя латентность (ms)", "type": "timeseries", "gridPos": { "x": 12, "y": 8, "w": 12, "h": 8 }, "datasource": { "type": "postgres", "uid": "fission-pg" }, "targets": [ { "rawSql": "SELECT date_trunc('hour', started_at) AS time, round(avg(duration_ms)) AS avg_ms, round(percentile_cont(0.95) WITHIN GROUP (ORDER BY duration_ms)) AS p95_ms FROM invocations WHERE started_at BETWEEN $__timeFrom() AND $__timeTo() AND ('$namespace' = '$__all' OR namespace = ANY(string_to_array('$namespace', ','))) GROUP BY 1 ORDER BY 1", "format": "time_series", "refId": "A" } ] }, { "id": 5, "title": "Последние вызовы", "type": "table", "gridPos": { "x": 0, "y": 16, "w": 24, "h": 8 }, "datasource": { "type": "postgres", "uid": "fission-pg" }, "targets": [ { "rawSql": "SELECT started_at AS time, namespace, function_name, trigger_type, event_type, status_code, duration_ms FROM invocations WHERE ('$namespace' = '$__all' OR namespace = ANY(string_to_array('$namespace', ','))) ORDER BY started_at DESC LIMIT 50", "format": "table", "refId": "A" } ] } ], "schemaVersion": 38 }