diff --git a/docs/content/rest-api.md b/docs/content/rest-api.md index 09d81a57c9..ea6aae4ce4 100644 --- a/docs/content/rest-api.md +++ b/docs/content/rest-api.md @@ -2044,6 +2044,12 @@ OPA currently supports the following query performance metrics: - **timer_rego_module_parse_ns**: time taken (in nanoseconds) to parse the input policy module. - **timer_rego_module_compile_ns**: time taken (in nanoseconds) to compile the loaded policy modules. - **timer_server_handler_ns**: time take (in nanoseconds) to handle the API request. +- **counter_server_query_cache_hit**: number of cache hits for the query. + +The `counter_server_query_cache_hit` counter gives an indication about whether OPA creates a new Rego query +or it uses a pre-processed query which holds some prepared state to serve the API request. A pre-processed query will be +faster to evaluate since OPA will not have to re-parse or compile it. Hence, when the query is served from the cache +`timer_rego_query_parse_ns` and `timer_rego_query_compile_ns` timers will be omitted from the reported performance metrics. OPA also supports query instrumentation. To enable query instrumentation, specify the `instrument=true` query parameter when executing the API call.