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
Copy file name to clipboardExpand all lines: docs/user-guide/flow-computation/manage-flow.md
-47Lines changed: 0 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,53 +221,6 @@ please refer to [`date_bin`](/reference/sql/functions/df-functions.md#date_bin).
221
221
Currently, flow rely on the time window expr to determine how to incrementally update the result. So it's better to use a relatively small time window when possible.
222
222
:::
223
223
224
-
### Write a PromQL query
225
-
226
-
GreptimeDB Flow also supports using PromQL for continuous aggregation, allowing you to leverage familiar PromQL syntax for time-series analysis. When writing PromQL queries for Flow, it's crucial to specify an `eval interval` as PromQL doesn't have a fixed time window. This interval determines how frequently the PromQL query is evaluated and new aggregated results are generated.
227
-
228
-
For example, to calculate the 1-minute rate of `http_requests_total` for a specific job, you might use a PromQL query like this:
229
-
230
-
```promql
231
-
rate(http_requests_total{job="my_service"}[1m])
232
-
```
233
-
234
-
Here's a full example of using TQL (PromQL with `EVAL` clause) within a Flow:
-`prom_metrics` is the source table where raw Prometheus-style metrics are ingested.
261
-
-`prom_aggregated` is the sink table that will store the continuously aggregated results.
262
-
-`TQL EVAL (start, end, '1m')` indicates that the PromQL query `rate(http_requests_total{job="my_service"}[1m])` is evaluated with a `step` of 1 minute.
263
-
- The `rate` function calculates the per-second average rate of increase of the `http_requests_total` metric over the last 1 minutes.
264
-
- The results, including the calculated `value` and the `timestamp` (which corresponds to the evaluation timestamp), are then written to the `rate_reqs` sink table.
265
-
266
-
This setup allows you to perform continuous, real-time PromQL-based aggregations on your time-series data, making it readily available for dashboards, alerts, and further analysis.
267
-
268
-
In the context of Flow, this query would be evaluated every `eval interval` (e.g., every 1 minute, 5 minutes, etc.), and the results would be continuously updated in your sink table. The `eval interval` ensures that the aggregation is performed at regular, defined periods, which is essential for consistent time-series analysis and efficient resource utilization. Without a specified `eval interval`, the Flow engine would not know how often to re-evaluate the PromQL expression, leading to undefined behavior or inefficient processing.
269
-
270
-
271
224
## Flush a flow
272
225
273
226
The flow engine automatically processes aggregation operations within a short period(i.e. few seconds) when new data arrives in the source table.
0 commit comments