Does Grafana provide any built-in functions to monitor itself?

116 views
Skip to first unread message

陈卢鑫

unread,
Dec 1, 2021, 7:59:42 AM12/1/21
to Grafana Developers

Hi, we are maintaining a grafana used by more than a thousand of users. We are facing a problem that we don’t know which dashboard, datasource is being requested most often, the request duration distribution, request error count, etc.

So we are wondering if grafana provide any built-in functions to monitor itself, such as:

  • write these information to database
  • exposing metrics
  • output query logs (we have seen some logs, but cannot meet our needs)
  • output query events ?

Thanks in advance .

Marcus Olsson

unread,
Dec 1, 2021, 9:01:20 AM12/1/21
to 陈卢鑫, Grafana Developers
If you're using Prometheus, you can configure it to scrape /metrics on your Grafana instance, i.e. http://localhost:3000/metrics.

--
You received this message because you are subscribed to the Google Groups "Grafana Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grafana-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grafana-developers/f1b836f6-d6b5-4763-8b8f-47dda24f3596n%40googlegroups.com.


--
Marcus Olsson
Developer Advocate at Grafana Labs

陈卢鑫

unread,
Dec 1, 2021, 10:15:58 PM12/1/21
to Grafana Developers
Thank you for reply. It seems that we cannot figure out **which** datasource/dashboard is being requested most frequently from the metrics. For example, the metric "http_request_duration_milliseconds_count{handler="/datasources/proxy/:id/*",method="post",statuscode="502"}" masks datasource id in its labels.

Ryan McKinley

unread,
Dec 2, 2021, 1:00:10 AM12/2/21
to Grafana Developers
There is an enterprise features targeting this directly:
https://grafana.com/docs/grafana/latest/enterprise/usage-insights/

陈卢鑫

unread,
Dec 2, 2021, 3:56:29 AM12/2/21
to Grafana Developers
Yeah, we have found that. But unfortunately our grafana is free version and private deployed ..

Marcus Efraimsson

unread,
Dec 2, 2021, 12:19:00 PM12/2/21
to Grafana Developers
For HTTP based data sources you can use the following metrics (availability may vary depending on Grafana version, the more recent the better):

grafana_datasource_request_duration_seconds{code="200",datasource="ClickHouse",method="post",quantile="0.5"} 0.190821535
grafana_datasource_request_duration_seconds{code="200",datasource="ClickHouse",method="post",quantile="0.9"} 0.380887107
grafana_datasource_request_duration_seconds{code="200",datasource="ClickHouse",method="post",quantile="0.99"} 0.491507017
grafana_datasource_request_duration_seconds_sum{code="200",datasource="ClickHouse",method="post"} 2.266877715
grafana_datasource_request_duration_seconds_count{code="200",datasource="ClickHouse",method="post"} 10
# HELP grafana_datasource_request_in_flight A gauge of outgoing datasource requests currently being sent by Grafana
# TYPE grafana_datasource_request_in_flight gauge
grafana_datasource_request_in_flight{datasource="ClickHouse"} 0
# HELP grafana_datasource_request_total A counter for outgoing requests for a datasource
# TYPE grafana_datasource_request_total counter
grafana_datasource_request_total{code="200",datasource="ClickHouse",method="post"} 10
# HELP grafana_datasource_response_size_bytes summary of datasource response sizes returned to Grafana
# TYPE grafana_datasource_response_size_bytes summary
grafana_datasource_response_size_bytes{datasource="ClickHouse",quantile="0.5"} 130
grafana_datasource_response_size_bytes{datasource="ClickHouse",quantile="0.9"} 130
grafana_datasource_response_size_bytes{datasource="ClickHouse",quantile="0.99"} 130
grafana_datasource_response_size_bytes_sum{datasource="ClickHouse"} 1297
grafana_datasource_response_size_bytes_count{datasource="ClickHouse"} 10

Kind regards,
Marcus Efraimsson

陈卢鑫

unread,
Dec 2, 2021, 11:34:03 PM12/2/21
to Grafana Developers
Wow, these metrics are really useful for us. I wiil check on that and consider upgrading our grafana. Thank you, Marcus !
Reply all
Reply to author
Forward
0 new messages