OPA exposes an HTTP endpoint that can be used to collect performance metrics for all API calls. The Prometheus endpoint is enabled by default when you run OPA as a server.
You can enable metric collection from OPA with the following
- job_name: "opa"
The Prometheus endpoint exports Go runtime metrics as well as HTTP request latency metrics for all handlers (e.g.,
|A summary of the GC invocation durations.
|Number of goroutines that currently exist.
|Information about the Go environment.
|Number of bytes allocated and still in use.
|Total number of bytes allocated, even if freed.
|Number of bytes used by the profiling bucket hash table.
|Total number of frees.
|The fraction of this program’s available CPU time used by the GC since the program started.
|Number of bytes used for garbage collection system metadata.
|Number of heap bytes allocated and still in use.
|Number of heap bytes waiting to be used.
|Number of heap bytes that are in use.
|Number of allocated objects.
|Number of heap bytes released to OS.
|Number of heap bytes obtained from system.
|Number of seconds since 1970 of last garbage collection.
|Total number of pointer lookups.
|Total number of mallocs.
|Number of bytes in use by mcache structures.
|Number of bytes used for mcache structures obtained from system.
|Number of bytes in use by mspan structures.
|Number of bytes used for mspan structures obtained from system.
|Number of heap bytes when next garbage collection will take place.
|Number of bytes used for other system allocations.
|Number of bytes in use by the stack allocator.
|Number of bytes obtained from system for stack allocator.
|Number of bytes obtained from system.
|Number of OS threads created.
|A histogram of duration for requests.
OPA exposes a
/health API endpoint that can be used to perform health checks.
See Health API for details.
OPA provides a plugin which can push status to a remote service. See Status API for details.