Example PromQL Queries for Apinizer Cache
Cache Analyses
bilgi
Metrics used to monitor cache usage and efficiency. Performance is evaluated with data such as cache lookups, additions, and memory consumption.
1. Total Cache Lookup Count (for 1 hour)
sum(increase(cache_gets_total[1h]))
2. Cache Addition Count (for 10 minutes)
sum(increase(cache_puts_total[10m]))
3. Cache Hit Rate (%) (for 5 minutes)
(sum(increase(cache_gets_total[5m])) - sum(increase(apinizer_cache_api_errors_total[5m]))) / sum(increase(cache_gets_total[5m])) * 100
4. Current Number of Entries in Cache
sum(cache_size)
5. Cache Features with Highest Memory Usage
topk(5, sum by (cache) (cache_entry_memory_bytes))
Cache API Analyses
bilgi
Used to monitor Cache API request performance. The system's ability to respond is analyzed with data such as API request count and success rate.
1. Total API Request Count (for 1 hour)
sum(increase(apinizer_cache_api_requests_total[1h]))
2. API Success Rate (%) (for 10 minutes)
(sum(increase(apinizer_cache_api_requests_total[10m])) - sum(increase(apinizer_cache_api_errors_total[10m]))) / sum(increase(apinizer_cache_api_requests_total[10m])) * 100
JVM Analyses
bilgi
Evaluates application resource consumption and performance by monitoring JVM memory usage, GC (Garbage Collector) pause times, and thread count.
1. Memory Usage Percentage
(sum(jvm_memory_used_bytes{application="apinizer-cache"}) * 100) / sum(jvm_memory_max_bytes{application="apinizer-cache"})
2. Garbage Collection Duration (for 5 minutes)
sum(rate(jvm_gc_pause_seconds_sum{application="apinizer-cache"}[5m]))
3. Current Number of Live Threads
sum(jvm_threads_live_threads{application="apinizer-cache"})
System Analyses
bilgi
Monitors overall resource usage and performance with data such as system CPU usage, process duration, and open file descriptor counts.
1. Pod CPU Usage
sum(rate(container_cpu_usage_seconds_total{namespace="apinizer"}[5m])) by (pod) * 100
2. JVM Process Duration (seconds)
sum(process_uptime_seconds)
3. Open File Descriptor Count
sum(process_files_open_files{application="apinizer-cache"})