wu-sheng commented on code in PR #42:
URL: 
https://github.com/apache/skywalking-horizon-ui/pull/42#discussion_r3360771720


##########
apps/bff/src/bundled_templates/layers/airflow.json:
##########
@@ -0,0 +1,273 @@
+{
+  "key": "AIRFLOW",
+  "alias": "Airflow",
+  "group": "Workflow Scheduler",
+  "color": "var(--sw-cyan)",
+  "documentLink": 
"https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-airflow-monitoring/";,
+  "aliases": {
+    "services": "Airflow clusters",
+    "instances": "Components"
+  },
+  "components": {
+    "service": true,
+    "instances": true,
+    "endpoints": false,
+    "topology": false,
+    "traces": false,
+    "logs": false
+  },
+  "overview": {
+    "groups": [
+      {
+        "title": "Cluster",
+        "size": "auto",
+        "metrics": [
+          {
+            "id": "tasksExecutable",
+            "label": "Tasks Executable",
+            "tip": "Tasks ready for execution across the cluster.",
+            "mqe": "latest(meter_airflow_scheduler_tasks_executable)",
+            "aggregation": "sum"
+          },
+          {
+            "id": "queuedTasks",
+            "label": "Queued Tasks",
+            "tip": "Tasks waiting on the executor.",
+            "mqe": "latest(meter_airflow_executor_queued_tasks)",
+            "aggregation": "sum"
+          },
+          {
+            "id": "openSlots",
+            "label": "Open Slots",
+            "tip": "Free executor slots.",
+            "mqe": "latest(meter_airflow_executor_open_slots)",
+            "aggregation": "sum"
+          }
+        ]
+      }
+    ]
+  },
+  "dashboards": {
+    "service": [
+      {
+        "id": "tasks_executable",
+        "title": "Tasks Executable",
+        "type": "card",
+        "expressions": [
+          "latest(meter_airflow_scheduler_tasks_executable)"
+        ],
+        "span": 3,
+        "rowSpan": 1,
+        "format": "int"
+      },
+      {
+        "id": "running_tasks",
+        "title": "Running Tasks",
+        "type": "card",
+        "expressions": [
+          "latest(meter_airflow_executor_running_tasks)"
+        ],
+        "span": 3,
+        "rowSpan": 1,
+        "format": "int"
+      },
+      {
+        "id": "scheduled_slots",
+        "title": "Scheduled Slots",
+        "type": "card",
+        "expressions": [
+          "latest(meter_airflow_pool_scheduled_slots)"

Review Comment:
   πŸ”΄ **Multi-pool bug.** The backend keeps a `pool_name` label on this metric 
(`airflow_pool_scheduled_slots.sum(['cluster', 'pool_name'])`), so OAP returns 
**one result per pool**. The card path keeps only `results[0]` and silently 
drops the rest β€” so this shows one arbitrary pool's count labeled as the 
cluster total. It's correct only with a single pool (the `default_pool`-only 
setup validated here; the e2e fixture has just `default_pool`, so it can't 
catch this). The `Pool ... Slots` line widget below renders every series, so 
it's fine.
   
   Collapse the label before `latest()` so OAP returns a single series:
   ```json
   "latest(aggregate_labels(meter_airflow_pool_scheduled_slots, sum))"
   ```
   The other three cards are `.sum(['cluster'])` single-series and need no 
change. (Still a scalar, so `type: "card"` stays correct.)



##########
apps/bff/src/bundled_templates/layers/airflow.json:
##########
@@ -0,0 +1,273 @@
+{
+  "key": "AIRFLOW",
+  "alias": "Airflow",
+  "group": "Workflow Scheduler",
+  "color": "var(--sw-cyan)",
+  "documentLink": 
"https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-airflow-monitoring/";,
+  "aliases": {
+    "services": "Airflow clusters",
+    "instances": "Components"
+  },
+  "components": {
+    "service": true,
+    "instances": true,
+    "endpoints": false,
+    "topology": false,
+    "traces": false,
+    "logs": false
+  },
+  "overview": {
+    "groups": [
+      {
+        "title": "Cluster",
+        "size": "auto",
+        "metrics": [
+          {
+            "id": "tasksExecutable",
+            "label": "Tasks Executable",
+            "tip": "Tasks ready for execution across the cluster.",
+            "mqe": "latest(meter_airflow_scheduler_tasks_executable)",
+            "aggregation": "sum"
+          },
+          {
+            "id": "queuedTasks",
+            "label": "Queued Tasks",
+            "tip": "Tasks waiting on the executor.",
+            "mqe": "latest(meter_airflow_executor_queued_tasks)",
+            "aggregation": "sum"
+          },
+          {
+            "id": "openSlots",
+            "label": "Open Slots",
+            "tip": "Free executor slots.",
+            "mqe": "latest(meter_airflow_executor_open_slots)",
+            "aggregation": "sum"
+          }
+        ]
+      }
+    ]
+  },
+  "dashboards": {
+    "service": [
+      {
+        "id": "tasks_executable",
+        "title": "Tasks Executable",
+        "type": "card",
+        "expressions": [
+          "latest(meter_airflow_scheduler_tasks_executable)"
+        ],
+        "span": 3,
+        "rowSpan": 1,
+        "format": "int"
+      },
+      {
+        "id": "running_tasks",
+        "title": "Running Tasks",
+        "type": "card",
+        "expressions": [
+          "latest(meter_airflow_executor_running_tasks)"
+        ],
+        "span": 3,
+        "rowSpan": 1,
+        "format": "int"
+      },
+      {
+        "id": "scheduled_slots",
+        "title": "Scheduled Slots",
+        "type": "card",
+        "expressions": [
+          "latest(meter_airflow_pool_scheduled_slots)"
+        ],
+        "span": 3,
+        "rowSpan": 1,
+        "format": "int"
+      },
+      {
+        "id": "queued_tasks",
+        "title": "Queued Tasks",
+        "type": "card",
+        "expressions": [
+          "latest(meter_airflow_executor_queued_tasks)"
+        ],
+        "span": 3,
+        "rowSpan": 1,
+        "format": "int"
+      },
+      {
+        "id": "open_slots",
+        "title": "Open Slots",
+        "type": "line",
+        "expressions": [
+          "meter_airflow_executor_open_slots"
+        ],
+        "span": 4,
+        "rowSpan": 2,
+        "format": "int"
+      },
+      {
+        "id": "pool_slots",
+        "title": "Pool Queued / Deferred Slots",

Review Comment:
   🟑 This title names only **2** of the **3** series the widget plots (queued / 
deferred / **scheduled**). All 7 translation catalogs already name three (e.g. 
zh-CN `Pool ζŽ’ι˜Ÿ / 廢迟 / ε·²θ°ƒεΊ¦ Slot`). Since English is the source of truth, fix it 
here:
   ```json
   "title": "Pool Queued / Deferred / Scheduled Slots",
   ```



##########
apps/bff/src/bundled_templates/infra-3d/config.json:
##########
@@ -259,6 +260,10 @@
       "color": "#e6526f",
       "metric":  { "mqe": "latest(meter_flink_jobManager_running_job_number)", 
"label": "Running Jobs", "unit": "jobs" }
     },
+    "AIRFLOW": {
+      "color": "#017cee",
+      "load":  { "mqe": "latest(meter_airflow_scheduler_tasks_executable)", 
"label": "Tasks Executable", "unit": "tasks" }

Review Comment:
   🟑 Deprecated `load` key β€” every other layer in this file uses `metric`, and 
the type marks `load` `@deprecated` ("new saves write `metric` only"). It 
renders today only via the back-compat fallback, and the 3D-map admin editor 
auto-migrates `load`β†’`metric` on first save. Rename for consistency with the 
canonical shape:
   ```json
   "metric": { "mqe": "latest(meter_airflow_scheduler_tasks_executable)", 
"label": "Tasks Executable", "unit": "tasks" }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to