feat: pipelines Metabase — add ops db, create ops dashboard, fix permissions
Tres pipelines Python para gestionar operations.db en Metabase: - metabase_add_ops_db: registra la operations.db de una app como database SQLite - metabase_create_ops_dashboard: genera dashboard operativo con 14 cards (KPIs, distribución, executions, assertions) para cualquier app - metabase_fix_permissions: arregla SQLITE_READONLY_DIRECTORY haciendo chmod 777/666 sin chown (que se propaga al host via bind mount) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
---
|
||||
name: metabase_create_ops_dashboard
|
||||
kind: pipeline
|
||||
lang: py
|
||||
domain: pipelines
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "metabase_create_ops_dashboard(app_name: str) -> None"
|
||||
description: "Crea dashboard operativo en Metabase para una app: KPIs de entities/relations/executions/assertions, distribucion por status y tipo, relaciones frecuentes, resultados de ejecuciones y assertions."
|
||||
tags: [metabase, operations, dashboard, pipeline, infra, launcher]
|
||||
uses_functions:
|
||||
- metabase_auth_py_infra
|
||||
- metabase_list_databases_py_infra
|
||||
- metabase_create_card_py_infra
|
||||
- metabase_create_dashboard_py_infra
|
||||
- metabase_update_dashboard_py_infra
|
||||
- metabase_list_dashboards_py_infra
|
||||
- metabase_delete_dashboard_py_infra
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: []
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "python/functions/pipelines/metabase_create_ops_dashboard.py"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```bash
|
||||
# Dashboard para una app
|
||||
python python/functions/pipelines/metabase_create_ops_dashboard.py docker_tui
|
||||
|
||||
# Dashboards para todas las apps registradas
|
||||
python python/functions/pipelines/metabase_create_ops_dashboard.py --all
|
||||
```
|
||||
|
||||
## Cards del dashboard
|
||||
|
||||
| Fila | Cards | Tipo |
|
||||
|------|-------|------|
|
||||
| 0 | Entities, Relations, Executions, Assertions | scalar (KPIs) |
|
||||
| 5 | Entities por Status, Entities por Tipo, Relations por Status | pie/bar |
|
||||
| 13 | Executions Success/Failure, Assertions por Severity, Assertion Results | pie/bar |
|
||||
| 22 | Top Relaciones (via), Executions Recientes | row/table |
|
||||
| 30 | Lista de Entities | table |
|
||||
| 38 | Assertion Results Detalle | table |
|
||||
|
||||
## Flujo
|
||||
|
||||
1. `metabase_auth` - autentica contra Metabase
|
||||
2. `metabase_list_databases` - busca la database operacional de la app
|
||||
3. `metabase_create_card` x 14 - crea las cards con queries SQL nativas
|
||||
4. `metabase_create_dashboard` - crea el dashboard
|
||||
5. `metabase_update_dashboard` - posiciona las cards en el grid
|
||||
|
||||
## Requisitos
|
||||
|
||||
La database operacional debe estar registrada previamente con `metabase_add_ops_db`.
|
||||
|
||||
Las tablas `executions`, `assertions` y `assertion_results` requieren la migracion 002. Si no existen, las cards correspondientes mostraran error (no rompen el dashboard).
|
||||
|
||||
## Convencion
|
||||
|
||||
- Dashboard name: `ops: <app-name>`
|
||||
- Si el dashboard ya existe, se elimina y recrea.
|
||||
Reference in New Issue
Block a user