《夏锐航-PromQL Got a Boost.pdf》由会员分享,可在线阅读,更多相关《夏锐航-PromQL Got a Boost.pdf(39页珍藏版)》请在三个皮匠报告上搜索。
1、第三届中国 Rust 开发者大会PromQL Got a BOOST:用 Rust 重写 Prometheus 的查询引擎Ruihang Xia Ruihang GitHub:waynexia Losing hair at Greptime Wanna sleep 10 hrs/day Learn JS every year Healing the HyruleABOUTBackground01CONTENTSthe Parser02the Engine03Rust Gives04Outlook0501BackgroundAbout Prometheus and PromQL Why rewr
2、ite?What are boosted?PROMETHEUS AND PROMQLThe de facto standard in cloud-native monitor scenario Has its own query language called“PromQL”rate(api_request_durationhost=“foo”5m)More than a monitor:alert,visualize with many integrationsPROMETHEUS AND PROMQLrate(api_request_durationhost=“foo”5m)Operato
3、rDataFilterRangeSELECT rate(val)OVER(ORDER BY timestamp RANGE BETWEEN 5 minutes PRECEDING AND CURRENT ROW )AS rateFROM api_request_durationWHERE host=fooOURSGreptimeTeam/greptimedb Time-Series Database(could-naive,hybrid-workload,distributed)SQL and table modelWHY REWRITETarget to be the most powerf
4、ul drop-in replacement PromQL has a good UX for time-series data And it can be better if combine with SQL RIIR,super cooooooool!WHAT ARE BOOSTEDPromQL is extended multi-field support new operators&UDF better performance larger dataset more computation resources SQL is extended introducing the new co
5、ncept we have just made SQLWHAT ARE BOOSTEDSQLT(elemetry)QLPromQL is extended multi-field support new operators&UDF better performance larger dataset more computation resources SQL is extended introducing the new concept we have just made PROMQL VIA SQL(1)prepare data using SQL(2)write your PromQL!0
6、2the ParserTech stack Our choiceOUR CHOICElrpar-generator,yacc compatible PromQL has replaced its hand-written parser with yacc But there are still many slight differencesYACC FILEHOW TO CHOOSEBased on the scenario and pre-requirement E.g.:sqlparser-hand-written combinator nom81,000,000+combinatorpe