Skip to main content

Overview of Apinizer Cache Metrics

Hazelcast Cache Statistics

Monitors cache performance metrics such as cache lookups, additions, latencies, and memory usage.

API Performance Metrics

Collects API performance data such as API request counts, response times, and error rates.

JVM Metrics

Provides JVM performance data such as memory usage, GC pause times, and thread counts.

System Metrics

Monitors system resource data such as CPU usage, processor count, load average, and open file counts.

Prometheus Metric Types

Cache metrics are collected using Prometheus’s four metric types. These types are designed to best represent different data types and behaviors. Each metric type serves different purposes depending on how you collect and analyze the data.

Counter

A value that only increases. It starts from zero when the application runs and only resets when the application is restarted. Ideal for tracking continuously increasing values such as total request count, error count, or completed operation count.Available Operations:
  • sum: The total value itself
  • rate: Calculates the rate of increase over time
  • increase: Calculates the total increase over a specific time range

Gauge

Represents an instantaneous value. This value can increase, decrease, or remain constant. Used to monitor an instantaneous state or level such as current memory usage, instantaneous CPU usage, or number of active threads.Available Operations:
  • sum: Sum of values grouped by labels
  • mean: Average of values grouped by labels
  • min/max: Minimum or maximum of values grouped by labels

Timer

Measures how long an operation takes (usually in milliseconds or seconds). Although not technically a special type in Prometheus, it is a metric created by libraries like Micrometer through a combination of DistributionSummary and Counter. Provides information such as average duration, maximum duration, and percentiles.Available Operations:
  • sum: Gives the total duration
  • count: Gives how many times the operation was performed in total
  • mean: Calculates the average duration of the operation
  • max: Gives the longest observed duration
  • histogram_quantile: Calculates percentiles

Summary

A metric that calculates both the total of observed values and predetermined percentiles (quantiles). The difference from Timer and DistributionSummary is that it directly collects percentiles itself; since this is calculated when metrics are collected rather than at query time, percentiles are more accurate.Available Operations:
  • sum: Total of observed values
  • count: Number of observed values
  • Predetermined percentiles (<metric_name>{quantile="0.99"})

Cache Metrics

These metrics monitor Cache’s cache performance. Efficiency is analyzed by tracking cache lookups, additions, and latencies. Additionally, memory cost and distribution by partitions are measured.
MetricDescriptionType
cache_gets_totalTotal cache lookups (hits and misses)Counter
cache_puts_totalTotal cache additionsCounter
cache_sizeCurrent number of entries in cacheGauge
cache_entriesNumber of entries per cache partitionGauge
cache_entry_memory_bytesMemory cost of cache entriesGauge
cache_gets_latency_secondsCache access latencySummary
cache_puts_latency_secondsCache addition latencySummary
cache_removals_latency_secondsCache removal latencySummary

API Metrics

These metrics monitor Cache’s API performance. API performance is evaluated with data such as request count, response time, and error rates.
MetricDescriptionType
apinizer_cache_api_requests_totalTotal API request countCounter
apinizer_cache_api_response_timeAPI response time (seconds)Timer
apinizer_cache_api_errors_totalTotal API error countCounter

JVM Metrics

These metrics monitor Cache’s memory and thread usage. JVM performance is analyzed with data such as memory usage, GC (Garbage Collection) pause times, and active threads.
MetricDescriptionType
jvm_memory_used_bytesMemory usage by area (heap/non-heap)Gauge
jvm_memory_committed_bytesCommitted memory by areaGauge
jvm_memory_max_bytesMaximum memory by areaGauge
jvm_gc_pause_secondsGC pause durationSummary
jvm_threads_live_threadsCurrent number of live threadsGauge
jvm_threads_daemon_threadsCurrent number of daemon threadsGauge

System Metrics

These metrics monitor Cache’s overall performance with data such as CPU usage, processor count, and load average. Additionally, resource usage is evaluated with data such as process duration and open file counts.
MetricDescriptionType
system_cpu_usageMain system CPU usageGauge
system_cpu_countNumber of available processorsGauge
system_load_average_1mSystem load average (1 minute)Gauge
process_cpu_usageCPU usage of JVM processGauge
process_uptime_secondsRuntime of JVM processGauge
process_files_open_filesNumber of open file descriptorsGauge