thanos-io / promql-engine

Multi-threaded PromQL engine implementation based on the Volcano paper.
Apache License 2.0
142 stars 54 forks source link

Add a CLI tool to query a TSDB block #269

Open fpetkovski opened 1 year ago

fpetkovski commented 1 year ago

It would be great to have something like promql-cli that allows executing a query against a TSDB block. The main motivation for such a tool is to visualize CPU and memory usage by operator so that we know which computations are expensive. We could use time spent in operator and samples processed/produced by operator as proxies for these resources.

This issue is currently blocked by https://github.com/thanos-io/promql-engine/issues/106.

yeya24 commented 1 year ago

Is this feature in the scope of this repo?

fpetkovski commented 1 year ago

My thought was that it can be useful for benchmarking and profiling queries. The CLI tool could output time spent in each operator, memory used by operator etc. So it should be more than a generic querying tool.

yeya24 commented 1 year ago

The CLI tool could output time spent in each operator, memory used by operator etc

That's an interesting idea. Do we have those metrics built in this library now? We don't have a way to track time and memory usage now. Shouldn't we have that first before the CLI?

fpetkovski commented 1 year ago

Agreed, we would need https://github.com/thanos-io/promql-engine/issues/106 to be done first. I updated the description to have more clarity.