footing 0.1.8

Feature-gated foundations for Rust backend services
Documentation
//! Stable metric, event, and tracing field names.

/// Standard metric names emitted by `footing` components.
pub mod metric_names {
    /// Total HTTP requests completed by the server.
    pub const HTTP_SERVER_REQUESTS_TOTAL: &str = "http_server_requests_total";
    /// HTTP request latency in seconds.
    pub const HTTP_SERVER_REQUEST_DURATION_SECONDS: &str = "http_server_request_duration_seconds";
    /// HTTP service errors raised before a response was produced.
    pub const HTTP_SERVER_ERRORS_TOTAL: &str = "http_server_errors_total";
    /// Rate limit decisions.
    pub const RATE_LIMIT_DECISIONS_TOTAL: &str = "rate_limit_decisions_total";
    /// Idempotency reservation decisions.
    pub const IDEMPOTENCY_REQUESTS_TOTAL: &str = "idempotency_requests_total";
    /// Worker tick attempts.
    pub const WORKER_TICKS_TOTAL: &str = "worker_ticks_total";
    /// Worker tick duration in seconds.
    pub const WORKER_TICK_DURATION_SECONDS: &str = "worker_tick_duration_seconds";
    /// Number of items processed by a worker.
    pub const WORKER_PROCESSED_TOTAL: &str = "worker_processed_total";
    /// Worker lease decisions.
    pub const WORKER_LEASE_DECISIONS_TOTAL: &str = "worker_lease_decisions_total";
    /// Service health state by component.
    pub const SERVICE_HEALTH: &str = "service_health";
}

/// Standard label names emitted by `footing` components.
pub mod metric_labels {
    /// HTTP method.
    pub const METHOD: &str = "method";
    /// HTTP route or path.
    pub const ROUTE: &str = "route";
    /// HTTP response status code.
    pub const STATUS: &str = "status";
    /// Error kind.
    pub const ERROR: &str = "error";
    /// Operation outcome.
    pub const OUTCOME: &str = "outcome";
    /// Worker name.
    pub const WORKER: &str = "worker";
    /// Health component.
    pub const COMPONENT: &str = "component";
}

/// Common metric outcome label values.
pub mod metric_outcomes {
    /// Operation succeeded.
    pub const SUCCESS: &str = "success";
    /// Operation failed.
    pub const FAILURE: &str = "failure";
    /// Request was allowed.
    pub const ALLOWED: &str = "allowed";
    /// Request was denied.
    pub const DENIED: &str = "denied";
    /// Idempotency request was reserved.
    pub const RESERVED: &str = "reserved";
    /// Idempotency request is already processing.
    pub const PROCESSING: &str = "processing";
    /// Idempotency response was replayed.
    pub const REPLAY: &str = "replay";
    /// Idempotency request conflicted.
    pub const CONFLICT: &str = "conflict";
    /// Worker lease was acquired.
    pub const ACQUIRED: &str = "acquired";
    /// Worker lease was busy.
    pub const BUSY: &str = "busy";
    /// Worker lease was renewed.
    pub const RENEWED: &str = "renewed";
    /// Worker lease was lost.
    pub const LOST: &str = "lost";
    /// Worker lease was released.
    pub const RELEASED: &str = "released";
}

/// Standard tracing field names used by `footing` and recommended for
/// application logs. Keep these stable so logs, traces, metrics, and audit
/// events can be queried consistently across services.
pub mod trace_fields {
    /// Event name.
    pub const EVENT_NAME: &str = "event_name";
    /// Event kind.
    pub const EVENT_KIND: &str = "event_kind";
    /// Request identifier.
    pub const REQUEST_ID: &str = "request_id";
    /// Trace identifier.
    pub const TRACE_ID: &str = "trace_id";
    /// Span identifier.
    pub const SPAN_ID: &str = "span_id";
    /// Actor identifier.
    pub const ACTOR_ID: &str = "actor_id";
    /// Subject identifier.
    pub const SUBJECT_ID: &str = "subject_id";
    /// Subject kind.
    pub const SUBJECT_KIND: &str = "subject_kind";
    /// User identifier.
    pub const USER_ID: &str = "user_id";
    /// Client identifier.
    pub const CLIENT_ID: &str = "client_id";
    /// Source IP.
    pub const SOURCE_IP: &str = "source_ip";
    /// Method.
    pub const METHOD: &str = "method";
    /// Route.
    pub const ROUTE: &str = "route";
    /// Path.
    pub const PATH: &str = "path";
    /// Operation.
    pub const OPERATION: &str = "operation";
    /// Outcome.
    pub const OUTCOME: &str = "outcome";
    /// Reason code.
    pub const REASON_CODE: &str = "reason_code";
    /// Error kind.
    pub const ERROR_KIND: &str = "error_kind";
    /// Error code.
    pub const ERROR_CODE: &str = "error_code";
    /// Worker.
    pub const WORKER: &str = "worker";
    /// Job.
    pub const JOB: &str = "job";
    /// Retry after ms.
    pub const RETRY_AFTER_MS: &str = "retry_after_ms";
    /// Latency ms.
    pub const LATENCY_MS: &str = "latency_ms";
}

/// Standard event names for application logs and audit-like records.
pub mod event_names {
    /// HTTP request.
    pub const HTTP_REQUEST: &str = "http.request";
    /// Worker tick.
    pub const WORKER_TICK: &str = "worker.tick";
    /// Worker batch.
    pub const WORKER_BATCH: &str = "worker.batch";
    /// Security decision.
    pub const SECURITY_DECISION: &str = "security.decision";
    /// Audit event.
    pub const AUDIT_EVENT: &str = "audit.event";
}