arsenal-broker · metrics
Declared module signatures, types, configuration, and source documentation.
Source: arsenal/crates/arsenal-broker/src/metrics.rs. SHA-256: ad03a2d1307a0ea3ecb52d8493a52aae62b1772d8e97ba9e61d905aa14df4d70.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
metrics::RevocationDecisionSource
Revocation decision source (cache vs backend).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RevocationDecisionSource {
/// Decision was computed by consulting the backend (SQL/file/memory/http).
Backend,
/// Decision came from a positive cache entry.
CachePositive,
/// Decision came from a negative cache entry.
CacheNegative,
}Source line: 16.
metrics::RevocationDecisionSource::as_str
Convert to a stable label value.
#[must_use]
pub const fn as_str(self) -> &'static str;Source line: 28.
metrics::RevocationDecision
One revocation check outcome (for metrics labeling).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RevocationDecision {
/// Token is revoked.
Revoked,
/// Token is not revoked.
NotRevoked,
/// Revocation status could not be determined.
Unknown,
}Source line: 39.
metrics::RevocationDecision::as_str
Convert to a stable label value.
#[must_use]
pub const fn as_str(self) -> &'static str;Source line: 51.
metrics::init
Initialize metrics (Prometheus scrape endpoint).
Safe to call multiple times; initialization occurs once.
If the Prometheus exporter cannot be created, a fallback no-op provider
is used and a warning is logged via tracing.
pub fn init();Source line: 91.
metrics::render
Render Prometheus text format.
#[must_use]
pub fn render() -> String;Source line: 222.
metrics::record_revocation_check
Record a revocation check.
pub fn record_revocation_check(
backend: &'static str,
endpoint: &'static str,
result: &'static str,
decision: RevocationDecision,
source: RevocationDecisionSource,
latency_seconds: f64,
);Source line: 239.
metrics::record_revocation_cache_hit
Record a revocation cache hit (HTTP backend).
pub fn record_revocation_cache_hit(backend: &'static str, hit_type: &'static str);Source line: 281.
metrics::record_secret_delivery_denied
Record a secret delivery denial.
pub fn record_secret_delivery_denied(reason: &'static str);Source line: 295.
metrics::record_secret_request
Record a secret delivery request.
pub fn record_secret_request(result: &'static str);Source line: 304.
metrics::record_http_request
Record an HTTP request (Google-safe labels: templated route + method + status).
pub fn record_http_request(route: &'static str, method: &'static str, status: &'static str);Source line: 313.
metrics::record_proxy_request
Record a proxy request.
pub fn record_proxy_request(
target_domain: &str,
status: u16,
result: &'static str,
latency_ms: u64,
);Source line: 328.
metrics::record_fingerprint_verification
Record a fingerprint verification result.
pub fn record_fingerprint_verification(result: &'static str);Source line: 362.
metrics::record_consent_request
Record a consent request.
pub fn record_consent_request(status: &'static str);Source line: 371.
metrics::record_dct_issued
Record a DCT issuance.
pub fn record_dct_issued();Source line: 380.
metrics::record_destination_violation
Record a destination binding violation.
pub fn record_destination_violation(domain: &str);Source line: 388.