rishabhkailey / Grafana-Query-Cache

Grafana Query Cache is an Nginx-powered proxy that accelerates dashboard loading and reduces data source load by caching query results.
MIT License
2 stars 0 forks source link

Improve Grafana query cache flexibility #31

Closed rishabhkailey closed 8 months ago

rishabhkailey commented 9 months ago

Proposed changes

Key benefits:

Requirements:

Example YAML configuration:

# Default configuration for queries without label match:
default:
  enabled: true
  acceptableTimeDeltaSeconds: 600
  acceptableTimeRangeDeltaSeconds: 60
  acceptableMaxDataPointsDelta: 200

# Query-specific configuration using labels:
queryConfigs:
- querySelector:
    dashboard: daily-metrics
    data-source: timescaledb
  cacheConfig:
    enabled: true
    acceptableTimeDeltaSeconds: 2400
    acceptableTimeRangeDeltaSeconds: 600
    acceptableMaxDataPointsDelta: 300

Example query with label comment:

-- dashboard=daily-metrics; data-source=timescaledb;
SELECT ...