metrics

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutcomeNoMatch = "no_match" // evaluated, did not match
	OutcomeAllow   = "allow"    // whitelist match (allowed)
	OutcomeBlock   = "block"    // blocklist match (blocked)
	OutcomeError   = "error"    // evaluation error
)

Outcome for rule evaluation metrics

View Source
const (
	SignOutcomeOK       = "ok"        // 200, signed or pending
	SignOutcomeNotFound = "not_found" // 404, signer not found
	SignOutcomeRejected = "rejected"  // 403, manual approval disabled or not authorized
	SignOutcomeError    = "error"     // 500, internal error
)

Sign request outcome for request-level metrics

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler returns the HTTP handler for the /metrics endpoint (Prometheus exposition format). Bind to the same server port as the API; no authentication required.

func RecordRuleEvaluation

func RecordRuleEvaluation(ruleType, outcome string, duration time.Duration)

RecordRuleEvaluation records a rule evaluation for metrics (duration and count by outcome). ruleType is the rule type (e.g. evm_solidity_expression); outcome is one of Outcome*.

func RecordSignRequestDuration

func RecordSignRequestDuration(chainType, signType, outcome string, duration time.Duration)

RecordSignRequestDuration records the end-to-end duration of a sign request (from handler start to response). chainType is e.g. "evm"; signType is e.g. "transaction", "personal"; outcome is one of SignOutcome*.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL