- Newest
- Most votes
- Most comments
If you are looking for free solutions, below 2 options could work:
- Setting up an NGINX proxy with caching capabilities can be a viable solution for caching responses from Timestream for Grafana requests.
The configuration you provided seems to be designed for caching InfluxDB requests, but you can adapt it for Timestream by making some modifications. Here's an example:
# Proxy cache formats
proxy_cache_path /path/to/grafana_cache levels=1:2 keys_zone=grafana_cache:25m max_size=500m inactive=5m use_temp_path=off;
proxy_cache_path /path/to/timestream_cache levels=1:2 keys_zone=timestream_cache:25m max_size=500m inactive=5m use_temp_path=off;
# Maps to detect Timestream traffic
map $http_referer $proxyloc {
~*timestream timestream;
}
# Timestream API endpoints
map $request_uri $backend {
~*query timestream;
~*write timestream;
~*ping timestream;
}
# Enable caching for queries
map $request_uri $nonquery {
~*query 0;
default 1;
}
# Proxy configuration
server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://backend;
# Cache configuration
proxy_cache grafana_cache;
proxy_cache_valid 200 5m;
proxy_cache_key "$scheme$request_method$host$request_uri";
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
# Conditionally enable caching based on request type
proxy_cache_bypass $nonquery;
proxy_no_cache $nonquery;
}
}
- Using an application like Trickster can indeed be a suitable solution for caching and accelerating responses from Timestream for Grafana requests. Trickster is a reverse proxy cache specifically designed for time series databases, including Timestream.
https://github.com/trickstercache/trickster
Note: i don't see any reference to Timestream but since it says it will work with any time series query, it could work.
Hi @pbrown - Thank you for your question.
Grafana does offer a caching solution, and a recent blog post describes how to configure the cache. For more info and to get started, read the blog post here:
Additionally, when to optimize larger queries, please review the best practices in the Timestream developer guide:
https://docs.aws.amazon.com/timestream/latest/developerguide/queries-bp.html
If you have any other questions, please feel free to reach out.
Thanks for the reply. However, you neglected to mention, "Grafana’s query caching feature (available in Grafana Cloud and Grafana Enterprise) "
So, this caching is not available unless you pay extra for it.
Relevant content
- asked 9 months ago
- asked 10 months ago
- asked 2 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Hmm. Sounds like a really neat tool. But given that AWS has some particular security connection constraints, I would imagine trickster would need to explicitly support it