![]() ![]() Under Your Connections, click Data sources.Click Connections in the left-side menu.To enable query caching for a single data source: For more information on Grafana roles and permissions, refer to About users and permissions.īy default, data source queries are not cached. You must be an Org admin or Grafana admin to enable query caching for a data source. See the developers page on plugin resources for details. Note: Some data sources, such as Elasticsearch, Prometheus, and Loki, cache queries themselves, so Grafana query caching does not significantly improve performance. If caching is enabled in Grafana but the Caching tab is not visible for the given data source, then query caching is not available for that data source. To verify that a data source works with query caching, follow the instructions below to Enable and Configure query caching. Query caching works for Grafana’s built-in data sources, and backend data source plugins that extend the DataSourceWithBackend class in the plugins SDK. Reduced likelihood that APIs will rate-limit or throttle requests.ĭata sources that work with query caching.Faster dashboard load times, especially for popular dashboards.Caching benefitsīy reducing the number of queries and requests sent to data sources, caching can provide the following benefits: You can configure a panel to retrieve data more often by increasing the Max data points setting in the panel’s query options. In this example, cached data for this panel will be served for up to 10 minutes before Grafana needs to query the data source again for new data. For example, a wide panel with 1000 data points on a dashboard with a time range of last 7 days will retrieve fresh data every 10 minutes: 7d / 1000 = 10m. Max data points are calculated based on the width of the panel. It is calculated as follows: time range / max data points. Therefore, wider panels and dashboards with shorter time ranges fetch new data more often than narrower panels and dashboards with longer time ranges.Ī panel’s interval is visible in the query options. The interval is used to round the query time range to a nearby cached time range, increasing the likelihood of cache hits. When a panel queries a data source with cached data, it will either fetch fresh data or use cached data depending on the panel’s interval. In production environments, a Redis or Memcached backend is highly recommended. Note: Storing cached queries in-memory can increase Grafana’s memory footprint.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |