Giter VIP home page Giter VIP logo

Comments (4)

sunsingerus avatar sunsingerus commented on June 1, 2024

Would the ch-operator team entertain a PR to expose these per-query statistics?

If you would like to make PR with new functionality, we'd consider it, of course. But it would be very good to discuss architectural/implementation details prior. We can use this thread to discuss as much details as possible.

from clickhouse-operator.

kcking avatar kcking commented on June 1, 2024

Sounds good!

The main per-query metrics I am interested in, and would propose as an MVP, would be

  1. query_duration_ms
  2. memory_usage
  3. result_bytes

Each with the following labels

  1. user
  2. address

Then this could be exposed as a Prometheus Histogram with set quantiles, i.e. 0.50, 0.90, 0.95, 0.99.

The main architectural question in my mind is how to populate a histogram with the polling fetcher. One idea is to filter queries in the log that happened within the last 30s AND after the last query we have already processed. Would be great to get your thoughts on this, or potentially a better idea.

from clickhouse-operator.

filimonov avatar filimonov commented on June 1, 2024

Usually query_log is full of very different queries, and number of queries cluster-wise can be quite big.

So that data can be useful only in one very special case - when you need to monitor the execution of some very particular query which is expected to be executed close to constant time. Do you mean something like that? Do you plan to run some particular query (which always affect same number of rows) in some separated user?

That usecase sound like very-very limited, as usually you run different queries, with different conditions, affecting different time ranges, and putting them in some kind of graph seems useless. So direct comparison of such a different queries is simply not possible, and if you will try to draw a graph from that - it rather will be very noisy and useless.

Also AFAIR query_duration can be affected by client / network speed.

from clickhouse-operator.

kcking avatar kcking commented on June 1, 2024

Thanks for the thoughtful response. Our customers can perform many different queries via our API, but we want all of them to meet a certain latency requirement. Upon further thinking about this, we can also log query statistics in the query code (we are using FORMAT JSONCompact, so all of the statistics come back with the query). It probably makes the most sense to do it in real-time there and avoid needing clickhouse to log all of the queries.

Closing for now, thanks again!

from clickhouse-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.