package metrics

import "github.com/open-policy-agent/opa/metrics"

Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.

Package metrics contains helpers for performance metric management inside the policy engine.

Index

Constants

const (
	BundleRequest       = v1.BundleRequest
	ServerHandler       = v1.ServerHandler
	ServerQueryCacheHit = v1.ServerQueryCacheHit
	SDKDecisionEval     = v1.SDKDecisionEval
	RegoQueryCompile    = v1.RegoQueryCompile
	RegoQueryEval       = v1.RegoQueryEval
	RegoQueryParse      = v1.RegoQueryParse
	RegoModuleParse     = v1.RegoModuleParse
	RegoDataParse       = v1.RegoDataParse
	RegoModuleCompile   = v1.RegoModuleCompile
	RegoPartialEval     = v1.RegoPartialEval
	RegoInputParse      = v1.RegoInputParse
	RegoLoadFiles       = v1.RegoLoadFiles
	RegoLoadBundles     = v1.RegoLoadBundles
	RegoExternalResolve = v1.RegoExternalResolve
)

Well-known metric names.

Functions

func Statistics

func Statistics(num ...int64) interface{}

Types

type Counter

type Counter = v1.Counter

Counter defines the interface for a monotonic increasing counter.

type Histogram

type Histogram = v1.Histogram

Histogram defines the interface for a histogram with hardcoded percentiles.

type Info

type Info = v1.Info

Info contains attributes describing the underlying metrics provider.

type Metrics

type Metrics = v1.Metrics

Metrics defines the interface for a collection of performance metrics in the policy engine.

func New

func New() Metrics

New returns a new Metrics object.

type Timer

type Timer = v1.Timer

Timer defines the interface for a restartable timer that accumulates elapsed time.

type TimerMetrics

type TimerMetrics = v1.TimerMetrics

Source Files

doc.go metrics.go

Version
v1.4.2 (latest)
Published
May 2, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
4 hours ago

Tools for package owners.