Example PromQL Queries for Apinizer Cache
Below are sample PromQL queries that you can use to analyze Apinizer Cache metrics.
Cache Analytics
Metrics used to monitor cache utilization and efficiency. Performance is evaluated with data such as cache lookups, additions and memory consumption.
1. Total Number of Cache Searches (for 1 hour)
sum(increase(cache_gets_total[1h]))
TEXT
2. Number of Cache Inserts (for 10 minutes)
sum(increase(cache_puts_total[10m]))
TEXT
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
TEXT
4. Number of Available Entries in the Cache
sum(cache_size)
TEXT
5. Cache Features with Highest Memory Utilization
topk(5, sum by (cache) (cache_entry_memory_bytes))
TEXT
Cache API Analysis
Cache is used to monitor the performance of API requests. The responsiveness of the system is analyzed with data such as the number of API requests and success rate.
1. Total Number of API Requests (for 1 hour)
sum(increase(apinizer_cache_api_requests_total[1h]))
TEXT
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
TEXT
JVM Analytics
By monitoring the JVM's memory usage, GC (Garbage Collector) pause times and the number of threads, the application's resource consumption and performance are evaluated.
1. Memory Utilization Percentage
(sum(jvm_memory_used_bytes{application="apinizer-cache"}) * 100) / sum(jvm_memory_max_bytes{application="apinizer-cache"})
TEXT
2. Garbage Collection Time (for 5 minutes)
sum(rate(jvm_gc_pause_seconds_sum{application="apinizer-cache"}[5m]))
TEXT
3. Number of Live Threads Available
sum(jvm_threads_live_threads{application="apinizer-cache"})
TEXT
System Analysis
Overall resource utilization and performance of the system is monitored with data such as CPU utilization, processing time and open file descriptor counts.
1. CPU Utilization of Pods
sum(rate(container_cpu_usage_seconds_total{namespace="apinizer"}[5m])) by (pod) * 100
TEXT
2. JVM Process Time (seconds)
sum(process_uptime_seconds)
TEXT
3. Number of Open File Identifiers
sum(process_files_open_files{application="apinizer-cache"})
TEXT