1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
//! Stable metric, event, and tracing field names.
/// Standard metric names emitted by `footing` components.
pub mod metric_names {
/// HTTP service calls that produced response headers, regardless of body outcome.
pub const HTTP_SERVER_REQUESTS_TOTAL: &str = "http_server_requests_total";
/// HTTP latency through response headers, excluding subsequent body consumption.
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";
/// Observed response bodies by completion, error, or incomplete drop.
pub const HTTP_SERVER_RESPONSE_BODIES_TOTAL: &str = "http_server_response_bodies_total";
/// Seconds from response headers until body completion, error, or drop.
pub const HTTP_SERVER_RESPONSE_BODY_DURATION_SECONDS: &str =
"http_server_response_body_duration_seconds";
/// Rate limit decisions.
pub const RATE_LIMIT_DECISIONS_TOTAL: &str = "rate_limit_decisions_total";
/// Failed rate-limit store checks, labeled by `stage=check` and stable `error_code`.
pub const RATE_LIMIT_STORE_ERRORS_TOTAL: &str = "rate_limit_store_errors_total";
/// Idempotency reservation decisions.
pub const IDEMPOTENCY_REQUESTS_TOTAL: &str = "idempotency_requests_total";
/// Failed idempotency store operations, labeled by `stage` and stable `error_code`.
/// Stages are `reserve`, `commit` (including terminal responses), and `cancel_commit`.
/// A timed-out cancellation commit uses `idempotency_store_timeout`.
pub const IDEMPOTENCY_STORE_ERRORS_TOTAL: &str = "idempotency_store_errors_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";
/// Stable error code; excludes backend messages and request identifiers.
pub const ERROR_CODE: &str = "error_code";
/// Fixed operation stage within a component.
pub const STAGE: &str = "stage";
/// 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 {
/// The response body reached its end without an observed body error.
pub const COMPLETED: &str = "completed";
/// The response body yielded an error.
pub const ERROR: &str = "error";
/// The response body was dropped before its end was observed.
pub const INCOMPLETE: &str = "incomplete";
/// 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";
}