Enable attaching key-value pairs (labels) to queries using a comment in the query's first line (e.g., # dashboard=daily-metrics; data-source=timescaledb;).
Use labels to target specific queries for individualized caching behavior.
Adopt YAML configuration:
Replace global environment variables with a YAML configuration file for advanced settings.
Specify default caching behavior for all queries.
Define customized caching configurations for queries matching specified labels.
Key benefits:
Granular control: Tailor caching settings to specific query requirements, optimizing performance and resource usage.
Improved flexibility : Easily adjust caching behavior without code changes, promoting adaptability to diverse scenarios.
Enhanced maintainability: YAML configuration simplifies management and understanding of caching rules.
Requirements:
Support first-line comments for query labels: Implement parsing logic to extract labels from comments.
Implement YAML configuration parsing: Read and apply caching settings from the YAML configuration file.
Apply query labels for caching: Use labels to match queries with their corresponding configurations.
Proposed changes
# dashboard=daily-metrics; data-source=timescaledb;
).Key benefits:
Requirements:
Example YAML configuration:
Example query with label comment: