Skip to content

Commit

Permalink
chore: switch to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Oct 25, 2024
1 parent ec3e25d commit f349cd2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ parquet = { version = "51.0.0", default-features = false, features = ["arrow", "
paste = "1.0"
pin-project = "1.0"
prometheus = { version = "0.13.3", features = ["process"] }
promql-parser = { git = "https://github.com/GreptimeTeam/promql-parser.git", branch = "feature/serialize-ast", features = ["ser"] }
promql-parser = { version = "0.4.2", features = ["ser"] }
prost = "0.12"
raft-engine = { version = "0.4.1", default-features = false }
rand = "0.8"
Expand Down
12 changes: 1 addition & 11 deletions src/servers/src/http/prometheus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,20 +1032,10 @@ pub struct ParseQuery {
pub async fn parse_query(
State(_handler): State<PrometheusHandlerRef>,
Query(params): Query<ParseQuery>,
Extension(mut query_ctx): Extension<QueryContext>,
Extension(_query_ctx): Extension<QueryContext>,
Form(form_params): Form<ParseQuery>,
) -> PrometheusJsonResponse {
if let Some(db) = &params.db {
let (catalog, schema) = parse_catalog_and_schema_from_db_string(db);
try_update_catalog_schema(&mut query_ctx, &catalog, &schema);
}
let query_ctx = Arc::new(query_ctx);

if let Some(query) = params.query.or(form_params.query) {
let _timer = crate::metrics::METRIC_HTTP_PROMETHEUS_PROMQL_ELAPSED
.with_label_values(&[query_ctx.get_db_string().as_str(), "series_query"])
.start_timer();

match promql_parser::parser::parse(&query) {
Ok(ast) => PrometheusJsonResponse::success(PrometheusResponse::ParseResult(ast)),
Err(err) => {
Expand Down

0 comments on commit f349cd2

Please sign in to comment.