Skip to content

Commit c4945f5

Browse files
authored
fix: quick start after v1.0 (#2209)
Signed-off-by: Dennis Zhuang <[email protected]>
1 parent 77f8ee0 commit c4945f5

File tree

4 files changed

+56
-64
lines changed

4 files changed

+56
-64
lines changed

docs/getting-started/quick-start.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -331,28 +331,28 @@ ORDER BY m.ts, m.host;
331331
8 rows in set (0.02 sec)
332332
```
333333

334-
We can see that during the time window when the gRPC latencies increases, the number of error logs also increases significantly, and we've identified that the problem is on `host1`.
334+
We can see that during the time window when the gRPC latencies increases (`2024-07-11 20:00:10` ~ `2024-07-11 20:00:15`), the number of error logs also increases significantly (from 0 to 10 errors), and we've identified that the problem is on `host1`.
335335

336336
### Query data via PromQL
337337

338-
GreptimeDB supports [Prometheus Query Language and its APIs](/user-guide/query-data/promql.md), allowing you to query metrics using PromQL. For example, you can retrieve the p95 latency over the last 1 minute per host with this query:
338+
GreptimeDB supports [Prometheus Query Language and its APIs](/user-guide/query-data/promql.md), allowing you to query metrics using PromQL. For example, you can retrieve the p95 latency over the last 5 seconds per host with this query:
339339

340340
```promql
341-
quantile_over_time(0.95, grpc_latencies{host!=""}[1m])
341+
quantile_over_time(0.95, grpc_latencies{host!=""}[5s])
342342
```
343343

344344
To test this, use the following curl command:
345345
```bash
346346
curl -X POST \
347347
-H 'Authorization: Basic {{authorization if exists}}' \
348-
--data-urlencode 'query=quantile_over_time(0.95, grpc_latencies{host!=""}[1m])' \
348+
--data-urlencode 'query=quantile_over_time(0.95, grpc_latencies{host!=""}[5s])' \
349349
--data-urlencode 'start=2024-07-11 20:00:00Z' \
350350
--data-urlencode 'end=2024-07-11 20:00:20Z' \
351-
--data-urlencode 'step=1m' \
351+
--data-urlencode 'step=15s' \
352352
'http://localhost:4000/v1/prometheus/api/v1/query_range'
353353
```
354354

355-
We set the `step` to 1 minute.
355+
We set the `step` to 15 seconds.
356356

357357
Output:
358358
```json
@@ -369,8 +369,8 @@ Output:
369369
},
370370
"values": [
371371
[
372-
1720728000.0,
373-
"103"
372+
1720728015.0,
373+
"3400"
374374
]
375375
]
376376
},
@@ -382,8 +382,8 @@ Output:
382382
},
383383
"values": [
384384
[
385-
1720728000.0,
386-
"113"
385+
1720728015.0,
386+
"114"
387387
]
388388
]
389389
}
@@ -394,17 +394,17 @@ Output:
394394

395395
Even more powerful, you can use SQL to execute PromQL and mix the two, for example:
396396
```sql
397-
TQL EVAL ('2024-07-11 20:00:00Z', '2024-07-11 20:00:20Z','1m')
398-
quantile_over_time(0.95, grpc_latencies{host!=""}[1m]);
397+
TQL EVAL ('2024-07-11 20:00:00Z', '2024-07-11 20:00:20Z','15s')
398+
quantile_over_time(0.95, grpc_latencies{host!=""}[5s]);
399399
```
400400

401401
This SQL query will produce:
402402
```sql
403403
+---------------------+---------------------------------------------------------+-------+-------------+
404404
| ts | prom_quantile_over_time(ts_range,latency,Float64(0.95)) | host | method_name |
405405
+---------------------+---------------------------------------------------------+-------+-------------+
406-
| 2024-07-11 20:00:00 | 113 | host2 | GetUser |
407-
| 2024-07-11 20:00:00 | 103 | host1 | GetUser |
406+
| 2024-07-11 20:00:15 | 3400 | host1 | GetUser |
407+
| 2024-07-11 20:00:15 | 114 | host2 | GetUser |
408408
+---------------------+---------------------------------------------------------+-------+-------------+
409409
```
410410

@@ -440,8 +440,6 @@ ORDER BY
440440
+---------------------+---------------------------------------------------------+-------+-------------+------------+
441441
| ts | prom_quantile_over_time(ts_range,latency,Float64(0.95)) | host | method_name | num_errors |
442442
+---------------------+---------------------------------------------------------+-------+-------------+------------+
443-
| 2024-07-11 20:00:05 | 103 | host1 | GetUser | 0 |
444-
| 2024-07-11 20:00:05 | 113 | host2 | GetUser | 0 |
445443
| 2024-07-11 20:00:10 | 140.89999999999998 | host1 | GetUser | 10 |
446444
| 2024-07-11 20:00:10 | 113.8 | host2 | GetUser | 0 |
447445
| 2024-07-11 20:00:15 | 3400 | host1 | GetUser | 4 |

i18n/zh/docusaurus-plugin-content-docs/current/getting-started/quick-start.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,28 +327,28 @@ ORDER BY m.ts, m.host;
327327
8 rows in set (0.02 sec)
328328
```
329329

330-
我们可以看到当 gRPC 响应时间增大的时间窗口内,错误日志也显著增多,并且确定问题在 `host1`
330+
我们可以看到当 gRPC 响应时间增大的时间窗口内`2024-07-11 20:00:10` ~ `2024-07-11 20:00:15`,错误日志也显著增多(从 0 增长到 10 个错误),并且确定问题在 `host1`
331331

332332
### 通过 PromQL 查询数据
333333

334-
GreptimeDB 支持 [Prometheus 查询语言及其 API](/user-guide/query-data/promql.md),允许你使用 PromQL 查询指标。例如,你可以使用以下查询获取每个主机在过去 1 分钟内的 p95 响应时间:
334+
GreptimeDB 支持 [Prometheus 查询语言及其 API](/user-guide/query-data/promql.md),允许你使用 PromQL 查询指标。例如,你可以使用以下查询获取每个主机在过去 5 秒内的 p95 响应时间:
335335

336336
```promql
337-
quantile_over_time(0.95, grpc_latencies{host!=""}[1m])
337+
quantile_over_time(0.95, grpc_latencies{host!=""}[5s])
338338
```
339339

340340
要测试这个查询,使用以下 curl 命令:
341341
```bash
342342
curl -X POST \
343343
-H 'Authorization: Basic {{authorization if exists}}' \
344-
--data-urlencode 'query=quantile_over_time(0.95, grpc_latencies{host!=""}[1m])' \
344+
--data-urlencode 'query=quantile_over_time(0.95, grpc_latencies{host!=""}[5s])' \
345345
--data-urlencode 'start=2024-07-11 20:00:00Z' \
346346
--data-urlencode 'end=2024-07-11 20:00:20Z' \
347-
--data-urlencode 'step=1m' \
347+
--data-urlencode 'step=15s' \
348348
'http://localhost:4000/v1/prometheus/api/v1/query_range'
349349
```
350350

351-
这里我们设置 `step`1 分钟
351+
这里我们设置 `step`15 秒
352352

353353
输出:
354354
```json
@@ -365,8 +365,8 @@ curl -X POST \
365365
},
366366
"values": [
367367
[
368-
1720728000.0,
369-
"103"
368+
1720728015.0,
369+
"3400"
370370
]
371371
]
372372
},
@@ -378,8 +378,8 @@ curl -X POST \
378378
},
379379
"values": [
380380
[
381-
1720728000.0,
382-
"113"
381+
1720728015.0,
382+
"114"
383383
]
384384
]
385385
}
@@ -390,17 +390,17 @@ curl -X POST \
390390

391391
更强大的是,你可以使用 SQL 来执行 PromQL 并混合使用两者,例如:
392392
```sql
393-
TQL EVAL ('2024-07-11 20:00:00Z', '2024-07-11 20:00:20Z','1m')
394-
quantile_over_time(0.95, grpc_latencies{host!=""}[1m]);
393+
TQL EVAL ('2024-07-11 20:00:00Z', '2024-07-11 20:00:20Z','15s')
394+
quantile_over_time(0.95, grpc_latencies{host!=""}[5s]);
395395
```
396396

397397
这个 SQL 查询将输出:
398398
```sql
399399
+---------------------+---------------------------------------------------------+-------+-------------+
400400
| ts | prom_quantile_over_time(ts_range,latency,Float64(0.95)) | host | method_name |
401401
+---------------------+---------------------------------------------------------+-------+-------------+
402-
| 2024-07-11 20:00:00 | 113 | host2 | GetUser |
403-
| 2024-07-11 20:00:00 | 103 | host1 | GetUser |
402+
| 2024-07-11 20:00:15 | 3400 | host1 | GetUser |
403+
| 2024-07-11 20:00:15 | 114 | host2 | GetUser |
404404
+---------------------+---------------------------------------------------------+-------+-------------+
405405
```
406406

@@ -436,8 +436,6 @@ ORDER BY
436436
+---------------------+---------------------------------------------------------+-------+-------------+------------+
437437
| ts | prom_quantile_over_time(ts_range,latency,Float64(0.95)) | host | method_name | num_errors |
438438
+---------------------+---------------------------------------------------------+-------+-------------+------------+
439-
| 2024-07-11 20:00:05 | 103 | host1 | GetUser | 0 |
440-
| 2024-07-11 20:00:05 | 113 | host2 | GetUser | 0 |
441439
| 2024-07-11 20:00:10 | 140.89999999999998 | host1 | GetUser | 10 |
442440
| 2024-07-11 20:00:10 | 113.8 | host2 | GetUser | 0 |
443441
| 2024-07-11 20:00:15 | 3400 | host1 | GetUser | 4 |

i18n/zh/docusaurus-plugin-content-docs/version-1.0/getting-started/quick-start.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,28 +327,28 @@ ORDER BY m.ts, m.host;
327327
8 rows in set (0.02 sec)
328328
```
329329

330-
我们可以看到当 gRPC 响应时间增大的时间窗口内,错误日志也显著增多,并且确定问题在 `host1`
330+
我们可以看到当 gRPC 响应时间增大的时间窗口内`2024-07-11 20:00:10` ~ `2024-07-11 20:00:15`,错误日志也显著增多(从 0 增长到 10 个错误),并且确定问题在 `host1`
331331

332332
### 通过 PromQL 查询数据
333333

334-
GreptimeDB 支持 [Prometheus 查询语言及其 API](/user-guide/query-data/promql.md),允许你使用 PromQL 查询指标。例如,你可以使用以下查询获取每个主机在过去 1 分钟内的 p95 响应时间:
334+
GreptimeDB 支持 [Prometheus 查询语言及其 API](/user-guide/query-data/promql.md),允许你使用 PromQL 查询指标。例如,你可以使用以下查询获取每个主机在过去 5 秒内的 p95 响应时间:
335335

336336
```promql
337-
quantile_over_time(0.95, grpc_latencies{host!=""}[1m])
337+
quantile_over_time(0.95, grpc_latencies{host!=""}[5s])
338338
```
339339

340340
要测试这个查询,使用以下 curl 命令:
341341
```bash
342342
curl -X POST \
343343
-H 'Authorization: Basic {{authorization if exists}}' \
344-
--data-urlencode 'query=quantile_over_time(0.95, grpc_latencies{host!=""}[1m])' \
344+
--data-urlencode 'query=quantile_over_time(0.95, grpc_latencies{host!=""}[5s])' \
345345
--data-urlencode 'start=2024-07-11 20:00:00Z' \
346346
--data-urlencode 'end=2024-07-11 20:00:20Z' \
347-
--data-urlencode 'step=1m' \
347+
--data-urlencode 'step=15s' \
348348
'http://localhost:4000/v1/prometheus/api/v1/query_range'
349349
```
350350

351-
这里我们设置 `step`1 分钟
351+
这里我们设置 `step`15 秒
352352

353353
输出:
354354
```json
@@ -365,8 +365,8 @@ curl -X POST \
365365
},
366366
"values": [
367367
[
368-
1720728000.0,
369-
"103"
368+
1720728015.0,
369+
"3400"
370370
]
371371
]
372372
},
@@ -378,8 +378,8 @@ curl -X POST \
378378
},
379379
"values": [
380380
[
381-
1720728000.0,
382-
"113"
381+
1720728015.0,
382+
"114"
383383
]
384384
]
385385
}
@@ -390,17 +390,17 @@ curl -X POST \
390390

391391
更强大的是,你可以使用 SQL 来执行 PromQL 并混合使用两者,例如:
392392
```sql
393-
TQL EVAL ('2024-07-11 20:00:00Z', '2024-07-11 20:00:20Z','1m')
394-
quantile_over_time(0.95, grpc_latencies{host!=""}[1m]);
393+
TQL EVAL ('2024-07-11 20:00:00Z', '2024-07-11 20:00:20Z','15s')
394+
quantile_over_time(0.95, grpc_latencies{host!=""}[5s]);
395395
```
396396

397397
这个 SQL 查询将输出:
398398
```sql
399399
+---------------------+---------------------------------------------------------+-------+-------------+
400400
| ts | prom_quantile_over_time(ts_range,latency,Float64(0.95)) | host | method_name |
401401
+---------------------+---------------------------------------------------------+-------+-------------+
402-
| 2024-07-11 20:00:00 | 113 | host2 | GetUser |
403-
| 2024-07-11 20:00:00 | 103 | host1 | GetUser |
402+
| 2024-07-11 20:00:15 | 3400 | host1 | GetUser |
403+
| 2024-07-11 20:00:15 | 114 | host2 | GetUser |
404404
+---------------------+---------------------------------------------------------+-------+-------------+
405405
```
406406

@@ -436,8 +436,6 @@ ORDER BY
436436
+---------------------+---------------------------------------------------------+-------+-------------+------------+
437437
| ts | prom_quantile_over_time(ts_range,latency,Float64(0.95)) | host | method_name | num_errors |
438438
+---------------------+---------------------------------------------------------+-------+-------------+------------+
439-
| 2024-07-11 20:00:05 | 103 | host1 | GetUser | 0 |
440-
| 2024-07-11 20:00:05 | 113 | host2 | GetUser | 0 |
441439
| 2024-07-11 20:00:10 | 140.89999999999998 | host1 | GetUser | 10 |
442440
| 2024-07-11 20:00:10 | 113.8 | host2 | GetUser | 0 |
443441
| 2024-07-11 20:00:15 | 3400 | host1 | GetUser | 4 |

versioned_docs/version-1.0/getting-started/quick-start.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -331,28 +331,28 @@ ORDER BY m.ts, m.host;
331331
8 rows in set (0.02 sec)
332332
```
333333

334-
We can see that during the time window when the gRPC latencies increases, the number of error logs also increases significantly, and we've identified that the problem is on `host1`.
334+
We can see that during the time window when the gRPC latencies increases (`2024-07-11 20:00:10` ~ `2024-07-11 20:00:15`), the number of error logs also increases significantly (from 0 to 10 errors), and we've identified that the problem is on `host1`.
335335

336336
### Query data via PromQL
337337

338-
GreptimeDB supports [Prometheus Query Language and its APIs](/user-guide/query-data/promql.md), allowing you to query metrics using PromQL. For example, you can retrieve the p95 latency over the last 1 minute per host with this query:
338+
GreptimeDB supports [Prometheus Query Language and its APIs](/user-guide/query-data/promql.md), allowing you to query metrics using PromQL. For example, you can retrieve the p95 latency over the last 5 seconds per host with this query:
339339

340340
```promql
341-
quantile_over_time(0.95, grpc_latencies{host!=""}[1m])
341+
quantile_over_time(0.95, grpc_latencies{host!=""}[5s])
342342
```
343343

344344
To test this, use the following curl command:
345345
```bash
346346
curl -X POST \
347347
-H 'Authorization: Basic {{authorization if exists}}' \
348-
--data-urlencode 'query=quantile_over_time(0.95, grpc_latencies{host!=""}[1m])' \
348+
--data-urlencode 'query=quantile_over_time(0.95, grpc_latencies{host!=""}[5s])' \
349349
--data-urlencode 'start=2024-07-11 20:00:00Z' \
350350
--data-urlencode 'end=2024-07-11 20:00:20Z' \
351-
--data-urlencode 'step=1m' \
351+
--data-urlencode 'step=15s' \
352352
'http://localhost:4000/v1/prometheus/api/v1/query_range'
353353
```
354354

355-
We set the `step` to 1 minute.
355+
We set the `step` to 15 seconds.
356356

357357
Output:
358358
```json
@@ -369,8 +369,8 @@ Output:
369369
},
370370
"values": [
371371
[
372-
1720728000.0,
373-
"103"
372+
1720728015.0,
373+
"3400"
374374
]
375375
]
376376
},
@@ -382,8 +382,8 @@ Output:
382382
},
383383
"values": [
384384
[
385-
1720728000.0,
386-
"113"
385+
1720728015.0,
386+
"114"
387387
]
388388
]
389389
}
@@ -394,17 +394,17 @@ Output:
394394

395395
Even more powerful, you can use SQL to execute PromQL and mix the two, for example:
396396
```sql
397-
TQL EVAL ('2024-07-11 20:00:00Z', '2024-07-11 20:00:20Z','1m')
398-
quantile_over_time(0.95, grpc_latencies{host!=""}[1m]);
397+
TQL EVAL ('2024-07-11 20:00:00Z', '2024-07-11 20:00:20Z','15s')
398+
quantile_over_time(0.95, grpc_latencies{host!=""}[5s]);
399399
```
400400

401401
This SQL query will produce:
402402
```sql
403403
+---------------------+---------------------------------------------------------+-------+-------------+
404404
| ts | prom_quantile_over_time(ts_range,latency,Float64(0.95)) | host | method_name |
405405
+---------------------+---------------------------------------------------------+-------+-------------+
406-
| 2024-07-11 20:00:00 | 113 | host2 | GetUser |
407-
| 2024-07-11 20:00:00 | 103 | host1 | GetUser |
406+
| 2024-07-11 20:00:15 | 3400 | host1 | GetUser |
407+
| 2024-07-11 20:00:15 | 114 | host2 | GetUser |
408408
+---------------------+---------------------------------------------------------+-------+-------------+
409409
```
410410

@@ -440,8 +440,6 @@ ORDER BY
440440
+---------------------+---------------------------------------------------------+-------+-------------+------------+
441441
| ts | prom_quantile_over_time(ts_range,latency,Float64(0.95)) | host | method_name | num_errors |
442442
+---------------------+---------------------------------------------------------+-------+-------------+------------+
443-
| 2024-07-11 20:00:05 | 103 | host1 | GetUser | 0 |
444-
| 2024-07-11 20:00:05 | 113 | host2 | GetUser | 0 |
445443
| 2024-07-11 20:00:10 | 140.89999999999998 | host1 | GetUser | 10 |
446444
| 2024-07-11 20:00:10 | 113.8 | host2 | GetUser | 0 |
447445
| 2024-07-11 20:00:15 | 3400 | host1 | GetUser | 4 |

0 commit comments

Comments
 (0)