You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| GET |`/api/logs?namespace=&name=&tailLines=&follow=true\|false`| Processor pod logs (text or SSE when `follow=true`) |
73
73
| GET |`/api/status?namespace=&name=`| DataFlow status (phase, message, processedCount, errorCount, lastProcessedTime) |
74
-
| GET |`/api/metrics?namespace=&name=`|Metrics for DataFlow (reserved for future use)|
74
+
| GET |`/api/metrics?namespace=&name=`|Prometheus metrics for DataFlow (proxied from operator when `OPERATOR_METRICS_URL` is set; otherwise returns empty stub). In Helm, `OPERATOR_METRICS_URL` is set automatically; override via `gui.extraEnv` if operator is in a different namespace.|
75
75
76
76
CORS headers (`Access-Control-Allow-Origin: *`, etc.) are set so the API can be used from a different port during local development.
- Возможные значения `error_type`: см. [Error types](errors.md#error-types)
94
94
95
+
### 6.2 Labels
96
+
97
+
Metrics use `namespace` and `name` labels to bind to DataFlow, which is convenient for filtering and aggregation in Prometheus/Grafana. All metrics include at least these two labels; additional labels (`source_type`, `sink_type`, `connector_type`, `stage`, etc.) allow for more detailed queries.
98
+
99
+
Examples:
100
+
- Filter by specific DataFlow: `dataflow_messages_received_total{namespace="default", name="my-dataflow"}`
101
+
- Aggregate by namespace: `sum(rate(dataflow_messages_received_total[5m])) by (namespace, name)`
102
+
103
+
### 6.3 Histograms
104
+
105
+
Histograms use exponential buckets suitable for latency and message sizes:
106
+
107
+
| Metric | Buckets | Range |
108
+
|--------|---------|-------|
109
+
|`dataflow_processing_duration_seconds`| ExponentialBuckets(0.001, 2, 10) | 1 ms — ~1 s |
110
+
|`dataflow_transformer_duration_seconds`| ExponentialBuckets(0.0001, 2, 12) | 0.1 ms — ~400 ms |
111
+
|`dataflow_task_stage_duration_seconds`| ExponentialBuckets(0.0001, 2, 14) | 0.1 ms — ~1.6 s |
| GET |`/api/logs?namespace=&name=&tailLines=&follow=true\|false`| Логи пода процессора (текст или SSE при `follow=true`) |
73
73
| GET |`/api/status?namespace=&name=`| Статус DataFlow (phase, message, processedCount, errorCount, lastProcessedTime) |
74
-
| GET |`/api/metrics?namespace=&name=`|Метрики по DataFlow (зарезервировано для расширения) |
74
+
| GET |`/api/metrics?namespace=&name=`|Prometheus-метрики по DataFlow (проксируются с оператора при заданном `OPERATOR_METRICS_URL`; иначе — пустая заглушка) |
75
75
76
76
Для CORS заданы заголовки `Access-Control-Allow-Origin: *`, `Access-Control-Allow-Methods`, `Access-Control-Allow-Headers`, чтобы к API можно было обращаться с другого порта при локальной разработке.
- Возможные значения `error_type`: см. [Типы ошибок](errors.md#типы-ошибок)
94
94
95
+
### 6.2 Метки
96
+
97
+
Метрики используют метки `namespace` и `name` для привязки к DataFlow, что удобно для фильтрации и агрегации в Prometheus/Grafana. Все метрики содержат как минимум эти две метки; дополнительные метки (`source_type`, `sink_type`, `connector_type`, `stage` и др.) позволяют детализировать запросы.
98
+
99
+
Примеры:
100
+
- Фильтрация по конкретному DataFlow: `dataflow_messages_received_total{namespace="default", name="my-dataflow"}`
101
+
- Агрегация по namespace: `sum(rate(dataflow_messages_received_total[5m])) by (namespace, name)`
102
+
103
+
### 6.3 Гистограммы
104
+
105
+
Для гистограмм используются экспоненциальные buckets, подходящие для латентности и размеров сообщений:
0 commit comments