refactor: bring metrics to http output (#3247)

* refactor: bring metrics to http output

* chore: remove unwrap

* chore: make walk plan accumulate

* chore: change field name and comment

* chore: add metrics to http resp header

* chore: move PrometheusJsonResponse to a separate file and impl IntoResponse

* chore: put metrics in prometheus resp header too
This commit is contained in:
shuiyisong
2024-02-20 11:25:18 +08:00
committed by GitHub
parent 6628c41c36
commit bf5e1905cd
58 changed files with 592 additions and 395 deletions

View File

@@ -466,7 +466,7 @@ impl Database for GreptimeDB {
}) as _
} else {
let mut result = client.sql(&query).await;
if let Ok(Output::Stream(stream)) = result {
if let Ok(Output::Stream(stream, _)) = result {
match RecordBatches::try_collect(stream).await {
Ok(recordbatches) => result = Ok(Output::RecordBatches(recordbatches)),
Err(e) => {
@@ -577,7 +577,7 @@ impl Display for ResultDisplayer {
}
}
}
Output::Stream(_) => unreachable!(),
Output::Stream(_, _) => unreachable!(),
},
Err(e) => {
let status_code = e.status_code();