Implementation of metrics

Hi everyone, I find CRDB has a lot of metrics for monitoring. But I don’t find the source code of HTTP server for Prometheus to pull the metrics from the CRDB. Where is it? And does CRDB calculates p99 or Prometheus calculate it?

Hello!

CRDB has an HTTP endpoint _status/vars which exports CRDB metrics to Prometheus. The detailed documentation on how to do this is here. When importing metrics into Prometheus using the _status/vars endpoint, you will need to use Prometheus functions for performing the aggregation.

Another way to view the metrics is through DB Console. The documentation on how to access and use DB Console to view your metrics is contained here. You can also view percentile values for any metrics from within DBConsole.

Hope this answers your question.

Hi @rima, thanks for your reply a lot.
I’m not sure I really understand what you mean, so I’ll repeat what you said according to my understanding. Please tell me if I understand you correctly.

  1. CRDB just stores the raw data, and Prometheus pulls these raw data every once in a while, and stores them in Prometheus’s time-series database. And then Prometheus uses these time-series data via PromQL to calculate rate, p99… Am I getting this right?
  2. Not only Prometheus but also DB console could pull, store these raw metric data and calculate rate, p99. Is that so?
  3. When should I use DB console and when should I use Prometheus?

Hi @rima, are you still there

Hi @jievince,

  1. CRDB just stores the raw data, and Prometheus pulls these raw data every once in a while, and stores them in Prometheus’s time-series database. And then Prometheus uses these time-series data via PromQL to calculate rate, p99… Am I getting this right?
    Rima: Yes, CRDB exports the raw metric values. I would recommend reading this doc to get more information on exactly what is exported by CRDB and how you can use it.

  2. Not only Prometheus but also DB console could pull, store these raw metric data and calculate rate, p99. Is that so?
    Rima: Correct.

  3. When should I use DB console and when should I use Prometheus?
    Rima: I think this is more of a personal preference than anything else. You’re free to choose DB console or Prometheus based on what you find more convenient.

1 Like